Changeset 1672 in kBuild
- Timestamp:
- Jul 7, 2008 9:38:57 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r1670 r1672 613 613 614 614 endef # def_inherit 615 616 617 # 618 # Load global units before doing any inheriting so they can add new properties. 619 # 620 # This only applies to the guys listed in the global USES since there is 621 # no reliable way to deal with things on a target level without first 622 # applying templates. So, to avoid having USES mess up all targets, 623 # we'll make the global and per-target USES property work differently: 624 # The global USES does not apply to targets, just globally. 625 # 626 627 ## Unit load function. 628 # @param loading The unit name 629 define def_unit_load_function 630 ifndef UNIT_$(loading) 631 UNIT_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_UNIT_PATHS) $(KBUILD_PATH)/units $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk))) 632 ifeq ($(UNIT_$(loading)_KMK_FILE),) 633 $(error kBuild: Cannot find include file for the unit '$(loading)'! Searched: $(KBUILD_UNIT_PATHS) $(KBUILD_PATH)/units $(KBUILD_DEFAULT_PATHS)) 634 endif 635 include $(UNIT_$(loading)_KMK_FILE) 636 ifndef UNIT_$(loading) 637 $(warning kBuild: UNIT_$(loading) was not defined by $(UNIT_$(loading)_KMK_FILE)!) 638 endif 639 endif 640 endef # def_unit_load_function 641 642 $(foreach loading, \ 643 $(USES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \ 644 $(USES.$(KBUILD_TARGET_CPU)) \ 645 $(USES.$(KBUILD_TARGET_ARCH)) \ 646 $(USES.$(KBUILD_TARGET)) \ 647 $(USES.$(KBUILD_HOST).$(KBUILD_HOST_ARCH)) \ 648 $(USES.$(KBUILD_HOST_CPU)) \ 649 $(USES.$(KBUILD_HOST_ARCH)) \ 650 $(USES.$(KBUILD_TARGET)) \ 651 $(USES.$(KBUILD_TYPE)) \ 652 $(USES),$(evalval def_unit_load_function)) 615 653 616 654 … … 1213 1251 endef # def_sdk_load_function 1214 1252 1215 ## Unit load function.1216 # @param loading The unit name1217 define def_unit_load_function1218 ifndef UNIT_$(loading)1219 UNIT_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_UNIT_PATHS) $(KBUILD_PATH)/units $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))1220 ifeq ($(UNIT_$(loading)_KMK_FILE),)1221 $(error kBuild: Cannot find include file for the unit '$(loading)'! Searched: $(KBUILD_UNIT_PATHS) $(KBUILD_PATH)/units $(KBUILD_DEFAULT_PATHS))1222 endif1223 include $(UNIT_$(loading)_KMK_FILE)1224 ifndef UNIT_$(loading)1225 $(warning kBuild: UNIT_$(loading) was not defined by $(UNIT_$(loading)_KMK_FILE)!)1226 endif1227 endif1228 endef # def_unit_load_function1229 1230 1253 1231 1254 properties := … … 1306 1329 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 1307 1330 else ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 1308 1331 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 1309 1332 endif 1310 1333 ifeq ($(tool_prefix),AR) ## @todo fix this mess! … … 2130 2153 ifndef PATH_$(target) 2131 2154 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 2132 else 2133 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 2134 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 2135 endif 2155 else ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 2156 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 2136 2157 endif 2137 2158 local suff := $(firstword\ … … 2149 2170 othersrc := 2150 2171 $(target)_OBJS_ := 2172 2173 # Do units pre source callouts. 2174 local units := \ 2175 $($(target)_USES.$(bld_trg).$(bld_trg_arch))\ 2176 $($(target)_USES.$(bld_trg_arch))\ 2177 $($(target)_USES.$(bld_trg))\ 2178 $($(target)_USES.$(bld_type))\ 2179 $($(target)_USES) 2180 $(foreach unit,$(units),$(evalval def_unit_$(unit)_target_pre)) 2151 2181 2152 2182 # source -> object … … 2341 2371 ifndef PATH_$(target) 2342 2372 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 2343 else 2344 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 2345 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 2346 endif 2373 else ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 2374 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 2347 2375 endif 2348 2376 local suff := $(firstword \ … … 2357 2385 othersrc := 2358 2386 $(target)_OBJS_ := 2387 2388 # Do units pre source callouts. 2389 local units := \ 2390 $($(target)_USES.$(bld_trg).$(bld_trg_arch))\ 2391 $($(target)_USES.$(bld_trg_arch))\ 2392 $($(target)_USES.$(bld_trg))\ 2393 $($(target)_USES.$(bld_type))\ 2394 $($(target)_USES) 2395 $(foreach unit,$(units),$(evalval def_unit_$(unit)_target_pre)) 2359 2396 2360 2397 # source -> object
Note:
See TracChangeset
for help on using the changeset viewer.