#
# GENESIS/XODUS : network simulator
#

#
# these four variables may have to be modified depending on the
# installation of the basic system files
#

CFLAGS	=	-g 
XLIB 	= 	/usr/lib
SIMDIR	=	/usr/genesis
SIMLIB 	= 	$(SIMDIR)/lib
SIMNAME =	genesis

#
# the user should place the directories of any user library
# modules in the USERDIR variable
# e.g. USERDIR = newlib1 newlib2
# An empty USERDIR has been created as an example of how it would work
#
USERDIR	= $(SIMDIR)/src/empty

#
# the user should place the pathnames of any library
# modules other than the basic system libraries in the USERLIB variable
# e.g. USERLIB = newlib1/newlib1.o newlib2/newlib2.o
#
USERLIB	= $(SIMDIR)/src/empty/emptylib.o

###################################################################
# nothing beyond this point should have to be modified by the user
# with the possible exception of "libXext.a" being added if you 
# are running X11R4
###################################################################
LIBS 	= 	-ll -lm \
		$(XLIB)/libXaw.a \
		$(XLIB)/libXt.a \
		$(XLIB)/libXmu.a \
		$(XLIB)/libXext.a \
		$(XLIB)/libX11.a 

GENESIS = 	$(SIMLIB)/simlib.o \
		$(SIMLIB)/ss.o \
		$(SIMLIB)/shelllib.o \
		$(SIMLIB)/utillib.o \
		$(SIMLIB)/buflib.o \
		$(SIMLIB)/seglib.o \
		$(SIMLIB)/synlib.o \
		$(SIMLIB)/axonlib.o \
		$(SIMLIB)/hhlib.o \
		$(SIMLIB)/devlib.o \
		$(SIMLIB)/outlib.o \
		$(SIMLIB)/userlib.o \
		$(SIMLIB)/perlib.o \
		$(SIMLIB)/olflib.o \
		$(SIMLIB)/toollib.o \
		loadlib.o

XODUS 	=	$(SIMLIB)/widglib.o\
		$(SIMLIB)/xolib.o\
		$(SIMLIB)/comlib.o\
		$(SIMLIB)/genlib.o\
		$(SIMLIB)/drawlib.o

default: userlibs $(SIMNAME)

userlibs:
	@(for i in $(USERDIR); do echo cd $$i; cd $$i; make INSTALL=$(SIMDIR); cd ..;done)

loadlib.c: liblist
	/usr/genesis/src/libsh < liblist > loadlib.c

$(SIMNAME): $(GENESIS) $(XODUS) $(USERLIB)
	$(CC) $(CFLAGS) $(GENESIS) $(XODUS) $(USERLIB) $(LIBS) -o $(SIMNAME)

