help-make
[Top][All Lists]
Advanced

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

RE: include question


From: Paul D. Smith
Subject: RE: include question
Date: Thu, 9 Dec 2004 13:29:36 -0500

%% "Dill, John" <address@hidden> writes:

  dj> That's nice to know, but it seems a little too verbose.  I'd like
  dj> to do something more to the effect of 'include $(call
  dj> guard,defs.mk)' or '$(call include_guard,defs.mk)' where guard
  dj> would do something to check the appropriate tag.

include_guard = $(if $(filter $1,$(.VARIABLES)),,$1)

Unfortunately there's a problem here: I think plain "include" with no
file after it might be considered an error.

If so you'll need to use eval.

You need GNU make 3.80 for this.

  dj> Also, can you implement something like '$(call function,defs.mk)'
  dj> which will return the text of 'include defs.mk' if that test
  dj> passes, and make will perform the include.

No, but you can use eval to do it.  Again you need GNU make 3.80.

  dj> Also, can functions be used reliably to define variables?
  dj> Something like:

  dj> $(call tx_include_name,defs.mk):=1

Sure.

-- 
-------------------------------------------------------------------------------
 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




reply via email to

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