From 83e3d65be93f67e18c1696961555b3bc88abb97a Mon Sep 17 00:00:00 2001 From: Alex Young Date: Fri, 21 Feb 2014 19:39:27 +0000 Subject: [PATCH] Update the Makefile to work with dpkg-buildpackage --- Makefile | 9 ++++++++- debian/rules | 6 ------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9b48b0b..d35fb5e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ #!/usr/bin/make -f VPATH=src:tests/unit +DESTDIR?=/ +PREFIX?=/usr/local/bin +INSTALLDIR=$(DESTDIR)/$(PREFIX) ifdef DEBUG CFLAGS_EXTRA=-g -DDEBUG @@ -36,6 +39,8 @@ SRCS := $(COMMON_SRC) $(SERVER_SRC) $(PROXY_SRC) OBJS := $(COMMON_OBJ) $(SERVER_OBJ) $(PROXY_OBJ) +all: build/flexnbd build/flexnbd-proxy doc + build/%.o: %.c mkdir -p $(dir $@) $(COMPILE) $< -o $@ @@ -51,7 +56,6 @@ build/flexnbd-proxy: $(COMMON_OBJ) $(PROXY_OBJ) build/proxy-main.o server: build/flexnbd proxy: build/flexnbd-proxy -all: build/flexnbd build/flexnbd-proxy CHECK_SRC := $(wildcard tests/unit/*.c) @@ -87,6 +91,9 @@ proxy-man: build/flexnbd-proxy.1.gz doc: server-man proxy-man +install: + mkdir -p $(INSTALLDIR) + cp build/flexnbd build/flexnbd-proxy $(INSTALLDIR) clean: rm -rf build/* diff --git a/debian/rules b/debian/rules index 2aba466..3e1a3eb 100755 --- a/debian/rules +++ b/debian/rules @@ -7,12 +7,6 @@ %: dh $@ -override_dh_auto_build: - rake build - -override_dh_auto_clean: - rake clean - .PHONY: override_dh_strip override_dh_strip: dh_strip --dbg-package=flexnbd-dbg