Patchwork Makefile: fix install target with out-of-tree builds

login
register
mail settings
Submitter Mike Frysinger
Date Nov. 19, 2011, 9 p.m.
Message ID <1321736407-8801-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/126619/
State Accepted, archived
Commit 952f4b15bd0bbcd2d7ef1a60e316fab309dcce5a
Headers show

Comments

Mike Frysinger - Nov. 19, 2011, 9 p.m.
The install target always looks for the compiled binaries in the working
directory which breaks when doing something like `make CHOST=... install`.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Artem Bityutskiy - Nov. 22, 2011, 9:32 p.m.
On Sat, 2011-11-19 at 16:00 -0500, Mike Frysinger wrote:
> The install target always looks for the compiled binaries in the working
> directory which breaks when doing something like `make CHOST=... install`.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Pushed both Makefile fixes, thank you!

Artem.

Patch

diff --git a/Makefile b/Makefile
index d0bc3d6..4b71b8f 100644
--- a/Makefile
+++ b/Makefile
@@ -58,9 +58,9 @@  endif
 	rm -f $(BUILDDIR)/include/version.h
 	$(MAKE) -C $(TESTS) clean
 
-install:: ${BINS} ${SCRIPTS}
+install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
 	mkdir -p ${DESTDIR}/${SBINDIR}
-	install -m 0755 ${BINS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
+	install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
 	mkdir -p ${DESTDIR}/${MANDIR}/man1
 	gzip -9c mkfs.jffs2.1 > ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz