# I have assumes GNU make here, hopefully this will work for other makes too. CC=gcc CFLAGS=-g TEST_APPS=foxtest1 foxtest2 foxtest3 all: libfox.a $(TEST_APPS) SOURCES=atoi.cpp trace-n.cpp fox-n.cpp overlay_displacement.cpp error.cpp OBJECTS = $(SOURCES:.cpp=.o) libfox.a: $(OBJECTS) ar rcv libfox.a $(OBJECTS) foxtest1: libfox.a foxtest1.o gcc -g -o foxtest1 foxtest1.o -L. -lfox -lm foxtest2: libfox.a foxtest2.o gcc -g -o foxtest2 foxtest2.o -L. -lfox -lm foxtest3: libfox.a foxtest3.o gcc -g -o foxtest3 foxtest3.o -L. -lfox -lm ########## Rules %.o : %.cpp $(CC) -c $(CFLAGS) $< clean: -rm -f *.o *~ libfox.a $(TEST_APPS) ########## Dependencies atoi.o: atoi.cpp atoi.h foxstuff.h cftype-n.h error.h cftype-n.o: cftype-n.cpp cftype-n.h error.o: error.cpp error.h fox-n.o: fox-n.cpp foxstuff.h cftype-n.h error.h fox-n.h trace-n.h atoi.h foxstuff.o: foxstuff.cpp foxstuff.h cftype-n.h error.h overlay_displacement.o: overlay_displacement.cpp foxstuff.h cftype-n.h error.h trace-n.o: trace-n.cpp trace-n.h cftype-n.h atoi.h foxstuff.h error.h