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
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 btrfsck
: $(objects
) btrfsck.o bit-radix.o
38 gcc
$(CFLAGS
) -o btrfsck btrfsck.o
$(objects
) bit-radix.o
$(LDFLAGS
) $(LIBS
)
40 mkfs.btrfs
: $(objects
) mkfs.o
41 gcc
$(CFLAGS
) -o mkfs.btrfs
$(objects
) mkfs.o
$(LDFLAGS
) $(LIBS
)
43 debug-tree
: $(objects
) debug-tree.o
44 gcc
$(CFLAGS
) -o debug-tree
$(objects
) debug-tree.o
$(LDFLAGS
) $(LIBS
)
46 dir-test
: $(objects
) dir-test.o
47 gcc
$(CFLAGS
) -o dir-test
$(objects
) dir-test.o
$(LDFLAGS
) $(LIBS
)
49 quick-test
: $(objects
) quick-test.o
50 gcc
$(CFLAGS
) -o quick-test
$(objects
) quick-test.o
$(LDFLAGS
) $(LIBS
)
52 convert
: $(objects
) convert.o
53 gcc
$(CFLAGS
) -o btrfs-convert
$(objects
) convert.o
-lext2fs
$(LDFLAGS
) $(LIBS
)
56 rm -f
$(progs
) cscope.out
*.o .
*.d btrfs-convert
59 $(INSTALL
) -m755
-d
$(DESTDIR
)$(bindir)
60 $(INSTALL
) $(progs
) $(DESTDIR
)$(bindir)
61 if
[ -e btrfs-convert
]; then
$(INSTALL
) btrfs-convert
$(DESTDIR
)$(bindir); fi