Ignore:
Timestamp:
Jun 5, 2006, 6:22:01 PM (19 years ago)
Author:
bird
Message:

corrected bldprogs to inherit .$(BUILD_PLATFORM) instead of .$(BUILD_TARGET) from the template. Also fixed incorrect inheritance of the default template/tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r445 r447  
    4343        $(INSTALLS)    $(INSTALLS.$(BUILD_TARGET)) \
    4444        $(OTHERS)      $(OTHERS.$(BUILD_TARGET))
     45
     46# all $(BUILD_TARGET) targets.
     47_ALL_BUILD_TARGET_TARGETS += \
     48        $(BLDPROGS)    $(BLDPROGS.$(BUILD_PLATFORM)) \
     49        $(LIBRARIES)   $(LIBRARIES.$(BUILD_TARGET)) \
     50        $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) \
     51        $(DLLS)        $(DLLS.$(BUILD_TARGET)) \
     52        $(PROGRAMS)    $(PROGRAMS.$(BUILD_TARGET)) \
     53        $(SYSMODS)     $(SYSMODS.$(BUILD_TARGET)) \
     54        $(INSTALLS)    $(INSTALLS.$(BUILD_TARGET)) \
     55        $(OTHERS)      $(OTHERS.$(BUILD_TARGET))
     56
     57# all $(BUILD_TARGET) targets.
     58_ALL_BUILD_PLATFORM_TARGETS += \
     59        $(BLDPROGS)    $(BLDPROGS.$(BUILD_PLATFORM))
    4560
    4661# dependency files.
     
    218233# @param    $(prop)     Property name
    219234# @param    $(target)   Target name.
     235# @param    $(bld_trg)  Build target name.
    220236define def_inherit_defaults_one
    221237ifndef $(target)_$(prop)
    222 ifndef $(target)_$(prop).$(BUILD_TARGET)
     238ifndef $(target)_$(prop).$(bld_trg)
    223239ifdef $(prop)
    224240$$(eval $(target)_$(prop) := $($(prop)))
    225 endif
    226 ifdef $(prop).$(BUILD_TARGET)
    227 $$(eval $(target)_$(prop).$(BUILD_TARGET) := $($(prop).$(BUILD_TARGET)))
     241#$ (warning dbg idefone: $(target)_$(prop):=$($(prop)))
     242endif
     243ifdef $(prop).$(bld_trg)
     244$$(eval $(target)_$(prop).$(bld_trg) := $($(prop).$(bld_trg)))
     245#$ (warning dbg idefone: $(target)_$(prop).$(bld_trg) := $($(prop).$(bld_trg)))
    228246endif
    229247endif
     
    235253# is inherited from the default properties.
    236254# @param    $(target)   Target name
     255# @param    $(bld_trg)  Build target name.
    237256#
    238257define def_inherit_defaults
    239258ifdef $(target)_TEMPLATE
    240 ifeq ($(strip $(TEMPLATE_$($(target)_TEMPLATE)_TOOL) $(TEMPLATE_$($(target)_TEMPLATE)_TOOL.$(BUILD_TARGET))),)
     259ifeq ($(strip $(TEMPLATE_$($(target)_TEMPLATE)_TOOL) $(TEMPLATE_$($(target)_TEMPLATE)_TOOL.$(bld_trg))),)
    241260$$(foreach prop,TOOL, $$(eval $$(def_inherit_defaults_one)))
    242261endif
    243 ifeq ($(strip $(TEMPLATE_$($(target)_TEMPLATE)_SDKS) $(TEMPLATE_$($(target)_TEMPLATE)_SDKS.$(BUILD_TARGET))),)
     262ifeq ($(strip $(TEMPLATE_$($(target)_TEMPLATE)_SDKS) $(TEMPLATE_$($(target)_TEMPLATE)_SDKS.$(bld_trg))),)
    244263$$(foreach prop,SDKS, $$(eval $$(def_inherit_defaults_one)))
    245264endif
     
    250269# Inherit default properties.
    251270# !!!!!!THIS IS MESSY AND NOT NECESSARY!!!!!!
    252 $(foreach target, $(ALL_TARGETS),$(eval $(def_inherit_defaults)))
     271#bld_trg := $(BUILD_TARGET)
     272#$(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(eval $(def_inherit_defaults)))
     273#bld_trg := $(BUILD_PLATFORM)
     274#$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(eval $(def_inherit_defaults)))
    253275
    254276
     
    264286endif
    265287endif
    266 ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)
    267 ifndef $(target)_$(prop).$(BUILD_TARGET)
    268 #$ (warning dbgsource: $(target)_$(prop).$(BUILD_TARGET)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
    269 $(target)_$(prop).$(BUILD_TARGET) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
     288ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
     289ifndef $(target)_$(prop).$(bld_trg)
     290#$ (warning dbgsource: $(target)_$(prop).$(bld_trg)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
     291$(target)_$(prop).$(bld_trg) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
    270292endif
    271293endif
     
    284306endif
    285307endif
    286 ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)
    287 ifndef $(target)_$(prop).$(BUILD_TARGET)
    288 #$ (warning dbgsource: $(target)_$(prop).$(BUILD_TARGET)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
    289 $(target)_$(prop).$(BUILD_TARGET) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
     308ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
     309ifndef $(target)_$(prop).$(bld_trg)
     310#$ (warning dbgsource: $(target)_$(prop).$(bld_trg)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
     311$(target)_$(prop).$(bld_trg) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
    290312endif
    291313endif
     
    305327$(target)_$(prop).$(BUILD_TYPE) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE))
    306328endif
    307 ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)
    308 #$ (warning dbg4: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
    309 $(target)_$(prop).$(BUILD_TARGET) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
    310 endif
    311 ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET_CPU)
    312 #$ (warning dbg5: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET_CPU))
    313 $(target)_$(prop).$(BUILD_TARGET_CPU) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET_CPU))
    314 endif
    315 ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET_ARCH)
    316 #$ (warning dbg6: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET_ARCH))
    317 $(target)_$(prop).$(BUILD_TARGET_ARCH) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET_ARCH))
     329ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
     330#$ (warning dbg4: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
     331$(target)_$(prop).$(bld_trg) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
     332endif
     333ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)
     334#$ (warning dbg5: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
     335$(target)_$(prop).$(bld_trg_cpu) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
     336endif
     337ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)
     338#$ (warning dbg6: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
     339$(target)_$(prop).$(bld_trg_arch) += $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
    318340endif
    319341endef
     
    322344# @param    $(target)    Target name.
    323345define def_inherit_template
     346# Inherit any default template.
     347ifdef TEMPLATE
     348ifeq ($($(target)_TEMPLATE),)
     349$(eval $(target)_TEMPLATE:=$(TEMPLATE))
     350endif
     351endif
     352# Expand the template if specified.
     353ifneq ($($(target)_TEMPLATE),)
    324354$(foreach prop,$(PROPS_SINGLE),$(eval $(value def_inherit_template_one)))
    325355$(foreach prop,$(PROPS_DEFERRED),$(eval $(def_inherit_template_one_deferred))) # exploits the 2 evaluation, so no value!
    326356$(foreach prop,$(PROPS_ACCUMULATE),$(eval $(def_inherit_template_one_accumulate))) # += works fine (better) without value.
     357endif
    327358endef
    328359
    329360# Inherit template properties
    330 $(foreach target, $(ALL_TARGETS),$(eval $(value def_inherit_template)))
     361bld_trg := $(BUILD_TARGET)
     362bld_trg_arch := $(BUILD_TARGET_ARCH)
     363bld_trg_cpu := $(BUILD_TARGET_CPU)
     364$(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(eval $(value def_inherit_template)))
     365
     366bld_trg := $(BUILD_PLATFORM)
     367bld_trg_arch := $(BUILD_PLATFORM_ARCH)
     368bld_trg_cpu := $(BUILD_PLATFORM_CPU)
     369$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(eval $(value def_inherit_template)))
    331370
    332371
Note: See TracChangeset for help on using the changeset viewer.