Added tag v0.13 for changeset 58b803dc9fae
[btrfs-progs-unstable.git] / Makefile
blob115be6b48a135a7958f84ca03ca59417887f580b
1 CC=gcc
2 AM_CFLAGS = -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
3 CFLAGS = -g -Werror
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_map.o \
8 CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
9 -Wuninitialized -Wshadow -Wundef
10 DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
12 INSTALL= install
13 prefix ?= /usr/local
14 bindir = $(prefix)/bin
16 progs = btrfsctl btrfsck mkfs.btrfs debug-tree
18 # make C=1 to enable sparse
19 ifdef C
20 check=sparse $(CHECKFLAGS)
21 else
22 check=ls
23 endif
25 .c.o:
26 $(check) $<
27 $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
30 all: $(progs)
32 btrfsctl: btrfsctl.o
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 utils.o
39 gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o utils.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)
50 convert: $(objects) convert.o utils.o
51 gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o utils.o -luuid -lext2fs $(LDFLAGS)
53 clean :
54 rm -f $(progs) cscope.out *.o .*.d btrfs-convert
56 install: $(progs)
57 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
58 $(INSTALL) $(progs) $(DESTDIR)$(bindir)
59 if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi
61 -include .*.d