Add raid10 support
[btrfs-progs-unstable/devel.git] / Makefile
blob63fddcf00fd1504530c7fe094f5c15b807f554bc
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_io.o \
7 volumes.o utils.o
9 CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
10 -Wuninitialized -Wshadow -Wundef
11 DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
13 INSTALL= install
14 prefix ?= /usr/local
15 bindir = $(prefix)/bin
16 LIBS=-luuid
18 progs = btrfsctl btrfsck mkfs.btrfs debug-tree quick-test
20 # make C=1 to enable sparse
21 ifdef C
22 check=sparse $(CHECKFLAGS)
23 else
24 check=ls
25 endif
27 .c.o:
28 $(check) $<
29 $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
32 all: $(progs)
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)
55 clean :
56 rm -f $(progs) cscope.out *.o .*.d btrfs-convert
58 install: $(progs)
59 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
60 $(INSTALL) $(progs) $(DESTDIR)$(bindir)
61 if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi
63 -include .*.d