• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8CC	= gcc
9CFLAGS	= -Wall -W -O2 -g
10INCS	= -I. -I.. -I../btt
11OCFLAGS	= -UCOUNT_IOS -UDEBUG -DNDEBUG
12XCFLAGS	= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
13override CFLAGS += $(INCS) $(XCFLAGS) $(OCFLAGS)
14
15PROGS	= btrecord btreplay
16LIBS	= -laio -lrt
17
18all: depend $(PROGS)
19
20$(PROGS): | depend
21
22docs:
23	$(MAKE) -C doc all
24
25docsclean:
26	$(MAKE) -C doc clean
27
28clean: docsclean
29	-rm -f *.o $(PROGS) .depend
30
31%.o: %.c
32	$(CC) $(CFLAGS) -c -o $*.o $<
33
34btrecord: btrecord.o
35	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
36
37btreplay: btreplay.o
38	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
39
40depend:
41	@$(CC) -MM $(CFLAGS) *.c 1> .depend
42
43ifneq ($(wildcard .depend),)
44include .depend
45endif
46