Add btrfs subvol find-new command
[btrfs-progs-unstable.git] / Makefile
blob525676e179a681a1b975aca4a2f13151d6aa7128
1 CC=gcc
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 \
7 volumes.o utils.o btrfs-list.o
10 CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
11 -Wuninitialized -Wshadow -Wundef
12 DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
14 INSTALL= install
15 prefix ?= /usr/local
16 bindir = $(prefix)/bin
17 LIBS=-luuid
19 progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \
20 btrfs \
21 btrfs-map-logical
23 # make C=1 to enable sparse
24 ifdef C
25 check=sparse $(CHECKFLAGS)
26 else
27 check=ls
28 endif
30 .c.o:
31 $(check) $<
32 $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
35 all: version $(progs) manpages
37 version:
38 bash version.sh
40 btrfs: $(objects) btrfs.o btrfs_cmds.o
41 gcc $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o \
42 $(objects) $(LDFLAGS) $(LIBS)
44 btrfsctl: $(objects) btrfsctl.o
45 gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
47 btrfs-vol: $(objects) btrfs-vol.o
48 gcc $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS)
50 btrfs-show: $(objects) btrfs-show.o
51 gcc $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS)
53 btrfsck: $(objects) btrfsck.o
54 gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS)
56 mkfs.btrfs: $(objects) mkfs.o
57 gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS)
59 btrfs-debug-tree: $(objects) debug-tree.o
60 gcc $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS)
62 btrfstune: $(objects) btrfstune.o
63 gcc $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS)
65 btrfs-map-logical: $(objects) btrfs-map-logical.o
66 gcc $(CFLAGS) -o btrfs-map-logical $(objects) btrfs-map-logical.o $(LDFLAGS) $(LIBS)
68 btrfs-image: $(objects) btrfs-image.o
69 gcc $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz $(LDFLAGS) $(LIBS)
71 dir-test: $(objects) dir-test.o
72 gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
74 quick-test: $(objects) quick-test.o
75 gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
77 convert: $(objects) convert.o
78 gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS)
80 ioctl-test: $(objects) ioctl-test.o
81 gcc $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)
83 manpages:
84 cd man; make
86 install-man:
87 cd man; make install
89 clean :
90 rm -f $(progs) cscope.out *.o .*.d btrfs-convert
91 cd man; make clean
93 install: $(progs) install-man
94 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
95 $(INSTALL) $(progs) $(DESTDIR)$(bindir)
96 if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi
98 -include .*.d