summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index facdf68..9f2773e 100644
--- a/Makefile
+++ b/Makefile
@@ -8,21 +8,15 @@ PKGCONFIG_LIBS="blkid uuid libnih"
CFLAGS+=`pkg-config --cflags ${PKGCONFIG_LIBS}`
LDLIBS+=`pkg-config --libs ${PKGCONFIG_LIBS}` -lscrypt -lsodium -lkeyutils
-ifeq ($(PREFIX), "/usr")
+ifeq ($(PREFIX),/usr)
ROOT_SBINDIR=/sbin
else
ROOT_SBINDIR=$(PREFIX)/sbin
endif
+.PHONY: all
all: bcache
-install: bcache
- $(INSTALL) -m0755 bcache $(DESTDIR)$(ROOT_SBINDIR)
- $(INSTALL) -m0644 -- bcache.8 $(DESTDIR)$(PREFIX)/share/man/man8/
-
-clean:
- $(RM) bcache *.o *.a
-
CCANSRCS=$(wildcard ccan/*/*.c)
CCANOBJS=$(patsubst %.c,%.o,$(CCANSRCS))
@@ -34,5 +28,18 @@ bcache-objs = bcache.o bcache-assemble.o bcache-device.o bcache-format.o\
bcache: $(bcache-objs) libccan.a
-deb:
+.PHONY: install
+install: bcache
+ mkdir -p $(DESTDIR)$(ROOT_SBINDIR)
+ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8/
+ $(INSTALL) -m0755 bcache $(DESTDIR)$(ROOT_SBINDIR)
+ $(INSTALL) -m0755 mkfs.bcache $(DESTDIR)$(ROOT_SBINDIR)
+ $(INSTALL) -m0644 bcache.8 $(DESTDIR)$(PREFIX)/share/man/man8/
+
+.PHONY: clean
+clean:
+ $(RM) bcache *.o *.a
+
+.PHONY: deb
+deb: all
debuild -nc -us -uc -i -I