mirror of
https://git.yoctoproject.org/poky
synced 2026-06-17 06:19:56 +00:00
d461e6b4df
(From OE-Core rev: 9b436d3c5625f1525a1c9e94886ff9f373ec7cf1) Signed-off-by: Changhyeok Bae <changhyeok.bae@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
51 lines
1.3 KiB
Diff
51 lines
1.3 KiB
Diff
From ff9f0a631c99fb6e2677c02bf572a5e69c70f5cf Mon Sep 17 00:00:00 2001
|
|
From: Changhyeok Bae <changhyeok.bae@gmail.com>
|
|
Date: Mon, 27 Jan 2020 22:48:03 +0100
|
|
Subject: [PATCH] Support separation of SRCDIR and OBJDIR
|
|
|
|
Typical use of VPATH to locate the sources.
|
|
|
|
Upstream-Status: Pending
|
|
|
|
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
|
|
Signed-off-by: Maxin B. John <maxin.john@intel.com>
|
|
---
|
|
Makefile | 8 ++++++--
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/Makefile b/Makefile
|
|
index 90f2251..714cdb9 100644
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -1,5 +1,9 @@
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
+SRCDIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
|
|
+OBJDIR ?= $(PWD)
|
|
+VPATH = $(SRCDIR)
|
|
+
|
|
PREFIX ?= /usr
|
|
SBINDIR ?= $(PREFIX)/sbin
|
|
MANDIR ?= $(PREFIX)/share/man
|
|
@@ -92,7 +96,7 @@ all: $(ALL)
|
|
version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) nl80211.h iw.h Makefile \
|
|
$(wildcard .git/index .git/refs/tags)
|
|
@$(NQ) ' GEN ' $@
|
|
- $(Q)./version.sh $@
|
|
+ $(Q)cd $(SRCDIR) && ./version.sh $(OBJDIR)/$@
|
|
|
|
nl80211-commands.inc: nl80211.h
|
|
@$(NQ) ' GEN ' $@
|
|
@@ -100,7 +104,7 @@ nl80211-commands.inc: nl80211.h
|
|
|
|
%.o: %.c iw.h nl80211.h nl80211-commands.inc
|
|
@$(NQ) ' CC ' $@
|
|
- $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
+ $(Q)$(CC) -I$(SRCDIR) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
ifeq ($(IW_ANDROID_BUILD),)
|
|
iw: $(OBJS)
|
|
--
|
|
2.23.0
|
|
|