linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iw: support and enable separate build dir
@ 2016-06-01  8:40 maxin.john
  2016-06-09  8:25 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: maxin.john @ 2016-06-01  8:40 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Maxin B. John

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] iw: support and enable separate build dir
  2016-06-01  8:40 [PATCH] iw: support and enable separate build dir maxin.john
@ 2016-06-09  8:25 ` Johannes Berg
  2016-06-10 10:58   ` Maxin B. John
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2016-06-09  8:25 UTC (permalink / raw)
  To: maxin.john; +Cc: linux-wireless, Maxin B. John

On Wed, 2016-06-01 at 11:40 +0300, maxin.john@gmail.com wrote:
> From: "Maxin B. John" <maxin.john@intel.com>
> 
> Support separation of SRCDIR and OBJDIR
> 
Doesn't seem to work:

$ mkdir /tmp/obj
$ make clean
$ make OBJDIR=/tmp/obj
[...]
 GEN  version.c
 CC   version.o
cc: error: version.c: No such file or directory
cc: fatal error: no input files
compilation terminated.
Makefile:104: recipe for target 'version.o' failed
make: *** [version.o] Error 1
$ ls *.o
event.o  genl.o  ibss.o  info.o  interface.o  iw.o  mesh.o  mpath.o
mpp.o  ocb.o  phy.o  reg.o  scan.o  station.o  survey.o  util.o

(object files are in the wrong place too)

johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iw: support and enable separate build dir
  2016-06-09  8:25 ` Johannes Berg
@ 2016-06-10 10:58   ` Maxin B. John
  2016-06-21  9:41     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Maxin B. John @ 2016-06-10 10:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Maxin B. John

Hi Johannes,

On Thu, Jun 9, 2016 at 11:25 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Wed, 2016-06-01 at 11:40 +0300, maxin.john@gmail.com wrote:
>> From: "Maxin B. John" <maxin.john@intel.com>
>>
>> Support separation of SRCDIR and OBJDIR
>>
> Doesn't seem to work:
>
> $ mkdir /tmp/obj
> $ make clean
> $ make OBJDIR=/tmp/obj
> [...]
>  GEN  version.c
>  CC   version.o
> cc: error: version.c: No such file or directory
> cc: fatal error: no input files
> compilation terminated.
> Makefile:104: recipe for target 'version.o' failed
> make: *** [version.o] Error 1
> $ ls *.o
> event.o  genl.o  ibss.o  info.o  interface.o  iw.o  mesh.o  mpath.o
> mpp.o  ocb.o  phy.o  reg.o  scan.o  station.o  survey.o  util.o
>
> (object files are in the wrong place too)

I was following the below listed steps to verify this patch:

# mkdir build
# cd build
#  make -f <path>/iw/Makefile
# ls *.o
bitrate.o  coalesce.o  connect.o  cqm.o  event.o  genl.o  ibss.o  info.o
interface.o  iw  iw.o  link.o  mesh.o  mpath.o  mpp.o  ocb.o  offch.o  p2p.o
phy.o  ps.o  reason.o  reg.o  roc.o  scan.o  sections.o  station.o  status.o
survey.o  util.o  vendor.o  version.c  version.o  wowlan.o

> johannes

Best Regards,
Maxin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iw: support and enable separate build dir
  2016-06-10 10:58   ` Maxin B. John
@ 2016-06-21  9:41     ` Johannes Berg
  2016-06-21 12:08       ` Maxin B. John
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2016-06-21  9:41 UTC (permalink / raw)
  To: Maxin B. John; +Cc: linux-wireless, Maxin B. John

On Fri, 2016-06-10 at 13:58 +0300, Maxin B. John wrote:
> Hi Johannes,
> 
> On Thu, Jun 9, 2016 at 11:25 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Wed, 2016-06-01 at 11:40 +0300, maxin.john@gmail.com wrote:
> > > From: "Maxin B. John" <maxin.john@intel.com>
> > > 
> > > Support separation of SRCDIR and OBJDIR
> > > 
> > Doesn't seem to work:
> > 
> > $ mkdir /tmp/obj
> > $ make clean
> > $ make OBJDIR=/tmp/obj
> > [...]
> >  GEN  version.c
> >  CC   version.o
> > cc: error: version.c: No such file or directory
> > cc: fatal error: no input files
> > compilation terminated.
> > Makefile:104: recipe for target 'version.o' failed
> > make: *** [version.o] Error 1
> > $ ls *.o
> > event.o  genl.o  ibss.o  info.o  interface.o  iw.o  mesh.o  mpath.o
> > mpp.o  ocb.o  phy.o  reg.o  scan.o  station.o  survey.o  util.o
> > 
> > (object files are in the wrong place too)
> 
> I was following the below listed steps to verify this patch:
> 
> # mkdir build
> # cd build
> #  make -f <path>/iw/Makefile
> 

Oh. Any chance you could make both work, since the "make O=..." is
something kernel people are used to/familiar with?

johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iw: support and enable separate build dir
  2016-06-21  9:41     ` Johannes Berg
@ 2016-06-21 12:08       ` Maxin B. John
  0 siblings, 0 replies; 5+ messages in thread
From: Maxin B. John @ 2016-06-21 12:08 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Maxin B. John

Hi,

On Tue, Jun 21, 2016 at 12:41 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Fri, 2016-06-10 at 13:58 +0300, Maxin B. John wrote:
>> Hi Johannes,
>>
>> On Thu, Jun 9, 2016 at 11:25 AM, Johannes Berg
>> <johannes@sipsolutions.net> wrote:
>> > On Wed, 2016-06-01 at 11:40 +0300, maxin.john@gmail.com wrote:
>> > > From: "Maxin B. John" <maxin.john@intel.com>
>> > >
>> > > Support separation of SRCDIR and OBJDIR
>> > >
>> > Doesn't seem to work:
>> >
>> > $ mkdir /tmp/obj
>> > $ make clean
>> > $ make OBJDIR=/tmp/obj
>> > [...]
>> >  GEN  version.c
>> >  CC   version.o
>> > cc: error: version.c: No such file or directory
>> > cc: fatal error: no input files
>> > compilation terminated.
>> > Makefile:104: recipe for target 'version.o' failed
>> > make: *** [version.o] Error 1
>> > $ ls *.o
>> > event.o  genl.o  ibss.o  info.o  interface.o  iw.o  mesh.o  mpath.o
>> > mpp.o  ocb.o  phy.o  reg.o  scan.o  station.o  survey.o  util.o
>> >
>> > (object files are in the wrong place too)
>>
>> I was following the below listed steps to verify this patch:
>>
>> # mkdir build
>> # cd build
>> #  make -f <path>/iw/Makefile
>>
>
> Oh. Any chance you could make both work, since the "make O=..." is
> something kernel people are used to/familiar with?

I will look into that. Thanks for the suggestion !

> johannes

Best Regards,
Maxin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-21 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01  8:40 [PATCH] iw: support and enable separate build dir maxin.john
2016-06-09  8:25 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).