help-make
[Top][All Lists]
Advanced

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

RE: include question


From: Dill, John
Subject: RE: include question
Date: Thu, 9 Dec 2004 14:26:11 -0600

>%% "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.

Yep, that's true.  The other option is to include an empty dummy file.  That 
could be incorporated into the include_guard.  I don't think '-' is the correct 
route since I want to still have errors on bad include filenames.

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

Sounds like a good reason to upgrade.  I have been using 3.79.1.  It appears 
there is a mingw version I can use.  At the moment, is 3.79.1 still pretty 
widespread?  I may have to support that make if it is still widely used.

Thanks,
John




reply via email to

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