summaryrefslogtreecommitdiffstats
path: root/rules.mak
diff options
context:
space:
mode:
authorMichael Tokarev2014-06-22 08:55:23 +0200
committerMichael Tokarev2014-06-24 18:01:24 +0200
commit0d65942611263a37f79bc0522bf77bedbdf9ed20 (patch)
treef5fb489f3bff8d9e0305e2bc34d1b6333cf79ae5 /rules.mak
parenttcg: mark tcg_out* and tcg_patch* with attribute 'unused' (diff)
downloadqemu-0d65942611263a37f79bc0522bf77bedbdf9ed20.tar.gz
qemu-0d65942611263a37f79bc0522bf77bedbdf9ed20.tar.xz
qemu-0d65942611263a37f79bc0522bf77bedbdf9ed20.zip
build-sys: introduce install-prog macro to install&strip binaries and use it
Use common rule (macro) to install and strip binaries, and use it in all places where we install binaries, instead of fixing bugs like 1319493 in every place. (This fixes https://bugs.launchpad.net/bugs/1319493) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'rules.mak')
-rw-r--r--rules.mak7
1 files changed, 7 insertions, 0 deletions
diff --git a/rules.mak b/rules.mak
index 945484ecb4..ba2f4c19a5 100644
--- a/rules.mak
+++ b/rules.mak
@@ -101,6 +101,13 @@ cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc
set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
+# install-prog list, dir
+define install-prog
+ $(INSTALL_DIR) "$2"
+ $(INSTALL_PROG) $1 "$2"
+ $(if $(STRIP),$(STRIP) $(foreach T,$1,"$2/$(notdir $T)"),)
+endef
+
# find-in-path
# Usage: $(call find-in-path, prog)
# Looks in the PATH if the argument contains no slash, else only considers one