aboutsummaryrefslogtreecommitdiff
path: root/mk/programs.mk
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-25 11:39:21 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-25 11:39:21 +0000
commit1a1d8b073a1d770c8de4f8eb274387b209b32782 (patch)
tree20fe7cf49a96cd6205897c2a1cd77e616ad937b7 /mk/programs.mk
parent784feb68392ec4a0bdd45bf0d37f08c3eb1b61ac (diff)
Add a Makefile for bsdiff
Diffstat (limited to 'mk/programs.mk')
-rw-r--r--mk/programs.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/mk/programs.mk b/mk/programs.mk
index e26e9af7a..48f95c60c 100644
--- a/mk/programs.mk
+++ b/mk/programs.mk
@@ -13,7 +13,8 @@ programs_list :=
#
# - $(1)_LDFLAGS: additional linker flags.
#
-# - bindir: the directory where the program will be installed.
+# - $(1)_INSTALL_DIR: the directory where the program will be
+# installed; defaults to $(bindir).
define build-program =
_d := $$($(1)_DIR)
_srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)/$$(src))
@@ -24,7 +25,7 @@ define build-program =
$$($(1)_PATH): $$($(1)_OBJS) $$(_libs)
$(QUIET) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
- $(1)_INSTALL_DIR := $$(bindir)
+ $(1)_INSTALL_DIR ?= $$(bindir)
$(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$(1)
$$(eval $$(call create-dir,$$($(1)_INSTALL_DIR)))