2 AM_CFLAGS = -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
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 extent_io.o \
9 CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
10 -Wuninitialized -Wshadow -Wundef
11 DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
15 bindir = $(prefix)/bin
18 progs = btrfsctl btrfsck mkfs.btrfs debug-tree quick-test btrfs-show
20 # make C=1 to enable sparse
22 check=sparse $(CHECKFLAGS)
29 $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
34 btrfsctl: $(objects) btrfsctl.o
35 gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
37 btrfs-show: $(objects) btrfs-show.o
38 gcc $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS)
40 btrfsck: $(objects) btrfsck.o bit-radix.o
41 gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS) $(LIBS)
43 mkfs.btrfs: $(objects) mkfs.o
44 gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS)
46 debug-tree: $(objects) debug-tree.o
47 gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS)
49 dir-test: $(objects) dir-test.o
50 gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
52 quick-test: $(objects) quick-test.o
53 gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
55 convert: $(objects) convert.o
56 gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS)
59 rm -f $(progs) cscope.out *.o .*.d btrfs-convert
62 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
63 $(INSTALL) $(progs) $(DESTDIR)$(bindir)
64 if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi