# Athena widgets
# WIDGETLIBRARY = -lXaw

# Motif
# EXTRACFLAGS = -DMOTIF
# WIDGETLIBRARY = -lXm

# color
# EXTRACFLAGS = -DCOLOR_DISPLAY

# Motif and color
EXTRACFLAGS = -DMOTIF -DCOLOR_DISPLAY
WIDGETLIBRARY = -lXm

# On RS6000 you may need to invoke the C-Compiler as xlc or c89, instead of cc
# (reason currently unknown)
# CC = xlc
# CC = gcc

RANLIB = /bin/true
RM = rm -f

CDEBUGFLAGS = -g
# CXINCLUDEFLAGS = -I/usr/local/X11R5/include
# SOLARIS
# CXINCLUDEFLAGS = -I$(OPENWINHOME)/include
# SGI Motif
# CXINCLUDEFLAGS= -I/usr/include/abi

EXTRALDFLAGS=
# SOLARIS
# EXTRALDFLAGS=-R/usr/local/X11R5/lib -lsocket -lnsl -lgen
# LDXDIRFLAGS = -L/usr/local/X11R5/lib

CFLAGS = -Ilib $(CDEBUGFLAGS) $(CXINCLUDEFLAGS) $(EXTRACFLAGS)
LDFLAGS = -Llib $(LDXDIRFLAGS) -lXhdg $(WIDGETLIBRARY) -lXmu -lXt -lXext -lX11 -lm $(EXTRALDFLAGS)

all:: test/Graph_test


# if the implicit rules of your make are not approbiate for compiling in
# subdirectories use gmake or the following rules
# COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
# 
# .c.o:
#	$(COMPILE.c) -o $(<:.c=.o) $<
#
# .c.a:
#	$(COMPILE.c) -o $% $<
#	$(AR) $(ARFLAGS) $@ $%
#	$(RM) $%
#

test/Graph_test: test/Graph_test.o lib/libXhdg.a
	$(CC) -o $@ test/Graph_test.o $(LDFLAGS)
test/Graph_test.o: test/Graph_test.c lib/Graph.h

lib/libXhdg.a: lib/libXhdg.a(lib/Graph.o) lib/libXhdg.a(lib/Graph_draw.o) lib/libXhdg.a(lib/Graph_layout.o) lib/libXhdg.a(lib/sc-queue.o)
	$(RANLIB) $@

lib/libXhdg.a(lib/Graph.o): lib/Graph.c lib/GraphP.h lib/sc-queue.h lib/Graph_layout.h lib/Graph_draw.h

lib/libXhdg.a(lib/Graph_draw.o): lib/Graph_draw.c lib/GraphP.h lib/Graph_layout.h lib/Graph_draw.h

lib/libXhdg.a(lib/Graph_layout.o): lib/Graph_layout.c lib/GraphP.h lib/Graph_layout.h

lib/libXhdg.a(lib/sc-queue.o): lib/sc-queue.c lib/sc-queue.h

clean::
	- $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut   "#"*
	- $(RM) lib/*.CKP lib/*.ln lib/*.BAK lib/*.bak lib/*.o lib/core lib/errs lib/,* lib/*~ lib/*.a lib/.emacs_* lib/tags lib/TAGS lib/make.log lib/MakeOut   lib/"#"*
	- $(RM) test/*.CKP test/*.ln test/*.BAK test/*.bak test/*.o test/core test/errs test/,* test/*~ test/*.a test/.emacs_* test/tags test/TAGS test/make.log test/MakeOut   test/"#"* test/Graph_test
