From f4b2d3618f8237b6754372ba072b66bb646427b4 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 14 May 2012 16:06:01 +0800 Subject: [PATCH] Makefile: add install target Signed-off-by: Jeremy Kerr --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index fa2e62e..0f44811 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,13 @@ ccan_objs = lib/ccan/libccan.a ccan_includes = -I./lib/ccan libs = -lbfd -lcrypto +# install paths +DESTDIR ?= +prefix ?= /usr +bindir ?= ${prefix}/bin +install_dirs = install -m 755 -d $(DESTDIR)$(bindir) +install_bin = install -m 755 -t $(DESTDIR)$(bindir) + tools = sbsign sbverify all: $(tools) @@ -29,6 +36,11 @@ gen-keyfiles: libs = -luuid $(ccan_objs): cd $(@D) && $(MAKE) +install: $(tools) + $(install_dirs) + $(install_bin) $(tools) +.PHONY: install + clean: rm -f $(tools) rm -f *.o