On Sat, Jun 05, 2010 at 10:33:47AM +0200, Remy Bohmer wrote:
> To check for the existence of certain files and include them if these
> exist can be done by just simply prepending the include directive with
> a '-'  sign, without if and wildcard checks.

I looked at the Make dokumentation to see what exactly include accepts.
It looks like we have 2 options:

include $(wildcard $(PROJECTPRERULESDIR)/*.make)
-include $(PROJECTPRERULESDIR)/*.make

both work. I'm not so sure which is nicer. Unless Marc objects I'll commit
this after the release. It provides no new feature that would be useful
and I'm not sure if there are any side effects.

mol

> Signed-off-by: Remy Bohmer <li...@bohmer.net>
> ---
>  rules/other/Toplevel.make |   13 +++----------
>  1 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/rules/other/Toplevel.make b/rules/other/Toplevel.make
> index d270e71..1218229 100644
> --- a/rules/other/Toplevel.make
> +++ b/rules/other/Toplevel.make
> @@ -22,9 +22,7 @@ include $(RULESDIR)/other/Definitions.make
>  include $(PTXDIST_PTXCONFIG)
>  
>  # might be non existent
> -ifneq ($(wildcard $(PTXDIST_PLATFORMCONFIG)),)
> -include $(PTXDIST_PLATFORMCONFIG)
> -endif
> +-include $(PTXDIST_PLATFORMCONFIG)
>  
>  # might be non existent
>  ifneq ($(wildcard $(PTXDIST_COLLECTIONCONFIG)),)
> @@ -41,9 +39,8 @@ include $(PTX_MAP_ALL_MAKE)
>  include $(RULESDIR)/other/Namespace.make
>  include $(wildcard $(PRERULESDIR)/*.make)
>  
> -ifneq ($(wildcard $(PROJECTPRERULESDIR)/*.make),)
> +# might be non existent
>  include $(wildcard $(PROJECTPRERULESDIR)/*.make)
> -endif
>  
>  include $(PTX_DGEN_DEPS_PRE)
>  include $(PTX_DGEN_RULESFILES_MAKE)
> @@ -86,13 +83,9 @@ PTX_PACKAGES_SELECTED      := \
>       $(CROSS_PACKAGES) \
>       $(HOST_PACKAGES)
>  
> -ifneq ($(wildcard $(POSTRULESDIR)/*.make),)
> +# might be non existent
>  include $(wildcard $(POSTRULESDIR)/*.make)
> -endif
> -
> -ifneq ($(wildcard $(PROJECTPOSTRULESDIR)/*.make),)
>  include $(wildcard $(PROJECTPOSTRULESDIR)/*.make)
> -endif
>  
>  # 
> ----------------------------------------------------------------------------
>  # just the "print" target
> -- 
> 1.7.0.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to