All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxin.john@gmail.com
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, "Maxin B. John" <maxin.john@intel.com>
Subject: [PATCH] iw: support and enable separate build dir
Date: Wed,  1 Jun 2016 11:40:16 +0300	[thread overview]
Message-ID: <1464770416-17514-1-git-send-email-maxin.john@gmail.com> (raw)

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

Support separation of SRCDIR and OBJDIR

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
 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


             reply	other threads:[~2016-06-01  8:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  8:40 maxin.john [this message]
2016-06-09  8:25 ` [PATCH] iw: support and enable separate build dir Johannes Berg
2016-06-10 10:58   ` Maxin B. John
2016-06-21  9:41     ` Johannes Berg
2016-06-21 12:08       ` Maxin B. John

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464770416-17514-1-git-send-email-maxin.john@gmail.com \
    --to=maxin.john@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=maxin.john@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.