VirtualBox

Changeset 1417 in kBuild


Ignore:
Timestamp:
Mar 18, 2008 10:48:52 PM (17 years ago)
Author:
bird
Message:

Template load function for def_inherit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r1416 r1417  
    624624_TEMPLATES := $(sort $(_TEMPLATES))
    625625
    626 define def_templates_include
    627 ifndef TEMPLATE_$(template)
    628  TEMPLATE_$(template)_INCLUDE_FILE_ := $(firstword $(foreach path, $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(template).kmk)))
    629  ifneq ($(TEMPLATE_$(template)_INCLUDE_FILE_),)
    630   include $(TEMPLATE_$(template)_INCLUDE_FILE_)
    631  else
    632   $$(error kBuild: Cannot find template '$(template)')
     626## Template load function.
     627# @param loading    The template name. This is prefixed.
     628define def_templates_load_function
     629loading := $(patsubst TEMPLATE_%,%,$(loading))
     630ifndef TEMPLATE_$(loading)
     631 TEMPLATE_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))
     632 ifneq ($(TEMPLATE_$(loading)_KMK_FILE),)
     633  $(error kBuild: Cannot find include file for the template '$(loading)'! Searched: $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS))
    633634 endif
     635 include $(TEMPLATE_$(loading)_KMK_FILE)
     636 ifndef TEMPLATE_$(loading)
     637  $(warning kBuild: TEMPLATE_$(loading) was not defined by $(TEMPLATE_$(loading)_KMK_FILE)!)
     638 endif
    634639endif
    635640endef # def_templates_include
    636 $(foreach template, $(_TEMPLATES), $(eval $(def_templates_include)))
    637 
    638 #$ (warning dbg _TEMPLATES := $(_TEMPLATES))
     641$(foreach loading, $(addprefix TEMPLATE_,$(_TEMPLATES)), $(eval $(value def_templates_include)))
    639642
    640643
     
    866869
    867870src_prefix := TEMPLATE_
    868 load_function :=
     871load_function := def_templates_load_function
    869872properties :=
    870873properties_now_l :=
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette