blob: ea3e1493baa93e24bbd2e6edfe6ff94db4d7cef3 [file] [log] [blame]
Chris Masonaa5d6be2007-02-28 16:35:06 -05001CC=gcc
Chris Mason0579da42007-03-07 16:15:30 -05002CFLAGS = -g -Wall
Chris Masona28ec192007-03-06 20:08:01 -05003headers = radix-tree.h ctree.h disk-io.h kerncompat.h print-tree.h list.h
Chris Mason3768f362007-03-13 16:47:54 -04004objects = ctree.o disk-io.o radix-tree.o mkfs.o extent-tree.o print-tree.o \
Chris Mason62e27492007-03-15 12:56:47 -04005 root-tree.o dir-item.o hash.o
Chris Masoneb60cea2007-02-02 09:18:22 -05006
Chris Masonaf86d072007-02-28 09:40:58 -05007# if you don't have sparse installed, use ls instead
Chris Masonaa5d6be2007-02-28 16:35:06 -05008CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
9 -Wcontext -Wcast-truncate -Wuninitialized -Wshadow -Wundef
10check=sparse $(CHECKFLAGS)
Chris Masonaf86d072007-02-28 09:40:58 -050011#check=ls
12
13.c.o:
14 $(check) $<
15 $(CC) $(CFLAGS) -c $<
Chris Masoneb60cea2007-02-02 09:18:22 -050016
Chris Mason1d4f6402007-03-15 15:18:43 -040017all: tester debug-tree quick-test dir-test
Chris Masonfec577f2007-02-26 10:40:21 -050018
19debug-tree: $(objects) debug-tree.o
20 gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o
21
22tester: $(objects) random-test.o
23 gcc $(CFLAGS) -o tester $(objects) random-test.o
Chris Mason4920c9a2007-01-26 16:38:42 -050024
Chris Mason1d4f6402007-03-15 15:18:43 -040025dir-test: $(objects) dir-test.o
26 gcc $(CFLAGS) -o dir-test $(objects) dir-test.o
Chris Mason79f95c82007-03-01 15:16:26 -050027quick-test: $(objects) quick-test.o
28 gcc $(CFLAGS) -o quick-test $(objects) quick-test.o
29
Chris Mason7518a232007-03-12 12:01:18 -040030$(objects): $(headers)
Chris Mason5de08d72007-02-24 06:24:44 -050031
32clean :
Chris Mason7cf75962007-02-26 10:55:01 -050033 rm debug-tree tester *.o
Chris Mason4920c9a2007-01-26 16:38:42 -050034
Chris Masonfec577f2007-02-26 10:40:21 -050035