Search Linux Wireless

[PATCH] iw: support and enable separate build dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Maxin B. John" <maxin.john@xxxxxxxxx>

Support separation of SRCDIR and OBJDIR

Signed-off-by: Christopher Larson <chris_larson@xxxxxxxxxx>
Signed-off-by: Maxin B. John <maxin.john@xxxxxxxxx>
---
 Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index e61825e..1bc27c1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
 MAKEFLAGS += --no-print-directory
-
+SRCDIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
+OBJDIR ?= $(PWD)
+VPATH = $(SRCDIR)
 PREFIX ?= /usr
 SBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
@@ -96,11 +98,11 @@ VERSION_OBJS := $(filter-out version.o, $(OBJS))
 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)/$@
 
 %.o: %.c iw.h nl80211.h
 	@$(NQ) ' CC  ' $@
-	$(Q)$(CC) $(CFLAGS) -c -o $@ $<
+	$(Q)$(CC) -I$(SRCDIR) $(CFLAGS) -c -o $@ $<
 
 ifeq ($(IW_ANDROID_BUILD),)
 iw:	$(OBJS)
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux