# Makefile 0.4.1 (1999-Dec-18-Sat) # Adam M. Costello # Example Makefile # If purify is available, it's supposed to be a nice debugging tool, but # it might not work with gcc. # #PURIFY = purify PURIFY = # We need an ANSI conformant C compiler. Furthermore, we'd like the # compiler to check the code for ANSI conformance, so that it will still # compile when someone else uses a different ANSI C compiler. # If gcc is installed, this works: # CC = gcc -ansi -pedantic -Wall # On Solaris machines, this works provided /usr/ucb/cc is *not* the # first cc in your PATH: # #CC = cc -Xc # On HP-UX machines, this works: # #CC = cc -Aa # On any POSIX-conformant system, this will compile the code, but not # check it for conformance: # #CC = c89 CFLAGS = -g OBJS = crc32.o event.o integer.o network.o random.o streamers.o transport.o SIMOBJS = $(OBJS) main.o warnf.o TESTOBJS = $(OBJS) tester.o warnf.o RTOBJS = $(OBJS) runtest.o simulator: $(SIMOBJS) $(PURIFY) $(CC) $(CFLAGS) -o $@ $(SIMOBJS) -lm tester: $(TESTOBJS) $(PURIFY) $(CC) $(CFLAGS) -o $@ $(TESTOBJS) -lm runtest: $(RTOBJS) $(PURIFY) $(CC) $(CFLAGS) -o $@ $(RTOBJS) -lm test: force ./test clean: rm -f simulator tester runtest *.o force: no-such-file no-such-file: crc32.c: crc32.h touch $@ deliver_packet.h: network.h touch $@ event.c: timer_expire.h timer.h warnf.h touch $@ integer.c: integer.h touch $@ main.c: deliver_packet.h network.h streamers.h timer_expire.h transport.h touch $@ network.c: deliver_packet.h network.h network_config.h random.h timer.h warnf.h touch $@ random.c: random.h touch $@ runtest.c: deliver_packet.h network.h network_config.h random.h streamers.h \ timer.h timer_expire.h transport.h warnf.h touch $@ streamers.c: bytestream.h integer.h random.h streamers.h timer.h warnf.h touch $@ streamers.h: bytestream.h integer.h touch $@ tester.c: deliver_packet.h network.h network_config.h random.h streamers.h \ timer.h timer_expire.h transport.h warnf.h touch $@ transport.c: bytestream.h crc32.h integer.h network.h random.h timer.h \ transport.h warnf.h touch $@ transport.h: bytestream.h network.h touch $@ warnf.c: warnf.h touch $@