ioctls to scan for btrfs filesystems
[btrfs-progs-unstable/devel.git] / Makefile
blobff7ddadab81a5cc91d5f365d2feff7e84964af3f
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
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
17 progs = btrfsctl btrfsck mkfs.btrfs debug-tree
19 # make C=1 to enable sparse
20 ifdef C
21 check=sparse $(CHECKFLAGS)
22 else
23 check=ls
24 endif
26 .c.o:
27 $(check) $<
28 $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
31 all: $(progs)
33 btrfsctl: btrfsctl.o
34 gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(LDFLAGS)
36 btrfsck: $(objects) btrfsck.o bit-radix.o
37 gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS)
39 mkfs.btrfs: $(objects) mkfs.o utils.o
40 gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o utils.o -luuid $(LDFLAGS)
42 debug-tree: $(objects) debug-tree.o
43 gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o -luuid $(LDFLAGS)
45 dir-test: $(objects) dir-test.o
46 gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS)
48 quick-test: $(objects) quick-test.o
49 gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS)
51 convert: $(objects) convert.o utils.o
52 gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o utils.o -luuid -lext2fs $(LDFLAGS)
54 clean :
55 rm -f $(progs) cscope.out *.o .*.d btrfs-convert
57 install: $(progs)
58 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
59 $(INSTALL) $(progs) $(DESTDIR)$(bindir)
60 if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi
62 -include .*.d