1 # 2 # OCFLAGS: 3 # COUNT_IOS - Counts struct io's left at end 4 # DEBUG - Various and sundy debug asserts 5 # NDEBUG - Defined: no asserts, Undefined: asserts 6 # 7 8 CC = gcc 9 CFLAGS = -Wall -W -O2 -g 10 INCS = -I. -I.. -I../btt 11 OCFLAGS = -UCOUNT_IOS -UDEBUG -DNDEBUG 12 XCFLAGS = -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 13 override CFLAGS += $(INCS) $(XCFLAGS) $(OCFLAGS) 14 15 PROGS = btrecord btreplay 16 LIBS = -laio -lrt 17 18 all: depend $(PROGS) 19 20 $(PROGS): | depend 21 22 docs: 23 $(MAKE) -C doc all 24 25 docsclean: 26 $(MAKE) -C doc clean 27 28 clean: docsclean 29 -rm -f *.o $(PROGS) .depend 30 31 %.o: %.c 32 $(CC) $(CFLAGS) -c -o $*.o $< 33 34 btrecord: btrecord.o 35 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) 36 37 btreplay: btreplay.o 38 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) 39 40 depend: 41 @$(CC) -MM $(CFLAGS) *.c 1> .depend 42 43 ifneq ($(wildcard .depend),) 44 include .depend 45 endif 46