add make install target
authorBart Trojanowski <bart@jukie.net>
Fri, 20 Mar 2009 00:15:14 +0000 (20:15 -0400)
committerBart Trojanowski <bart@jukie.net>
Sun, 22 Mar 2009 16:14:53 +0000 (12:14 -0400)
Also adds DEST and PREFIX variables used by make install, for example:
    make install DEST=`pwd`/debian/tmp PREFIX=/usr/bin

Makefile

index 994e5e3..d037908 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,12 @@ WARNINGS     = -Wstrict-prototypes -Wsign-compare -Wshadow \
 CFLAGS         += $(WARNINGS)
 LDFLAGS                += -Wl,-warn-common,--as-needed
 
+DEST           ?=
+PREFIX         ?= /usr/local
+
+INSTALL                = install
+INSTALL_BIN    = ${INSTALL} -m 0755 -t ${DEST}${PREFIX}/bin
+INSTALL_MAN    = ${INSTALL} -m 0644 -t ${DEST}${PREFIX}/share/man
 
 ifeq ($(strip $(V)),)
        E = @echo
@@ -111,3 +117,8 @@ release:
        git archive --format=tar --prefix=bti-$(VERSION)/ HEAD | gzip -9v > bti-$(VERSION).tar.gz
 .PHONY: release
 
+install: all
+       $(E) "  INSTALL  " ${DEST}${PREFIX}
+       ${Q} ${INSTALL_BIN} ${PROGRAM}
+       ${Q} ${INSTALL_MAN} ${MAN_PAGES}
+.PHONY: install