VirtualBox

Changeset 1414 in kBuild


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

Tools and SDKs inheritance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r1413 r1414  
    536536# @param    trg                   Object to consider for inheriting.
    537537# @param    src_prefix            What to prefix the value found in EXTENDS with to get the object.
     538# @param    load_function         Load function for stuff that needs
    538539# @param    properties            List of the properties with straight expansion.
    539540# @param    properties_now_l      List of the properties with immediate expansion, accumulating on the left side.
     
    543544# @param    properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side.
    544545define def_inherit
     546
     547# Load it.
     548ifneq ($(load_function),)
     549 loading := $(trg)
     550 $(eval $(value $(load_function)))
     551endif
     552
    545553src := $(strip $($(trg)_EXTENDS))
    546554ifneq ($(src),)
    547555 ifndef $(trg)_EXTENDS_STATUS_
    548556  $(trg)_EXTENDS_STATUS_ := 0
     557
     558  # Load the source.
     559  ifneq ($(load_function),)
     560   loading := $(src)
     561   $(eval $(value $(load_function)))
     562  endif
     563
     564  # less typing.
    549565  src := $(src_prefix)$(src)
    550566
     
    769785
    770786src_prefix :=
     787load_function :=
    771788properties_deferred_l :=
    772789properties_deferred_r :=
     
    848865
    849866src_prefix := TEMPLATE_
     867load_function :=
    850868properties :=
    851869properties_now_l :=
     
    856874$(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(eval $(value def_inherit)))
    857875
    858 ifdef KBUILD_PROFILE_SELF
    859  _KBUILD_TS_NOW := $(nanots )
    860  $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done template inheritance)
    861  _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
    862 endif
    863 
    864 
    865876# done inheriting.
    866877src_prefix :=
     878load_function :=
    867879properties :=
    868880properties_now_l :=
     
    871883properties_deferred_l :=
    872884properties_deferred_r :=
     885
     886ifdef KBUILD_PROFILE_SELF
     887 _KBUILD_TS_NOW := $(nanots )
     888 $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done template inheritance)
     889 _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
     890endif
     891
     892
    873893
    874894
     
    11501170$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(eval $(value def_tools_sdks_target)))
    11511171
    1152 
    1153 # include TOOLS
    1154 define def_tools_include
    1155 ifndef TOOL_$(tool)
    1156  TOOL_$(tool)_KMK_FILE := $(firstword $(foreach path, $(TOOL_PATHS) $(PATH_KBUILD)/tools, $(wildcard $(path)/$(tool).kmk)))
    1157  ifeq ($(TOOL_$(tool)_KMK_FILE),)
    1158   $(error kBuild: Cannot find include file for the tool '$(tool)'! Searched: $(TOOL_PATHS) $(PATH_KBUILD)/tools)
     1172_TOOLS := $(sort $(_TOOLS))
     1173_SDKS := $(sort $(_SDKS))
     1174
     1175## Tool load function.
     1176# @param loading    The tool name
     1177define def_tools_load_function
     1178ifndef TOOL_$(loading)
     1179 TOOL_$(loading)_KMK_FILE := $(firstword $(foreach path, $(TOOL_PATHS) $(PATH_KBUILD)/tools, $(wildcard $(path)/$(loading).kmk)))
     1180 ifeq ($(TOOL_$(loading)_KMK_FILE),)
     1181  $(error kBuild: Cannot find include file for the tool '$(loading)'! Searched: $(TOOL_PATHS) $(PATH_KBUILD)/tools)
    11591182 endif
    1160  include $(TOOL_$(tool)_KMK_FILE)
    1161  ifndef TOOL_$(tool)
    1162   $(warning kBuild: TOOL_$(tool) was not by $(TOOL_$(tool)_KMK_FILE)!)
     1183 include $(TOOL_$(loading)_KMK_FILE)
     1184 ifndef TOOL_$(loading)
     1185  $(warning kBuild: TOOL_$(loading) was not defined by $(TOOL_$(loading)_KMK_FILE)!)
    11631186 endif
    11641187endif
    11651188endef # def_tools_include
    11661189
    1167 _TOOLS := $(sort $(_TOOLS))
    1168 $(foreach tool, $(_TOOLS), $(eval $(value def_tools_include)))
    1169 
    1170 ## @todo TOOL_X_EXTENDS
    1171 
    1172 
    1173 # include SDKS
    1174 define def_sdks_include_one
    1175 ifndef SDK_$(sdk)
    1176  SDK_$(sdk)_KMK_FILE := $(firstword $(foreach path, $(SDK_PATHS) $(PATH_KBUILD)/sdks, $(wildcard $(path)/$(sdk).kmk)))
    1177  ifeq ($(SDK_$(sdk)_KMK_FILE),)
    1178   $(error kBuild: Cannot find include file for the SDK '$(sdk)'! Searched: $(SDK_PATHS) $(PATH_KBUILD)/sdks)
     1190## SDK load function.
     1191# @param loading    The tool name
     1192define def_sdk_load_function
     1193ifndef SDK_$(loading)
     1194 SDK_$(loading)_KMK_FILE := $(firstword $(foreach path, $(SDK_PATHS) $(PATH_KBUILD)/sdks, $(wildcard $(path)/$(loading).kmk)))
     1195 ifeq ($(SDK_$(loading)_KMK_FILE),)
     1196  $(error kBuild: Cannot find include file for the SDK '$(loading)'! Searched: $(SDK_PATHS) $(PATH_KBUILD)/sdks)
    11791197 endif
    1180  include $(SDK_$(sdk)_KMK_FILE)
    1181  ifndef SDK_$(sdk)
    1182   $(warning kBuild: SDK_$(sdk) was not defined by $(SDK_$(sdk)_KMK_FILE)!)
     1198 include $(SDK_$(loading)_KMK_FILE)
     1199 ifndef SDK_$(loading)
     1200  $(warning kBuild: SDK_$(loading) was not defined by $(SDK_$(loading)_KMK_FILE)!)
    11831201 endif
    11841202endif
    1185 endef # def_sdks_include_one
    1186 
    1187 _SDKS := $(sort $(_SDKS))
    1188 $(foreach sdk, $(_SDKS), $(eval $(value def_sdks_include_one)))
    1189 
    1190 ## @todo Execute SDKS and TOOL inhertiance.
     1203endef # def_sdk_load_function
     1204
     1205
     1206properties :=
     1207properties_now_l :=
     1208properties_now_r :=
     1209properties_deferred   := $(PROPS_SINGLE) $(PROPS_DEFERRED)
     1210properties_deferred_l := $(PROPS_ACCUMULATE_L)
     1211properties_deferred_r := $(PROPS_ACCUMULATE_R)
     1212
     1213src_prefix := TOOL_
     1214load_function := def_tools_load_function
     1215$(foreach trg, $(_TOOLS), $(eval $(value def_inherit)))
     1216
     1217src_prefix := SDK_
     1218load_function := def_sdk_load_function
     1219$(foreach trg, $(_SDKS) , $(eval $(value def_inherit)))
     1220
     1221# done inheriting.
     1222src_prefix :=
     1223load_function :=
     1224properties :=
     1225properties_now_l :=
     1226properties_now_r :=
     1227properties_deferred :=
     1228properties_deferred_l :=
     1229properties_deferred_r :=
     1230
    11911231
    11921232ifdef KBUILD_PROFILE_SELF
     
    11961236endif
    11971237
    1198 ## @todo SDK_X_EXTENDS
     1238
    11991239
    12001240#
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