Changeset 412


Ignore:
Timestamp:
Jan 18, 2006, 2:31:43 PM (20 years ago)
Author:
bird
Message:

Template inheritance (_EXTENDS).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r388 r412  
    185185
    186186#
     187# Template Inheritance.
     188#
     189define def_template_extends_prop
     190ifndef TEMPLATE_$(template)_$(prop)
     191ifdef TEMPLATE_$(parent)_$(prop)
     192TEMPLATE_$(template)_$(prop) = $$(TEMPLATE_$(parent)_$(prop))
     193endif
     194endif
     195endef
     196
     197define def_template_extends
     198ifdef TEMPLATE_$(template)_EXTENDS
     199parent := $(strip $(TEMPLATE_$(template)_EXTENDS))
     200
     201$(foreach prop, $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED)\
     202$(addsuffix .$(BUILD_TARGET), $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     203$(addsuffix .$(BUILD_TYPE), $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     204,$(eval $(def_template_extends_prop))) # exploits the 2 evaluation, so no value!
     205endif
     206endef
     207
     208# $ (foreach template, $(_TEMPLATES), $(if TEMPLATE_$(template)_EXTENDS, $(eval $(value def_template_extends))))
     209$(foreach template, $(_TEMPLATES), $(eval $(value def_template_extends)))
     210
     211
     212#
    187213# Common Inheritance
    188214#
     
    395421        $(RM) -f $(dep) $(out) $($(target)_$(source)_OUTPUT_)
    396422        $(custom_pre)
    397                
     423
    398424$($(target)_$(source)_CMDS_)
    399425
     
    404430        @$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_$(source)_CMDS_))'
    405431        @$(APPEND) "$(dep)" 'endef'
    406 endif   
     432endif
    407433
    408434$(basename $(notdir $(obj))).o::
     
    439465        $(RM) -f $(dep) $($(target)_OUTPUT_)
    440466        $(custom_pre)
    441                
     467
    442468$($(target)_CMDS_)
    443469
     
    447473        @$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_CMDS_))'
    448474        @$(APPEND) "$(dep)" 'endef'
    449 endif   
     475endif
    450476
    451477$(basename $(notdir $(out)))::
     
    916942$(target)_DEPORD_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPORD) $(dirdep)
    917943
    918 # generate the link rule.               
     944# generate the link rule.
    919945$(eval $(def_link_rule))
    920946
     
    11281154$(target)_DEPORD_ := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep)
    11291155
    1130 # generate the link rule.               
     1156# generate the link rule.
    11311157$(eval $(def_link_rule))
    11321158
    1133                
     1159
    11341160# Update globals.
    11351161_OBJS        += $($(target)_OBJS_)
     
    13491375endef
    13501376
    1351                
     1377
    13521378## generate the install rule
    13531379define def_install_directory_rule
     
    13591385                $(if $(mode),-m $(mode))\
    13601386                $(insdst)
    1361                
    1362 .NOTPARALLEL: $(insdst) 
    1363 endef
    1364                
     1387
     1388.NOTPARALLEL: $(insdst)
     1389endef
     1390
    13651391
    13661392## create one directory
     
    16141640        + $(MAKE) -f $(firstword $(MAKEFILE_LIST)) all_recursive
    16151641
    1616 # @todo make this a non-default pass!           
     1642# @todo make this a non-default pass!
    16171643uninstall:
    16181644        $(RM) -f $(_INSTALLS)
    1619        
     1645
    16201646install: pass_installs
    16211647
Note: See TracChangeset for help on using the changeset viewer.