2 AM_CFLAGS = -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
4 objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
5 root-tree.o dir-item.o hash.o file-item.o inode-item.o \
6 inode-map.o crc32c.o rbtree.o extent-cache.o \
8 CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
9 -Wuninitialized -Wshadow -Wundef
10 DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
14 bindir = $(prefix)/bin
16 progs = btrfsctl btrfsck mkfs.btrfs debug-tree
18 # make C=1 to enable sparse
20 check=sparse $(CHECKFLAGS)
27 $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
33 gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(LDFLAGS)
35 btrfsck: $(objects) btrfsck.o bit-radix.o
36 gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS)
38 mkfs.btrfs: $(objects) mkfs.o
39 gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o -luuid $(LDFLAGS)
41 debug-tree: $(objects) debug-tree.o
42 gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o -luuid $(LDFLAGS)
44 dir-test: $(objects) dir-test.o
45 gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS)
47 quick-test: $(objects) quick-test.o
48 gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS)
51 rm -f $(progs) cscope.out *.o .*.d
54 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
55 $(INSTALL) $(progs) $(DESTDIR)$(bindir)