On Fri, Jun 04, 2010 at 10:34:17PM +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 ifdef and wildcard checks. > > (Might safe some CPU-cycles as well) > > Signed-off-by: Remy Bohmer <[email protected]> > --- > rules/other/Toplevel.make | 19 ++++++------------- > 1 files changed, 6 insertions(+), 13 deletions(-) > > diff --git a/rules/other/Toplevel.make b/rules/other/Toplevel.make > index d270e71..51f671e 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)
ok > # 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),) > -include $(wildcard $(PROJECTPRERULESDIR)/*.make) > -endif > +# might be non existent > +-include $(wildcard $(PROJECTPRERULESDIR)/*.make) We can drop the "-" as well. wildcard will return nothing if no file matches and "include " is ok. At least for the make version I have. > 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),) > -include $(wildcard $(POSTRULESDIR)/*.make) > -endif > - > -ifneq ($(wildcard $(PROJECTPOSTRULESDIR)/*.make),) > -include $(wildcard $(PROJECTPOSTRULESDIR)/*.make) > -endif > +# might be non existent > +-include $(wildcard $(POSTRULESDIR)/*.make) > +-include $(wildcard $(PROJECTPOSTRULESDIR)/*.make) Dito. mol -- 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 [email protected]
