]> git.sesse.net Git - bcachefs-tools-debian/blob - Makefile
facdf683102130253bec4fabad1ba42874176c33
[bcachefs-tools-debian] / Makefile
1
2 PREFIX=/usr
3 INSTALL=install
4 CFLAGS+=-std=gnu99 -O2 -Wall -g -D_FILE_OFFSET_BITS=64 -I.
5 LDFLAGS+=-static
6
7 PKGCONFIG_LIBS="blkid uuid libnih"
8 CFLAGS+=`pkg-config --cflags    ${PKGCONFIG_LIBS}`
9 LDLIBS+=`pkg-config --libs      ${PKGCONFIG_LIBS}` -lscrypt -lsodium -lkeyutils
10
11 ifeq ($(PREFIX), "/usr")
12         ROOT_SBINDIR=/sbin
13 else
14         ROOT_SBINDIR=$(PREFIX)/sbin
15 endif
16
17 all: bcache
18
19 install: bcache
20         $(INSTALL) -m0755 bcache $(DESTDIR)$(ROOT_SBINDIR)
21         $(INSTALL) -m0644 -- bcache.8 $(DESTDIR)$(PREFIX)/share/man/man8/
22
23 clean:
24         $(RM) bcache *.o *.a
25
26 CCANSRCS=$(wildcard ccan/*/*.c)
27 CCANOBJS=$(patsubst %.c,%.o,$(CCANSRCS))
28
29 libccan.a: $(CCANOBJS)
30         $(AR) r $@ $(CCANOBJS)
31
32 bcache-objs = bcache.o bcache-assemble.o bcache-device.o bcache-format.o\
33         bcache-fs.o bcache-run.o bcache-key.o libbcache.o crypto.o util.o
34
35 bcache: $(bcache-objs) libccan.a
36
37 deb:
38         debuild -nc -us -uc -i -I