[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/14] build-sys: introduce install-prog macro to ins
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 09/14] build-sys: introduce install-prog macro to install&strip binaries and use it |
Date: |
Tue, 24 Jun 2014 20:09:15 +0400 |
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 <address@hidden>
---
Makefile | 12 ++----------
Makefile.target | 5 +----
rules.mak | 7 +++++++
3 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index 7d0c8ec..145adb6 100644
--- a/Makefile
+++ b/Makefile
@@ -385,12 +385,8 @@ install-sysconfig: install-datadir install-confdir
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
install-datadir install-localstatedir
- $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
- $(INSTALL_PROG) $(TOOLS) "$(DESTDIR)$(bindir)"
-ifneq ($(STRIP),)
- $(STRIP) $(TOOLS:%="$(DESTDIR)$(bindir)/%")
-endif
+ $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
endif
ifneq ($(CONFIG_MODULES),)
$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
@@ -401,11 +397,7 @@ ifneq ($(CONFIG_MODULES),)
done
endif
ifneq ($(HELPERS-y),)
- $(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
- $(INSTALL_PROG) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
-ifneq ($(STRIP),)
- $(STRIP) $(HELPERS-y:%="$(DESTDIR)$(libexecdir)/%")
-endif
+ $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
endif
ifneq ($(BLOBS),)
set -e; for x in $(BLOBS); do \
diff --git a/Makefile.target b/Makefile.target
index fc5827c..6089d29 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -190,10 +190,7 @@ endif
install: all
ifneq ($(PROGS),)
- $(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
-ifneq ($(STRIP),)
- $(STRIP) $(PROGS:%="$(DESTDIR)$(bindir)/%")
-endif
+ $(call install-prog,$(PROGS),$(DESTDIR)$(bindir))
endif
ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
diff --git a/rules.mak b/rules.mak
index 945484e..ba2f4c1 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
--
1.7.10.4
- [Qemu-devel] [PULL 02/14] Fix new typos (found by codespell), (continued)
- [Qemu-devel] [PULL 02/14] Fix new typos (found by codespell), Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 01/14] virtio-serial: remove useless set_config function, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 07/14] rng-random: NULL check not needed before g_free(), Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 03/14] configure: Enable TPM by default, add --disable-tpm, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 14/14] Add support for the arm breakpoint syscall, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 12/14] target-s390x: Remove unused ld_code6() function, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 08/14] tcg: mark tcg_out* and tcg_patch* with attribute 'unused', Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 13/14] Increase maximum number of session of the internal TFTP server., Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 05/14] vscclient: Add required headers to fix build on FreeBSD, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 10/14] target-unicore: Remove unused functions, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 09/14] build-sys: introduce install-prog macro to install&strip binaries and use it,
Michael Tokarev <=
- [Qemu-devel] [PULL 04/14] target-ppc: Fix compiler warning, Michael Tokarev, 2014/06/24
- [Qemu-devel] [PULL 11/14] hw/moxie/moxiesim.c: Remove unused moxie_intc_create(), Michael Tokarev, 2014/06/24
- Re: [Qemu-devel] [PULL 00/14] Trivial patches for 2014-06-24, Peter Maydell, 2014/06/24