Makefile: add install target
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
40bc6428d1
commit
f4b2d3618f
1 changed files with 12 additions and 0 deletions
12
Makefile
12
Makefile
|
@ -12,6 +12,13 @@ ccan_objs = lib/ccan/libccan.a
|
||||||
ccan_includes = -I./lib/ccan
|
ccan_includes = -I./lib/ccan
|
||||||
libs = -lbfd -lcrypto
|
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
|
tools = sbsign sbverify
|
||||||
|
|
||||||
all: $(tools)
|
all: $(tools)
|
||||||
|
@ -29,6 +36,11 @@ gen-keyfiles: libs = -luuid
|
||||||
$(ccan_objs):
|
$(ccan_objs):
|
||||||
cd $(@D) && $(MAKE)
|
cd $(@D) && $(MAKE)
|
||||||
|
|
||||||
|
install: $(tools)
|
||||||
|
$(install_dirs)
|
||||||
|
$(install_bin) $(tools)
|
||||||
|
.PHONY: install
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(tools)
|
rm -f $(tools)
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
|
Loading…
Reference in a new issue