blob: 0ea6a52789910fd07a8a9d8650e54e9fddf3fe43 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Subject: [PATCH] Support separation of SRCDIR and OBJDIR
2
3Typical use of VPATH to locate the sources.
4
5Upstream-Status: Pending
6
7Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05008Signed-off-by: Maxin B. John <maxin.john@intel.com>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009---
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050010diff -Naur iw-4.3-origin/Makefile iw-4.3/Makefile
11--- iw-4.3-origin/Makefile 2015-11-20 16:37:58.752077287 +0200
12+++ iw-4.3/Makefile 2015-11-20 16:57:15.510615815 +0200
13@@ -1,5 +1,7 @@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014 MAKEFLAGS += --no-print-directory
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015-
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016+SRCDIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
17+OBJDIR ?= $(PWD)
18+VPATH = $(SRCDIR)
19 PREFIX ?= /usr
20 SBINDIR ?= $(PREFIX)/sbin
21 MANDIR ?= $(PREFIX)/share/man
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022@@ -95,11 +97,11 @@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) nl80211.h iw.h Makefile \
24 $(wildcard .git/index .git/refs/tags)
25 @$(NQ) ' GEN ' $@
26- $(Q)./version.sh $@
27+ $(Q)cd $(SRCDIR) && ./version.sh $(OBJDIR)/$@
28
29 %.o: %.c iw.h nl80211.h
30 @$(NQ) ' CC ' $@
31- $(Q)$(CC) $(CFLAGS) -c -o $@ $<
32+ $(Q)$(CC) -I$(SRCDIR) $(CFLAGS) -c -o $@ $<
33
34 ifeq ($(IW_ANDROID_BUILD),)
35 iw: $(OBJS)