2 AM_CFLAGS
= -Wall
-D_FILE_OFFSET_BITS
=64 -D_FORTIFY_SOURCE
=2
3 CFLAGS
= -g
-Werror
-Os
4 objects
= ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
5 root-tree.o dir-item.o file-item.o inode-item.o \
6 inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o \
10 CHECKFLAGS
=-D__linux__
-Dlinux
-D__STDC__
-Dunix
-D__unix__
-Wbitwise \
11 -Wuninitialized
-Wshadow
-Wundef
12 DEPFLAGS
= -Wp
,-MMD
,$(@D
)/.
$(@F
).d
,-MT
,$@
16 bindir = $(prefix)/bin
19 progs
= btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \
20 btrfs-map-logical btrfs-list
22 # make C=1 to enable sparse
24 check=sparse
$(CHECKFLAGS
)
31 $(CC
) $(DEPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
) -c
$<
34 all: version
$(progs
) manpages
39 btrfs-list
: $(objects
) btrfs-list.o
40 gcc
$(CFLAGS
) -o btrfs-list btrfs-list.o
$(objects
) $(LDFLAGS
) $(LIBS
)
42 btrfsctl
: $(objects
) btrfsctl.o
43 gcc
$(CFLAGS
) -o btrfsctl btrfsctl.o
$(objects
) $(LDFLAGS
) $(LIBS
)
45 btrfs-vol
: $(objects
) btrfs-vol.o
46 gcc
$(CFLAGS
) -o btrfs-vol btrfs-vol.o
$(objects
) $(LDFLAGS
) $(LIBS
)
48 btrfs-show
: $(objects
) btrfs-show.o
49 gcc
$(CFLAGS
) -o btrfs-show btrfs-show.o
$(objects
) $(LDFLAGS
) $(LIBS
)
51 btrfsck
: $(objects
) btrfsck.o
52 gcc
$(CFLAGS
) -o btrfsck btrfsck.o
$(objects
) $(LDFLAGS
) $(LIBS
)
54 mkfs.btrfs
: $(objects
) mkfs.o
55 gcc
$(CFLAGS
) -o mkfs.btrfs
$(objects
) mkfs.o
$(LDFLAGS
) $(LIBS
)
57 btrfs-debug-tree
: $(objects
) debug-tree.o
58 gcc
$(CFLAGS
) -o btrfs-debug-tree
$(objects
) debug-tree.o
$(LDFLAGS
) $(LIBS
)
60 btrfstune
: $(objects
) btrfstune.o
61 gcc
$(CFLAGS
) -o btrfstune
$(objects
) btrfstune.o
$(LDFLAGS
) $(LIBS
)
63 btrfs-map-logical
: $(objects
) btrfs-map-logical.o
64 gcc
$(CFLAGS
) -o btrfs-map-logical
$(objects
) btrfs-map-logical.o
$(LDFLAGS
) $(LIBS
)
66 btrfs-image
: $(objects
) btrfs-image.o
67 gcc
$(CFLAGS
) -o btrfs-image
$(objects
) btrfs-image.o
-lpthread
-lz
$(LDFLAGS
) $(LIBS
)
69 dir-test
: $(objects
) dir-test.o
70 gcc
$(CFLAGS
) -o dir-test
$(objects
) dir-test.o
$(LDFLAGS
) $(LIBS
)
72 quick-test
: $(objects
) quick-test.o
73 gcc
$(CFLAGS
) -o quick-test
$(objects
) quick-test.o
$(LDFLAGS
) $(LIBS
)
75 convert
: $(objects
) convert.o
76 gcc
$(CFLAGS
) -o btrfs-convert
$(objects
) convert.o
-lext2fs
$(LDFLAGS
) $(LIBS
)
85 rm -f
$(progs
) cscope.out
*.o .
*.d btrfs-convert
88 install: $(progs
) install-man
89 $(INSTALL
) -m755
-d
$(DESTDIR
)$(bindir)
90 $(INSTALL
) $(progs
) $(DESTDIR
)$(bindir)
91 if
[ -e btrfs-convert
]; then
$(INSTALL
) btrfs-convert
$(DESTDIR
)$(bindir); fi