Ignore:
Timestamp:
Sep 24, 2006, 9:37:41 AM (19 years ago)
Author:
bird
Message:
  • kBuild/footer.kmk:

o Recursive template inheritance.

  • kBuild/header.kmk, kBuild/footer.kmk:

o Removed some checks for features which are present in both gmake 3.81 and kmk.

Anyone trying to bootstrap kBuild will have to build gmake 3.81 first.

  • Config.kmk, src/gmake:

o Allow all kinds of ways of saying Windows in BUILD_TARGET.

  • kBuild/bin/x86.win32/:

o Rebuilt kmk.exe.

  • kBuild/bin/x86.os2/:

o Added kDepPre.exe and kDepIDB.exe.
o Rebuilt kmk.exe and kmk_gmake.exe.

  • src/gmake:

o Update KMK_FEATURES to include the optimizations from earlier this week.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r530 r552  
    117117# @param    bld_trg      build target.
    118118# @param    bld_trg_arch build target architecture.
     119# @remark       Obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
    119120_SOURCE_TOOL = $(strip $(firstword \
    120121        $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
     
    177178#           1. Source files in the output directory are translated into a gen/ subdir.
    178179#               2. Catch anyone specifying $(PATH_SUB_CURRENT)/sourcefile.c.
     180# @remark       obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
    179181_OBJECT_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename \
    180182        $(patsubst $(PATH_ROOT)/%,%,$(patsubst $(PATH_SUB_CURRENT)/%,%,$(patsubst $(PATH_TARGET)/$(2)/%,gen/%,$(1)))))))
     
    234236define def_template_extends_prop
    235237ifndef TEMPLATE_$(template)_$(prop)
    236 ifdef TEMPLATE_$(parent)_$(prop)
     238 ifdef TEMPLATE_$(parent)_$(prop)
    237239TEMPLATE_$(template)_$(prop) = $$(TEMPLATE_$(parent)_$(prop))
    238 endif
    239 endif
    240 endef
     240 endif
     241endif
     242endef
     243
    241244
    242245define def_template_extends
    243246ifdef TEMPLATE_$(template)_EXTENDS
    244 parent := $(strip $(TEMPLATE_$(template)_EXTENDS))
    245 
    246 $(foreach prop, $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED)\
    247 $(addsuffix .$(BUILD_TARGET),                      $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
    248 $(addsuffix .$(BUILD_TARGET).$(BUILD_TARGET_ARCH), $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
    249 $(addsuffix .$(BUILD_TARGET_ARCH),                 $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
    250 $(addsuffix .$(BUILD_TARGET_CPU),                  $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
    251 $(addsuffix .$(BUILD_TYPE),                        $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
    252 ,$(eval $(def_template_extends_prop))) # exploits the 2 evaluation, so no value!
     247 ifndef TEMPLATE_$(template)_EXTENDS_STATUS_
     248  TEMPLATE_$(template)_EXTENDS_STATUS_ := 0
     249  parent := $(strip $(TEMPLATE_$(template)_EXTENDS))
     250
     251  # recursivly process the parent if it's inherting from somebody too.
     252  ifdef TEMPLATE_$(parent)_EXTENDS
     253   ifneq ($(TEMPLATE_$(template)_EXTENDS_STATUS_),42)
     254    # foreach will create 'template' in a new variable context hiding our current variable.
     255    $(foreach template, $(TEMPLATE_$(parent)_EXTENDS), $(eval $(value def_template_extends)))
     256    parent := $(strip $(TEMPLATE_$(template)_EXTENDS))
     257   endif
     258  endif
     259
     260  # inherit properties.
     261  $(foreach prop, $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED)\
     262  $(addsuffix .$(BUILD_TARGET),                      $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     263  $(addsuffix .$(BUILD_TARGET).$(BUILD_TARGET_ARCH), $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     264  $(addsuffix .$(BUILD_TARGET_ARCH),                 $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     265  $(addsuffix .$(BUILD_TARGET_CPU),                  $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     266  $(addsuffix .$(BUILD_TYPE),                        $(PROPS_SINGLE) $(PROPS_ACCUMULATE) $(PROPS_DEFERRED))\
     267  ,$(eval $(def_template_extends_prop))) # exploits the 2 evaluation, so no value!
     268
     269  TEMPLATE_$(template)_EXTENDS_STATUS_ := 42
     270 else
     271  # protect against inheritance loops.
     272  ifneq ($(TEMPLATE_$(template)_EXTENDS_STATUS_),42)
     273   $(error kBuild: inheritance loop! template=$(template))
     274  endif
     275 endif
    253276endif
    254277endef
     
    495518## wrapper the compile command dependency check.
    496519ifndef NO_COMPILE_CMDS_DEPS
    497  ifdef NEW_KMK
     520 ifneq ($(filter comp-vars,$(KMK_FEATURES)),)
    498521_DEP_COMPILE_CMDS = $(comp-vars $(target)_$(source)_CMDS_PREV_,$(target)_$(source)_CMDS_,FORCE)
    499522 else
     
    595618# @param    bld_trg_arch  Build target arch.
    596619# @param    bld_trg_cpu   Build target cpu.
     620# @remark       obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
    597621#
    598622define def_target_source_c_cpp_asm_old
     
    868892        $($(target)_$(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
    869893        $($(target)_$(source)_$(type)FLAGS.$(bld_trg_cpu))
     894# this isn't 100% in sync with kBuild, but it doesn't matter as it's only for gmake now.
    870895objsuff     := $(firstword \
    871896        $($(target)_$(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
     
    966991def_target_source_c_cpp_asm_new = $(kb-src-one x)
    967992
    968 ifdef NEW_KMK
     993ifneq ($(filter kb-src-one,$(KMK_FEATURES)),)
    969994def_target_source_c_cpp_asm_var = def_target_source_c_cpp_asm_new
    970995else
Note: See TracChangeset for help on using the changeset viewer.