
### MODIFY THESE VARIABLES FOR YOUR SYSTEM ###

# which C++ compiler
CC		= g++

# location of compiler-specific C++ include files (may not be needed)
# CPPINC		= 

# location of X11/Xm include files
XINC		= 

# location of X11/Xm libraries
XLIB		= /usr/lib/X11

# location to install libDD++.a
LIBINSTALLDIR 	= /usr/lib/X11

# location to install DD++ include directory
INCINSTALLDIR 	= /usr/include/

# debug flags
DEBUG		=  -g

# comment these out if you don't have the xpm library
XPM_FLAG 	=  -DHAVE_XPMLIB
XPM_LIB		=  -lXpm


# Uncomment if you want to use XDR features
# XDR_FLAG = -DDD_USE_XDR

# Set XDRLIB if Xdr implementation is not in your system C library 
XDRLIB     =

# archiving command - the first is the traditional and the
# second is for solaris
ARCHIVE		= ar rv $@ $?
#ARCHIVE         = $(CC) -xar -o $@ $?

# ranlib command - the first is the traditional and the
# second is for solaris ( there is none )
RANLIB		= ranlib $@
#RANLIB		= 

### DO NOT MODIFY ANYTHING BELOW HERE ###

LIBNAME		= libDD++.a
INCDIRS 	= -I./include  $(CPPINC)  $(XINC)
LIBDIRS 	= -L./lib  -L$(XLIB)
CXXFLAGS 	= $(INCDIRS)  $(DEBUG)   $(XPM_FLAG) $(XDR_FLAG)
LDFLAGS 	= $(INCDIRS)  $(LIBDIRS)  $(DEBUG)
LIBS 		= -lDD++  $(XPM_LIB)  $(XDR_LIB) -lXm  -lXt  -lX11  -lm

all:  lib/$(LIBNAME)  \
      test/DragTest  \
      test/DropTest  \
      test/DragDropTest \
      test/DropTrash

# rules for making the DD++ library

libObjects = lib/Drag.o  \
	     lib/Drop.o  \
	     lib/SpecificDragSite.o  \
	     lib/DDstream.o  \
	     lib/XPixmap.o

lib/%.o : lib/%.C
	$(CC) -c $(CXXFLAGS) -o $@ $<

lib/$(LIBNAME): $(libObjects)
	$(ARCHIVE) 
	$(RANLIB)

install: all
	install -c $(LIBNAME) $(LIBINSTALLDIR)
	ranlib $(LIBINSTALLDIR)/$(LIBNAME)
	chmod 664 $(LIBINSTALLDIR)/$(LIBNAME)
	cp -r include/DD++ $(INCINSTALLDIR)

# rules for making test programs

test/%.o : test/%.C
	$(CC) -c $(CXXFLAGS) -o $@ $<

test/DragTest : test/DragTest.o lib/$(LIBNAME)
	$(CC) $(LDFLAGS) -o $@ test/DragTest.o $(LIBS)

test/DropTest : test/DropTest.o lib/$(LIBNAME)
	$(CC) $(LDFLAGS) -o  $@ test/DropTest.o $(LIBS)

test/DragDropTest : test/DragDropTest.o lib/$(LIBNAME)
	$(CC) $(LDFLAGS) -o  $@  test/DragDropTest.o $(LIBS)

test/DropTrash : test/DropTrash.o lib/$(LIBNAME)
	$(CC) $(LDFLAGS) -o  $@ test/DropTrash.o $(LIBS)

tar:
	tar cvf DD++1.2.tar makefile README-1.2 COPYRIGHT include lib test
	gzip DD++1.2.tar

clean:
	rm -f lib/$(LIBNAME) lib/*.o test/*.o test/DragTest test/DropTest test/DragDropTest test/DropTrash

# DO NOT DELETE THIS LINE -- make depend depends on it.

DDstream.o: ./include/DD++/DDstream.H 
Drag.o: ./include/DD++/DD.H
Drag.o: ./include/DD++/XPixmap.H
Drop.o: ./include/DD++/DD.H
Drop.o: ./include/DD++/XPixmap.H
SpecificDragSite.o: ./include/DD++/SpecificDragSite.H ./include/DD++/DD.H
SpecificDragSite.o: /usr/include/Xm/DragOverS.h ./include/DD++/XPixmap.H
XPixmap.o: ./include/DD++/XPixmap.H
DragDropTest.o: /usr/include/Xm/PushB.h ./include/DD++/DDstring.H
DragDropTest.o: ./include/DD++/DD.H
DragDropTest.o: ./include/DD++/XPixmap.H ./include/DD++/SpecificDragSite.H
DragTest.o: ./include/DD++/DDstring.H ./include/DD++/DD.H
DragTest.o: ./include/DD++/XPixmap.H ./include/DD++/DDint.H
DragTest.o: ./include/DD++/DDdouble.H ./include/DD++/SpecificDragSite.H
DropTest.o: ./include/DD++/DDstring.H ./include/DD++/DD.H
DropTest.o: ./include/DD++/XPixmap.H ./include/DD++/DDint.H
DropTest.o: ./include/DD++/DDdouble.H
DropTest2.o: ./include/DD++/DDstring.H ./include/DD++/DD.H
DropTest2.o: ./include/DD++/XPixmap.H ./include/DD++/DDint.H
DropTrash.o: ./include/DD++/DDstring.H ./include/DD++/DD.H
DropTrash.o: ./include/DD++/XPixmap.H ./include/DD++/DDint.H
