blob: 0720169b6d66cc4e559b5e83a7655b348ca69031 [file] [log] [blame]
Chris Masonaa5d6be2007-02-28 16:35:06 -05001CC=gcc
Chris Masone089f052007-03-16 16:20:31 -04002CFLAGS = -g -Wall -Werror
Chris Mason631d7d92007-03-20 09:13:49 -04003headers = radix-tree.h ctree.h disk-io.h kerncompat.h print-tree.h list.h \
4 transaction.h
Chris Mason1261ec42007-03-20 20:35:03 -04005objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
Chris Mason9f5fae22007-03-20 14:38:32 -04006 root-tree.o dir-item.o hash.o file-item.o inode-item.o \
7 inode-map.o \
Chris Masoneb60cea2007-02-02 09:18:22 -05008
Chris Masonaf86d072007-02-28 09:40:58 -05009# if you don't have sparse installed, use ls instead
Chris Masonaa5d6be2007-02-28 16:35:06 -050010CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
11 -Wcontext -Wcast-truncate -Wuninitialized -Wshadow -Wundef
12check=sparse $(CHECKFLAGS)
Chris Masonaf86d072007-02-28 09:40:58 -050013#check=ls
14
15.c.o:
16 $(check) $<
17 $(CC) $(CFLAGS) -c $<
Chris Masoneb60cea2007-02-02 09:18:22 -050018
Chris Mason1261ec42007-03-20 20:35:03 -040019all: tester debug-tree quick-test dir-test tags mkfs.btrfs
20
21mkfs.btrfs: $(objects) mkfs.o
22 gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o
Chris Masonfec577f2007-02-26 10:40:21 -050023
24debug-tree: $(objects) debug-tree.o
25 gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o
26
27tester: $(objects) random-test.o
28 gcc $(CFLAGS) -o tester $(objects) random-test.o
Chris Mason4920c9a2007-01-26 16:38:42 -050029
Chris Mason1d4f6402007-03-15 15:18:43 -040030dir-test: $(objects) dir-test.o
31 gcc $(CFLAGS) -o dir-test $(objects) dir-test.o
Chris Mason79f95c82007-03-01 15:16:26 -050032quick-test: $(objects) quick-test.o
33 gcc $(CFLAGS) -o quick-test $(objects) quick-test.o
34
Chris Mason7518a232007-03-12 12:01:18 -040035$(objects): $(headers)
Chris Mason5de08d72007-02-24 06:24:44 -050036
37clean :
Chris Mason7cf75962007-02-26 10:55:01 -050038 rm debug-tree tester *.o
Chris Mason4920c9a2007-01-26 16:38:42 -050039
Chris Masonfec577f2007-02-26 10:40:21 -050040