Changeset 1414 in kBuild
- Timestamp:
- Mar 18, 2008 9:51:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r1413 r1414 536 536 # @param trg Object to consider for inheriting. 537 537 # @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 538 539 # @param properties List of the properties with straight expansion. 539 540 # @param properties_now_l List of the properties with immediate expansion, accumulating on the left side. … … 543 544 # @param properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side. 544 545 define def_inherit 546 547 # Load it. 548 ifneq ($(load_function),) 549 loading := $(trg) 550 $(eval $(value $(load_function))) 551 endif 552 545 553 src := $(strip $($(trg)_EXTENDS)) 546 554 ifneq ($(src),) 547 555 ifndef $(trg)_EXTENDS_STATUS_ 548 556 $(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. 549 565 src := $(src_prefix)$(src) 550 566 … … 769 785 770 786 src_prefix := 787 load_function := 771 788 properties_deferred_l := 772 789 properties_deferred_r := … … 848 865 849 866 src_prefix := TEMPLATE_ 867 load_function := 850 868 properties := 851 869 properties_now_l := … … 856 874 $(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(eval $(value def_inherit))) 857 875 858 ifdef KBUILD_PROFILE_SELF859 _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 endif863 864 865 876 # done inheriting. 866 877 src_prefix := 878 load_function := 867 879 properties := 868 880 properties_now_l := … … 871 883 properties_deferred_l := 872 884 properties_deferred_r := 885 886 ifdef 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) 890 endif 891 892 873 893 874 894 … … 1150 1170 $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(eval $(value def_tools_sdks_target))) 1151 1171 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 1177 define def_tools_load_function 1178 ifndef 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) 1159 1182 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)!) 1163 1186 endif 1164 1187 endif 1165 1188 endef # def_tools_include 1166 1189 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 1192 define def_sdk_load_function 1193 ifndef 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) 1179 1197 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)!) 1183 1201 endif 1184 1202 endif 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. 1203 endef # def_sdk_load_function 1204 1205 1206 properties := 1207 properties_now_l := 1208 properties_now_r := 1209 properties_deferred := $(PROPS_SINGLE) $(PROPS_DEFERRED) 1210 properties_deferred_l := $(PROPS_ACCUMULATE_L) 1211 properties_deferred_r := $(PROPS_ACCUMULATE_R) 1212 1213 src_prefix := TOOL_ 1214 load_function := def_tools_load_function 1215 $(foreach trg, $(_TOOLS), $(eval $(value def_inherit))) 1216 1217 src_prefix := SDK_ 1218 load_function := def_sdk_load_function 1219 $(foreach trg, $(_SDKS) , $(eval $(value def_inherit))) 1220 1221 # done inheriting. 1222 src_prefix := 1223 load_function := 1224 properties := 1225 properties_now_l := 1226 properties_now_r := 1227 properties_deferred := 1228 properties_deferred_l := 1229 properties_deferred_r := 1230 1191 1231 1192 1232 ifdef KBUILD_PROFILE_SELF … … 1196 1236 endif 1197 1237 1198 ## @todo SDK_X_EXTENDS 1238 1199 1239 1200 1240 #
Note:
See TracChangeset
for help on using the changeset viewer.