build: fix install target parent directory prerequisites

Submitted by Grant Erickson on Jan. 5, 2012, 7:07 a.m.

Details

Message ID 1325747260-31656-1-git-send-email-marathon96@gmail.com
State Accepted
Commit b1117643846bdcd104e04512f84ae131e7e60eb5
Headers show

Commit Message

Grant Erickson Jan. 5, 2012, 7:07 a.m.
This changes the install target such that parent directories of
installed paths area created and each path is only installed
on a dependency basis.

Signed-off-by: Grant Erickson <marathon96@gmail.com>
---
 wpa_supplicant/Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Comments

Jouni Malinen Jan. 29, 2012, 12:19 p.m.
On Wed, Jan 04, 2012 at 11:07:40PM -0800, Grant Erickson wrote:
> This changes the install target such that parent directories of
> installed paths area created and each path is only installed
> on a dependency basis.

Thanks, applied.

Patch hide | download patch | download mbox

diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 0832f10..7426aa6 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -48,9 +48,10 @@  mkconfig:
 	echo CONFIG_DRIVER_HOSTAP=y >> .config
 	echo CONFIG_DRIVER_WEXT=y >> .config
 
-install: all
-	mkdir -p $(DESTDIR)$(BINDIR)
-	for i in $(ALL); do cp $$i $(DESTDIR)$(BINDIR)/$$i; done
+$(DESTDIR)$(BINDIR)/%: %
+	install -D $(<) $(@)
+
+install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
 	$(MAKE) -C ../src install
 
 OBJS = config.o