help-make
[Top][All Lists]
Advanced

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

RE: Macros and include?


From: timothy . llewellynn
Subject: RE: Macros and include?
Date: Wed, 23 Apr 2003 17:50:38 +0200

Hi Paul,

I managed to overcome the problem by letting make generate my module.mk
files. This way a include directive will call the rule to build each
module.mk which replaces the MODDIR variable with the path of where the
module.mk lives. Although the solution has its drawbacks, it does require
less work for maintaining large directory structures, especially if they
change.

Thanks for the help.

include $(OBJDIR)/submod1/module.mk
include $(OBJDIR)/submod2/module.mk

$(OBJDIR)/%.mk: $(SRCDIR)/%.mk
        #rule that replaces $(MODDIR)/ in module.mk with $(dir $*)

-----Original Message-----
From: Paul D. Smith [mailto:address@hidden 
Sent: mercredi, 23. avril 2003 16:09
To: address@hidden
Cc: address@hidden
Subject: RE: Macros and include?


%% address@hidden writes:

  tl> Yes I've looked at the eval function and it will probably work,
  tl> thou upgrading to 3.80 is sadly not an option, we are using 3.79.

Then you're out of luck... you'll have to write it all out by hand. There's
no other choice with GNU make 3.79.

  tl> It would be nice if when a file was included using the include
  tl> directive, make would let that file know where it was included
  tl> from, this way I wouldn't have to manually keep track of the
  tl> directory hirechery. Just an idea.

There are lots of things that would be nice :), but in fact this is doable
already, without a huge amount of pain, with the functionality currently
available in the latest version of GNU make, and I don't want to add tons of
"special purpose" features simply as syntactic sugar for things that are
already possible--more things to test, more things to break.

After all, even if I did agree to add this feature to GNU make going
forward, you still couldn't do it in GNU make 3.79 :).

-- 
----------------------------------------------------------------------------
---
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad
Scientist

Attachment: InterScan_Disclaimer.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]