Changeset 1496
- Timestamp:
- Apr 7, 2008, 1:16:10 AM (17 years ago)
- Location:
- trunk/kBuild
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r1472 r1496 346 346 # @param properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side. 347 347 define def_inherit_keyword 348 prefix := $(word 1,$(subst :, ,$(prefix_keyword)))349 trg_key := $(word 2,$(subst :, ,$(prefix_keyword)))350 src_key := $($(prefix)_$(trg_key)_EXTENDS)351 by := $($(prefix)_$(trg_key)_EXTENDS_BY)348 local prefix := $(word 1,$(subst :, ,$(prefix_keyword))) 349 local trg_key := $(word 2,$(subst :, ,$(prefix_keyword))) 350 local src_key := $($(prefix)_$(trg_key)_EXTENDS) 351 local by := $($(prefix)_$(trg_key)_EXTENDS_BY) 352 352 353 353 # Inherit the properties. … … 546 546 define def_inherit 547 547 548 # Load it .548 # Load it - loading is a mess, fix. 549 549 ifneq ($(load_function),) 550 lo ading := $(patsubst $(src_prefix)%,%,$(trg))551 $(eval $(value $(load_function)))552 endif 553 554 src := $(strip $($(trg)_EXTENDS))550 local loading := $(patsubst $(src_prefix)%,%,$(trg)) 551 $(evalvalctx $(load_function)) 552 endif 553 554 local src := $(strip $($(trg)_EXTENDS)) 555 555 ifneq ($(src),) 556 556 ifndef $(trg)_EXTENDS_STATUS_ … … 559 559 # Load the source. 560 560 ifneq ($(load_function),) 561 lo ading := $(src)562 $(eval $(value $(load_function)))561 local loading := $(src) 562 $(evalvalctx $(load_function)) 563 563 endif 564 564 565 565 # less typing. 566 src := $(src_prefix)$(src)566 local src := $(src_prefix)$(src) 567 567 568 568 # Recursivly process the parent (src) if it's inherting from somebody too. … … 572 572 # out current variable. 'src' OTOH will be overwritten. 573 573 #$ (warning def_inherit: recursing into $(src) from $(trg)) 574 $(foreach trg, $(src), $(eval $(value def_inherit)))575 src := $(src_prefix)$(strip $($(trg)_EXTENDS))574 $(foreach trg, $(src), $(evalval def_inherit)) 575 local src := $(src_prefix)$(strip $($(trg)_EXTENDS)) 576 576 endif 577 577 endif 578 578 579 579 # Get & check EXTENDS_BY. 580 by = $(strip $($(trg)_EXTENDS_BY))580 local by = $(strip $($(trg)_EXTENDS_BY)) 581 581 ifeq ($(by),) 582 by = overriding582 local by = overriding 583 583 else ifn1of ($(by), overriding appending prepending) 584 584 $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(trg)'!) … … 604 604 605 605 # Keyword inheritance. 606 $(foreach prefix_keyword, $(join $(_KEYWORDS_PREFIX), $(addprefix :,$(_KEYWORDS_EXTENDS))), $(eval $(value def_inherit_keyword)))606 $(foreach prefix_keyword, $(join $(_KEYWORDS_PREFIX), $(addprefix :,$(_KEYWORDS_EXTENDS))), $(evalval def_inherit_keyword)) 607 607 608 608 endef # def_inherit … … 630 630 ifndef TEMPLATE_$(loading) 631 631 TEMPLATE_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk))) 632 if neq ($(TEMPLATE_$(loading)_KMK_FILE),)632 ifeq ($(TEMPLATE_$(loading)_KMK_FILE),) 633 633 $(error kBuild: Cannot find include file for the template '$(loading)'! Searched: $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS)) 634 634 endif … … 639 639 endif 640 640 endef # def_templates_load_function 641 $(foreach loading, $(_TEMPLATES), $(eval $(value def_templates_load_function)))641 $(foreach loading, $(_TEMPLATES), $(evalval def_templates_load_function)) 642 642 643 643 … … 682 682 endef # def_collect_bld_xyz 683 683 $(foreach src, $(addprefix TEMPLATE_, $(_TEMPLATES)) $(_ALL_TARGETS) \ 684 ,$(eval $(value def_collect_bld_xyz)))684 ,$(evalval def_collect_bld_xyz)) 685 685 686 686 # Drop duplicate values. … … 697 697 define def_keyword_ordering 698 698 # Check for EXTENDS, fix and validate it if found. 699 src := $(strip $($(prefix)_$(keyword)_EXTENDS))699 local src := $(strip $($(prefix)_$(keyword)_EXTENDS)) 700 700 ifneq ($(src),) 701 701 ifndef $(prefix)_$(keyword)_EXTENDS_STATUS_ … … 709 709 # 'foreach' will create 'keyword' in a new variable context hiding 710 710 # out current variable. 'src' OTOH will be overwritten. 711 $(foreach keyword, $(src), $(eval $(value def_keyword_ordering)))712 src := $(strip $($(prefix)_$(keyword)_EXTENDS))711 $(foreach keyword, $(src), $(evalval def_keyword_ordering)) 712 local src := $(strip $($(prefix)_$(keyword)_EXTENDS)) 713 713 endif 714 714 715 715 # Check and strip EXTENDS_BY. 716 by = $(strip $($(prefix)_$(keyword)_EXTENDS_BY))716 local by = $(strip $($(prefix)_$(keyword)_EXTENDS_BY)) 717 717 ifeq ($(by),) 718 by = overriding718 local by = overriding 719 719 else ifn1of ($(by), overriding appending prepending) 720 720 $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(keyword)'!) … … 750 750 prefix := BLD_TYPE 751 751 valid := $(KBUILD_BLD_TYPES) 752 $(foreach keyword, $(_BLD_TYPES) , $(eval $(value def_keyword_ordering)))752 $(foreach keyword, $(_BLD_TYPES) , $(evalval def_keyword_ordering)) 753 753 754 754 prefix := BLD_TRG 755 755 valid := $(KBUILD_OSES) 756 $(foreach keyword, $(_BLD_TARGETS), $(eval $(value def_keyword_ordering)))756 $(foreach keyword, $(_BLD_TARGETS), $(evalval def_keyword_ordering)) 757 757 758 758 prefix := BLD_ARCH 759 759 valid := $(KBUILD_ARCHES) 760 $(foreach keyword, $(_BLD_ARCHES) , $(eval $(value def_keyword_ordering)))760 $(foreach keyword, $(_BLD_ARCHES) , $(evalval def_keyword_ordering)) 761 761 762 762 prefix := BLD_CPU 763 763 valid := $(KBUILD_CPUS) 764 $(foreach keyword, $(_BLD_CPUS) , $(eval $(value def_keyword_ordering)))764 $(foreach keyword, $(_BLD_CPUS) , $(evalval def_keyword_ordering)) 765 765 766 766 ## @todo Inherit bld_trg.bld_arch for too? … … 799 799 properties_now_r := $(PROPS_FETCHES_ACCUMULATE_R) 800 800 properties_deferred := $(PROPS_FETCHES_DEFERRED) 801 $(foreach trg, $(_ALL_FETCHES),$(eval $(value def_inherit)))801 $(foreach trg, $(_ALL_FETCHES),$(evalval def_inherit)) 802 802 803 803 ## Patches. - not implemented yet. … … 806 806 #properties_now_r := $(PROPS_PATCHES_ACCUMULATE_R) 807 807 #properties_deferred := $(PROPS_PATCHES_DEFERRED) 808 #$(foreach trg, $(_ALL_PATCHES),$(eval $(value def_inherit)))808 #$(foreach trg, $(_ALL_PATCHES),$(evalval def_inherit)) 809 809 810 810 # Programs and build programs. … … 813 813 properties_now_r := $(PROPS_PROGRAMS_ACCUMULATE_R) 814 814 properties_deferred := $(PROPS_PROGRAMS_DEFERRED) 815 $(foreach trg, $(_ALL_BLDPROGS) $(_ALL_PROGRAMS),$(eval $(value def_inherit)))815 $(foreach trg, $(_ALL_BLDPROGS) $(_ALL_PROGRAMS),$(evalval def_inherit)) 816 816 817 817 # Libraries and import libraries. … … 821 821 properties_deferred := $(PROPS_LIBRARIES_DEFERRED) 822 822 if1of ($(BUILD_TARGET), nt os2 win) 823 $(foreach trg, $(_ALL_LIBRARIES) $(_ALL_IMPORT_LIBS),$(eval $(value def_inherit)))823 $(foreach trg, $(_ALL_LIBRARIES) $(_ALL_IMPORT_LIBS),$(evalval def_inherit)) 824 824 else 825 $(foreach trg, $(_ALL_LIBRARIES),$(eval $(value def_inherit)))825 $(foreach trg, $(_ALL_LIBRARIES),$(evalval def_inherit)) 826 826 endif 827 827 … … 832 832 properties_deferred := $(PROPS_DLLS_DEFERRED) 833 833 if1of ($(BUILD_TARGET), nt os2 win) 834 $(foreach trg, $(_ALL_DLLS),$(eval $(value def_inherit)))834 $(foreach trg, $(_ALL_DLLS),$(evalval def_inherit)) 835 835 else 836 $(foreach trg, $(_ALL_DLLS) $(_ALL_IMPORT_LIBS),$(eval $(value def_inherit)))836 $(foreach trg, $(_ALL_DLLS) $(_ALL_IMPORT_LIBS),$(evalval def_inherit)) 837 837 endif 838 838 … … 842 842 properties_now_r := $(PROPS_SYSMODS_ACCUMULATE_R) 843 843 properties_deferred := $(PROPS_SYSMODS_DEFERRED) 844 $(foreach trg, $(_ALL_SYSMODS),$(eval $(value def_inherit)))844 $(foreach trg, $(_ALL_SYSMODS),$(evalval def_inherit)) 845 845 846 846 # Installs. … … 849 849 properties_now_r := $(PROPS_INSTALLS_ACCUMULATE_R) 850 850 properties_deferred := $(PROPS_INSTALLS_DEFERRED) 851 $(foreach trg, $(_ALL_INSTALLS),$(eval $(value def_inherit)))851 $(foreach trg, $(_ALL_INSTALLS),$(evalval def_inherit)) 852 852 853 853 ifdef KBUILD_PROFILE_SELF … … 878 878 properties_deferred_l := $(PROPS_ACCUMULATE_L) 879 879 properties_deferred_r := $(PROPS_ACCUMULATE_R) 880 $(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(eval $(value def_inherit)))880 $(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(evalval def_inherit)) 881 881 882 882 # done inheriting. … … 1063 1063 # Expand the template if specified. 1064 1064 ifneq ($($(target)_TEMPLATE),) 1065 $(foreach prop,$(PROPS_SINGLE),$(eval $(value def_inherit_template_one)))1065 $(foreach prop,$(PROPS_SINGLE),$(evalval def_inherit_template_one)) 1066 1066 $(foreach prop,$(PROPS_DEFERRED),$(eval $(def_inherit_template_one_deferred))) # exploits the 2 evaluation, so no value! 1067 1067 $(foreach prop,$(PROPS_ACCUMULATE_L),$(eval $(def_inherit_template_one_accumulate_l))) # += works fine without value … … 1074 1074 bld_trg_arch := $(BUILD_TARGET_ARCH) 1075 1075 bld_trg_cpu := $(BUILD_TARGET_CPU) 1076 $(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(eval $(value def_inherit_template)))1076 $(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(evalval def_inherit_template)) 1077 1077 1078 1078 bld_trg := $(BUILD_PLATFORM) 1079 1079 bld_trg_arch := $(BUILD_PLATFORM_ARCH) 1080 1080 bld_trg_cpu := $(BUILD_PLATFORM_CPU) 1081 $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(eval $(value def_inherit_template)))1081 $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(evalval def_inherit_template)) 1082 1082 1083 1083 ifdef KBUILD_PROFILE_SELF … … 1126 1126 1127 1127 define def_tools_sdks_target 1128 _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))1129 _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))1130 _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))1131 _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))1128 local _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 1129 local _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg)) 1130 local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch)) 1131 local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu)) 1132 1132 1133 1133 $(eval _TOOLS += $(foreach prop, $(PROPS_TOOLS), \ … … 1148 1148 $($(target)_SOURCES.$(_bld_type)) \ 1149 1149 $($(target)_SOURCES) \ 1150 , $(eval $(value def_tools_sdks_target_source)))1150 , $(evalval def_tools_sdks_target_source)) 1151 1151 endef # def_tools_sdks_target 1152 1152 1153 1153 define def_tools_srcname_target 1154 _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))1155 _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))1156 _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))1157 _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))1154 local _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 1155 local _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg)) 1156 local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch)) 1157 local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu)) 1158 1158 1159 1159 $(foreach source, $(notdir\ … … 1164 1164 $($(target)_SOURCES.$(_bld_type)) \ 1165 1165 $($(target)_SOURCES) \ 1166 ), $(eval $(value def_tools_sdks_target_source)))1166 ), $(evalval def_tools_sdks_target_source)) 1167 1167 endef # def_tools_srcname_target 1168 1168 … … 1170 1170 bld_trg_arch := $(BUILD_TARGET_ARCH) 1171 1171 bld_trg_cpu := $(BUILD_TARGET_CPU) 1172 $(foreach target, $(_ALL_BUILD_TARGET_TARGETS), $(eval $(value def_tools_sdks_target)))1173 $(foreach target, $(_ALL_SRCNAME_TARGETS), $(eval $(value def_tools_srcname_target)))1172 $(foreach target, $(_ALL_BUILD_TARGET_TARGETS), $(evalval def_tools_sdks_target)) 1173 $(foreach target, $(_ALL_SRCNAME_TARGETS), $(evalval def_tools_srcname_target)) 1174 1174 1175 1175 bld_trg := $(BUILD_PLATFORM) 1176 1176 bld_trg_arch := $(BUILD_PLATFORM_ARCH) 1177 1177 bld_trg_cpu := $(BUILD_PLATFORM_CPU) 1178 $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(eval $(value def_tools_sdks_target)))1178 $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(evalval def_tools_sdks_target)) 1179 1179 1180 1180 _TOOLS := $(sort $(_TOOLS)) … … 1221 1221 src_prefix := TOOL_ 1222 1222 load_function := def_tools_load_function 1223 $(foreach trg, $(_TOOLS), $(eval $(value def_inherit)))1223 $(foreach trg, $(_TOOLS), $(evalval def_inherit)) 1224 1224 1225 1225 src_prefix := SDK_ 1226 1226 load_function := def_sdk_load_function 1227 $(foreach trg, $(_SDKS) , $(eval $(value def_inherit)))1227 $(foreach trg, $(_SDKS) , $(evalval def_inherit)) 1228 1228 1229 1229 # done inheriting. … … 1269 1269 define def_pass1_link_common 1270 1270 1271 bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))1272 bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var)))1273 bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))1274 bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU))1275 1276 tool := $(call _TARGET_TOOL,$(target),$(tool_prefix))1277 name := $(firstword\1271 local bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 1272 local bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var))) 1273 local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH)) 1274 local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU)) 1275 1276 local tool := $(call _TARGET_TOOL,$(target),$(tool_prefix)) 1277 local name := $(firstword\ 1278 1278 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\ 1279 1279 $($(target)_NAME.$(bld_trg_arch))\ … … 1282 1282 $($(target)_NAME)\ 1283 1283 $(target)) 1284 outbase := $(call TARGET_BASE,$(name),$(target))1284 local outbase := $(call TARGET_BASE,$(name),$(target)) 1285 1285 ifndef PATH_$(target) 1286 1286 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) … … 1289 1289 endif 1290 1290 ifeq ($(tool_prefix),AR) ## @todo fix this mess! 1291 suff := $(firstword\1291 local suff := $(firstword\ 1292 1292 $($(target)_$(EXT)SUFF.$(bld_trg).$(bld_trg_arch))\ 1293 1293 $($(target)_$(EXT)SUFF.$(bld_trg))\ … … 1298 1298 $(SUFF_LIB)) 1299 1299 else 1300 suff := $(firstword \1300 local suff := $(firstword \ 1301 1301 $($(target)_$(EXT)SUFF) \ 1302 1302 $($(target)_$(EXT)SUFF) \ … … 1304 1304 $($(EXTPRE)SUFF_$(EXT))) 1305 1305 endif 1306 out := $(outbase)$(suff)1306 local out := $(outbase)$(suff) 1307 1307 1308 1308 # TARGET_* … … 1329 1329 $(target)_NOINST := 1 1330 1330 endif 1331 $(eval $(value def_pass1_link_common))1331 $(evalval def_pass1_link_common) 1332 1332 endef 1333 1333 … … 1338 1338 bld_trg_base_var := PLATFORM 1339 1339 $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), \ 1340 $(eval $(value def_pass1_bldprog)))1340 $(evalval def_pass1_bldprog)) 1341 1341 1342 1342 … … 1350 1350 bld_trg_base_var := TARGET 1351 1351 $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1352 $(eval $(value def_pass1_link_common)))1352 $(evalval def_pass1_link_common)) 1353 1353 1354 1354 … … 1362 1362 bld_trg_base_var := TARGET 1363 1363 $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1364 $(eval $(value def_pass1_link_common)))1364 $(evalval def_pass1_link_common)) 1365 1365 1366 1366 … … 1378 1378 bld_trg_base_var := TARGET 1379 1379 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1380 $(eval $(value def_pass1_link_common)))1380 $(evalval def_pass1_link_common)) 1381 1381 else 1382 1382 EXT := DLL … … 1386 1386 bld_trg_base_var := TARGET 1387 1387 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1388 $(eval $(value def_pass1_link_common)))1388 $(evalval def_pass1_link_common)) 1389 1389 endif 1390 1390 … … 1399 1399 bld_trg_base_var := TARGET 1400 1400 $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1401 $(eval $(value def_pass1_link_common)))1401 $(evalval def_pass1_link_common)) 1402 1402 1403 1403 … … 1411 1411 bld_trg_base_var := TARGET 1412 1412 $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1413 $(eval $(value def_pass1_link_common)))1413 $(evalval def_pass1_link_common)) 1414 1414 1415 1415 … … 1419 1419 # 1420 1420 define def_pass1_install 1421 bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))1422 bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))1423 bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))1424 bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))1421 local bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 1422 local bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET)) 1423 local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)) 1424 local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU)) 1425 1425 # TARGET_* 1426 1426 TARGET_$(target) := $(PATH_TARGET)/$(target).ins … … 1428 1428 endef 1429 1429 $(foreach target, $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1430 $(eval $(value def_pass1_install)))1430 $(evalval def_pass1_install)) 1431 1431 1432 1432 ifdef KBUILD_PROFILE_SELF … … 1506 1506 $(out) + $($(target)_$(srcname)_FETCH_OUTPUT_) +| $($(target)_$(srcname)_FETCH_OUTPUT_MAYBE_) : \ 1507 1507 | $($(target)_$(srcname)_FETCH_DEPORD_) 1508 $$(call MSG_FETCH_DL,$(target),$(source),$(out))1508 %$$(call MSG_FETCH_DL,$(target),$(source),$(out)) 1509 1509 @## @todo do fancy stuff like download continuation. 1510 1510 $$(QUIET)$$(RM) -f $(out) … … 1516 1516 # Intermediate goal for making sure the md5 and size matches. it will (re) fetch the archive if necessary. 1517 1517 $(out).checked_$(md5)_$(size): $($(target)_$(srcname)_FETCH_DEPEND_) | $($(target)_$(srcname)_FETCH_DEPORD_) 1518 $$(call MSG_FETCH_CHK,$(target),$(source),$(out))1518 %$$(call MSG_FETCH_CHK,$(target),$(source),$(out)) 1519 1519 $$(QUIET)$$(RM) -f $$@ 1520 1520 @# (re)fetch the file if it doesn't exist or if it doesn't matches the md5. … … 1538 1538 $($(target)_$(srcname)_UNPACK_DEPEND_) \ 1539 1539 | $($(target)_$(srcname)_UNPACK_DEPORD_) $(archive).checked_$(md5)_$(size) 1540 $$(call MSG_FETCH_UP,$(target),$(archive),$(inst))1540 %$$(call MSG_FETCH_UP,$(target),$(archive),$(inst)) 1541 1541 $$(QUIET)$$(RM) -f $(out) 1542 1542 @# if the source archive doesn't exist fetch it (can have been deleted to save space). … … 1561 1561 1562 1562 # common 1563 srcname := $(notdir $(source))1564 inst := $(firstword \1563 local srcname := $(notdir $(source)) 1564 local inst := $(firstword \ 1565 1565 $($(target)_$(source)_INST)\ 1566 1566 $($(target)_$(srcname)_INST)\ … … 1573 1573 endif 1574 1574 INSTARGET_$(target)_$(srcname) := $(inst) 1575 fetchdir := $(firstword \1575 local fetchdir := $(firstword \ 1576 1576 $($(target)_$(source)_FETCHDIR)\ 1577 1577 $($(target)_$(srcname)_FETCHDIR)\ … … 1582 1582 $(PATH_TARGET)\ 1583 1583 ) 1584 deps := \1584 local deps := \ 1585 1585 $($(target)_$(source)_DEPS)\ 1586 1586 $($(target)_$(srcname)_DEPS)\ … … 1588 1588 $($(srcname)_DEPS)\ 1589 1589 $($(target)_DEPS) 1590 orderdeps := \1590 local orderdeps := \ 1591 1591 $($(target)_$(source)_ORDERDEPS)\ 1592 1592 $($(target)_$(srcname)_ORDERDEPS)\ … … 1594 1594 $($(srcname)_ORDERDEPS)\ 1595 1595 $($(target)_ORDERDEPS) 1596 md5 := $(firstword \1596 local md5 := $(firstword \ 1597 1597 $($(target)_$(source)_MD5)\ 1598 1598 $($(target)_$(srcname)_MD5)\ … … 1601 1601 $($(target)_MD5)\ 1602 1602 ) 1603 size := $(firstword \1603 local size := $(firstword \ 1604 1604 $($(target)_$(source)_SIZE)\ 1605 1605 $($(target)_$(srcname)_SIZE)\ … … 1608 1608 $($(target)_SIZE)\ 1609 1609 ) 1610 dep := # not legal for fetch and unpack tools1610 local dep := # not legal for fetch and unpack tools 1611 1611 1612 1612 … … 1614 1614 # The fetching. 1615 1615 # 1616 out := $(fetchdir)/$(srcname)1617 archive := $(out)1616 local out := $(fetchdir)/$(srcname) 1617 local archive := $(out) 1618 1618 TARGET_$(target)_$(srcname) := $(out) 1619 dirdep := $(call DIRDEP,$(fetchdir))1620 tool := $(firstword \1619 local dirdep := $(call DIRDEP,$(fetchdir)) 1620 local tool := $(firstword \ 1621 1621 $($(target)_$(source)_FETCHTOOL)\ 1622 1622 $($(target)_$(srcname)_FETCHTOOL)\ … … 1630 1630 $($(target)_TOOL)\ 1631 1631 ) 1632 flags :=\1632 local flags :=\ 1633 1633 $(TOOL_$(tool)_FETCHFLAGS)\ 1634 1634 $(FETCHFLAGS)\ … … 1670 1670 # The unpacking / installing. 1671 1671 # 1672 out := $(inst)_kBuild_$(target)_$(srcname)_unpacked.lst1673 dirdep := $(call DIRDEP,$(inst))1674 tool := $(firstword \1672 local out := $(inst)_kBuild_$(target)_$(srcname)_unpacked.lst 1673 local dirdep := $(call DIRDEP,$(inst)) 1674 local tool := $(firstword \ 1675 1675 $($(target)_$(source)_UNPACKTOOL)\ 1676 1676 $($(target)_$(srcname)_UNPACKTOOL)\ … … 1685 1685 ) 1686 1686 ifeq ($(tool),) 1687 tool := $(toupper $(subst .,,$(suffix $(subst tar.,TAR,$(srcname)))))1688 $(eval $(value def_tools_include))1689 endif 1690 flags :=\1687 local tool := $(toupper $(subst .,,$(suffix $(subst tar.,TAR,$(srcname))))) 1688 $(evalval def_tools_include) 1689 endif 1690 local flags :=\ 1691 1691 $(TOOL_$(tool)_UNPACKFLAGS)\ 1692 1692 $(UNPACKFLAGS)\ … … 1742 1742 1743 1743 $(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst)) 1744 $$(call MSG_FETCH_OK,$(target))1744 %$$(call MSG_FETCH_OK,$(target)) 1745 1745 $$(QUIET)$$(RM) -f $$@ $$@.tmp 1746 1746 $$(QUIET2)$$(APPEND) $$@.tmp '$(notdir $(out))' … … 1749 1749 1750 1750 $(out)_unfetched: 1751 $$(call MSG_UNFETCH,$(target))1751 %$$(call MSG_UNFETCH,$(target)) 1752 1752 $$(QUIET)$$(RM) -f $$(addprefix $(inst),$$(shell $$(CAT_EXT) $(out).lst 2> /dev/null | $$(SED) -e '/\/$$$$/d')) 1753 1753 $$(QUIET)$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@) \ … … 1758 1758 $(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst)) 1759 1759 $$(QUIET)$$(RM) -f $$@ 1760 $$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst)\1760 %$$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst)\ 1761 1761 ,$$(call MSG_REFETCH,$(target)),$$(call MSG_FETCH,$(target))),$$(call MSG_UNFETCH,$(target))) 1762 1762 $$(QUIET)$$(if $$(wildcard $(out).lst ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched) … … 1788 1788 #$ (warning dbg fetch: target=$(target) sources=$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))) 1789 1789 $(foreach source,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),\ 1790 $(eval $(value def_fetch_src)))1790 $(evalval def_fetch_src)) 1791 1791 1792 1792 # The target. 1793 inst := $(INSTARGET_$(target))1794 out := $(inst)_kBuild_fetch_$(target)1793 local inst := $(INSTARGET_$(target)) 1794 local out := $(inst)_kBuild_fetch_$(target) 1795 1795 1796 1796 $(eval includedep $(out)) … … 1814 1814 bld_trg_arch := $(BUILD_TARGET_ARCH) 1815 1815 $(foreach target, $(FETCHES) $(FETCHES.$(BUILD_TARGET)) $(FETCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1816 $(eval $(value def_fetch)))1816 $(evalval def_fetch)) 1817 1817 1818 1818 # some aliases. … … 1844 1844 # 1845 1845 #$(foreach source,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),\ 1846 # $(eval $(value def_patch_src)))1846 # $(evalval def_patch_src)) 1847 1847 # 1848 1848 #_PATCHES += … … 1850 1850 # 1851 1851 #$(foreach target, $(PATCHES) $(PATCHES.$(BUILD_TARGET)) $(PATCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 1852 # $(eval $(value def_patch)))1852 # $(evalval def_patch)) 1853 1853 # 1854 1854 … … 1860 1860 ## wrapper the compile command dependency check. 1861 1861 ifndef NO_COMPILE_CMDS_DEPS 1862 _DEP_COMPILE_CMDS = $ (comp-cmds $(target)_$(source)_CMDS_PREV_,$(target)_$(source)_CMDS_,FORCE)1862 _DEP_COMPILE_CMDS = $$(comp-cmds-ex $$($(target)_$(source)_CMDS_PREV_),$$(commands $(obj)),FORCE) 1863 1863 else 1864 1864 _DEP_COMPILE_CMDS = … … 1877 1877 $($(target)_$(source)_DEPORD_) \ 1878 1878 $$($(target)_INTERMEDIATES) 1879 $$(call MSG_COMPILE,$(target),$(source),$$@,$(type))1879 %$$(call MSG_COMPILE,$(target),$(source),$$@,$(type)) 1880 1880 else 1881 1881 $(obj) + $($(target)_$(source)_OUTPUT_) +| $($(target)_$(source)_OUTPUT_MAYBE_) : \ … … 1885 1885 $($(target)_$(source)_DEPORD_) \ 1886 1886 $$($(target)_INTERMEDIATES) 1887 $$(call MSG_COMPILE,$(target),$(source),$$@,$(type))1887 %$$(call MSG_COMPILE,$(target),$(source),$$@,$(type)) 1888 1888 ifdef TOOL_$(tool)_COMPILE_$(type)_DONT_PURGE_OUTPUT 1889 1889 $$(QUIET)$$(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_) $($(target)_OUTPUT_MAYBE_) … … 1894 1894 1895 1895 ifndef NO_COMPILE_CMDS_DEPS 1896 $$(QUIET2)$$(APPEND) '$(dep)'1897 $$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(source)_CMDS_PREV_'1898 $$(QUIET2)$$(APPEND) -v '$(dep)' '$(target)_$(source)_CMDS_'1899 $$(QUIET2)$$(APPEND) '$(dep)' 'endef'1896 %$$(QUIET2)$$(APPEND) '$(dep)' 1897 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(source)_CMDS_PREV_' 1898 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(obj)' 1899 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' 1900 1900 endif 1901 1901 1902 1902 $(basename $(notdir $(obj))).o: $(obj) 1903 1903 $(basename $(notdir $(obj))).obj: $(obj) 1904 1905 ## @todo make this 'local cmds' in 0.2.x or when a new kb-src-one is added. 1906 $(target)_$(source)_CMDS_ := 1904 1907 endef 1905 1908 … … 1907 1910 ## wrapper the link command dependency check. 1908 1911 ifndef NO_COMPILE_CMDS_DEPS 1909 _DEP_LINK_CMDS = $ (comp-cmds $(target)_CMDS_PREV_,$(target)_CMDS_,FORCE)1912 _DEP_LINK_CMDS = $$(comp-cmds-ex $$($(target)_CMDS_PREV_),$$(commands $(out)),FORCE) 1910 1913 else 1911 1914 _DEP_LINK_CMDS = … … 1919 1922 # @param $($(target)_OUTPUT_) Output files from the link. 1920 1923 # @param $($(target)_OUTPUT_MAYBE_) Output files that the link may perhaps create. 1921 # @param $($(target)_DEPEND_) 1924 # @param $($(target)_DEPEND_) Dependencies. 1922 1925 # @param $($(target)_DEPORD_) Dependencies which should only affect build order. 1923 # @param $( $(target)_CMDS_)The link commands.1926 # @param $(cmds) The link commands. 1924 1927 # @param $($(target)_CMDS_PREV_) The link commands from the previous run. 1925 1928 define def_link_rule … … 1929 1932 | \ 1930 1933 $($(target)_DEPORD_) 1931 $$(call MSG_LINK,$(target),$$@,$(tool_do))1934 %$$(call MSG_LINK,$(target),$$@,$(tool_do)) 1932 1935 $$(QUIET)$$(RM) -f $(dep) $(out) $($(target)_OUTPUT_) $($(target)_OUTPUT_MAYBE_) 1933 1936 1934 $( $(target)_CMDS_)1937 $(cmds) 1935 1938 1936 1939 ifndef NO_LINK_CMDS_DEPS 1937 $$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_CMDS_PREV_'1938 $$(QUIET2)$$(APPEND) -v '$(dep)' '$(target)_CMDS_'1939 $$(QUIET2)$$(APPEND) '$(dep)' 'endef'1940 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_CMDS_PREV_' 1941 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' 1942 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' 1940 1943 endif 1941 1944 … … 1952 1955 define def_link_install_rule 1953 1956 $(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target)))) 1954 $$(call MSG_INST_TRG,$(target),$(out),$$@)1957 %$$(call MSG_INST_TRG,$(target),$(out),$$@) 1955 1958 $$(QUIET)$$(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@ 1956 1959 … … 1965 1968 # @{ 1966 1969 define def_src_handler_c 1967 type := C1970 local type := C 1968 1971 $(kb-src-one ) 1969 1972 endef 1970 1973 1971 1974 define def_src_handler_cxx 1972 type := CXX1975 local type := CXX 1973 1976 $(kb-src-one ) 1974 1977 endef 1975 1978 1976 1979 define def_src_handler_objc 1977 type := OBJC1980 local type := OBJC 1978 1981 $(kb-src-one ) 1979 1982 endef 1980 1983 1981 1984 define def_src_handler_asm 1982 type := AS1985 local type := AS 1983 1986 $(kb-src-one ) 1984 1987 endef 1985 1988 1986 1989 define def_src_handler_rc 1987 type := RC1990 local type := RC 1988 1991 $(kb-src-one ) 1989 1992 endef … … 2001 2004 # . 2002 2005 define def_src_handler_one 2003 suff := $(suffix $(source))2004 src_handler := $(firstword $(filter $(suff):%, $($(target)_$(source)_SRC_HANDLERS) $($(source)_SRC_HANDLERS) $(target_src_handlers) ))2005 handler := $(patsubst $(suff):%,%,$(src_handler))2006 local suff := $(suffix $(source)) 2007 local src_handler := $(firstword $(filter $(suff):%, $($(target)_$(source)_SRC_HANDLERS) $($(source)_SRC_HANDLERS) $(target_src_handlers) )) 2008 local handler := $(patsubst $(suff):%,%,$(src_handler)) 2006 2009 #$ (warning def_src_handler_one: source=$(source) suff=$(suff) src_handler=$(src_handler) handler=$(handler)) 2007 2010 ifneq ($(handler),) 2008 $(eval $(value $(handler)))2011 $(evalval $(handler)) 2009 2012 else 2010 2013 othersrc += $(source) … … 2018 2021 # @returns othersrc, $(target)_OBJS_, ++ 2019 2022 define def_target_sources 2020 target_src_handlers := $($(target)_SRC_HANDLERS) $(KBUILD_SRC_HANDLERS)2023 local target_src_handlers := $($(target)_SRC_HANDLERS) $(KBUILD_SRC_HANDLERS) 2021 2024 $(foreach source,\ 2022 2025 $($(target)_SOURCES)\ … … 2026 2029 $($(target)_SOURCES.$(bld_trg_cpu))\ 2027 2030 $($(target)_SOURCES.$(bld_type))\ 2028 ,$(eval $(value def_src_handler_one)) )2031 ,$(evalval def_src_handler_one) ) 2029 2032 endef 2030 2033 … … 2075 2078 # library basics 2076 2079 ## @todo prefix 2077 bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))2078 bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))2079 bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))2080 bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))2081 tool := $(call _TARGET_TOOL,$(target),AR)2080 local bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 2081 local bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET)) 2082 local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)) 2083 local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU)) 2084 local tool := $(call _TARGET_TOOL,$(target),AR) 2082 2085 ifeq ($(tool),) 2083 2086 $(error kBuild: Library target $(target) does not have a tool defined!) 2084 2087 endif 2085 name := $(firstword\2088 local name := $(firstword\ 2086 2089 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\ 2087 2090 $($(target)_NAME.$(bld_trg_arch))\ … … 2090 2093 $($(target)_NAME)\ 2091 2094 $(target)) 2092 outbase := $(call TARGET_BASE,$(name),$(target))2095 local outbase := $(call TARGET_BASE,$(name),$(target)) 2093 2096 ifndef PATH_$(target) 2094 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))2097 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 2095 2098 else 2096 2099 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) … … 2098 2101 endif 2099 2102 endif 2100 suff := $(firstword\2103 local suff := $(firstword\ 2101 2104 $($(target)_LIBSUFF.$(bld_trg).$(bld_trg_arch))\ 2102 2105 $($(target)_LIBSUFF.$(bld_trg))\ … … 2106 2109 $(TOOL_$(tool)_ARLIBSUFF)\ 2107 2110 $(SUFF_LIB)) 2108 out := $(outbase)$(suff) 2109 TARGET_$(target) := $(out) 2110 $(target)_OBJS_ := 2111 defpath := $($(target)_PATH) 2112 othersrc := 2111 local out := $(outbase)$(suff) 2112 local defpath := $($(target)_PATH) 2113 TARGET_$(target) := $(out) 2114 # no local here - must be writable across some foreachs. 2115 othersrc := 2116 $(target)_OBJS_ := 2113 2117 2114 2118 # source -> object 2115 $(eval $(value def_target_sources))2119 $(evalval def_target_sources) 2116 2120 2117 2121 # library linking 2118 tool := $(call _TARGET_TOOL,$(target),AR)2119 name := $(firstword\2122 local tool := $(call _TARGET_TOOL,$(target),AR) 2123 local name := $(firstword\ 2120 2124 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\ 2121 2125 $($(target)_NAME.$(bld_trg_arch))\ … … 2124 2128 $($(target)_NAME)\ 2125 2129 $(target)) 2126 outbase := $(call TARGET_BASE,$(name),$(target))2127 flags :=\2130 local outbase := $(call TARGET_BASE,$(name),$(target)) 2131 local flags :=\ 2128 2132 $(TOOL_$(tool)_ARFLAGS)\ 2129 2133 $(TOOL_$(tool)_ARFLAGS.$(bld_type))\ … … 2136 2140 $($(target)_ARFLAGS.$(bld_trg).$(bld_trg_arch)) \ 2137 2141 $($(target)_ARFLAGS.$(bld_trg_cpu)) 2138 dirdep := $(call DIRDEP,$(dir $(out)))2139 deps := $($(target)_DEPS)2140 orderdeps := $($(target)_ORDERDEPS)2142 local dirdep := $(call DIRDEP,$(dir $(out))) 2143 local deps := $($(target)_DEPS) 2144 local orderdeps := $($(target)_ORDERDEPS) 2141 2145 2142 2146 # Adjust paths if we got a default path. 2143 2147 ifneq ($(defpath),) 2144 $(target)_OBJS_ := $(abspathex $($(target)_OBJS_),$(defpath))2145 deps:= $(abspathex $(deps),$(defpath))2146 orderdeps:= $(abspathex $(orderdeps),$(defpath))2148 $(target)_OBJS_ := $(abspathex $($(target)_OBJS_),$(defpath)) 2149 local deps := $(abspathex $(deps),$(defpath)) 2150 local orderdeps := $(abspathex $(orderdeps),$(defpath)) 2147 2151 othersrc := $(abspathex $(othersrc),$(defpath)) 2148 2152 endif … … 2151 2155 # Custom pre-link actions. 2152 2156 ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2153 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2157 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2154 2158 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch) 2155 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))2159 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)) 2156 2160 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type) 2157 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))2161 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type)) 2158 2162 else ifdef $(target)_PRE_CMDS.$(bld_trg_arch) 2159 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))2163 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch)) 2160 2164 else ifdef $(target)_PRE_CMDS.$(bld_trg) 2161 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))2165 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg)) 2162 2166 else ifdef $(target)_PRE_CMDS.$(bld_type) 2163 pre_cmds := $($(target)_PRE_CMDS.$(bld_type))2167 local pre_cmds := $($(target)_PRE_CMDS.$(bld_type)) 2164 2168 else ifdef $(target)_PRE_CMDS 2165 pre_cmds := $($(target)_PRE_CMDS)2169 local pre_cmds := $($(target)_PRE_CMDS) 2166 2170 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2167 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2171 local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2168 2172 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch) 2169 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))2173 local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch)) 2170 2174 else ifdef PRE_CMDS.$(bld_trg).$(bld_type) 2171 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))2175 local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type)) 2172 2176 else ifdef PRE_CMDS.$(bld_trg_arch) 2173 pre_cmds := $(PRE_CMDS.$(bld_trg_arch))2177 local pre_cmds := $(PRE_CMDS.$(bld_trg_arch)) 2174 2178 else ifdef PRE_CMDS.$(bld_trg) 2175 pre_cmds := $(PRE_CMDS.$(bld_trg))2179 local pre_cmds := $(PRE_CMDS.$(bld_trg)) 2176 2180 else ifdef PRE_CMDS.$(bld_type) 2177 pre_cmds := $(PRE_CMDS.$(bld_type))2181 local pre_cmds := $(PRE_CMDS.$(bld_type)) 2178 2182 else 2179 pre_cmds := $(PRE_CMDS)2183 local pre_cmds := $(PRE_CMDS) 2180 2184 endif 2181 2185 2182 2186 # Custom post-link actions. 2183 2187 ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2184 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2188 local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2185 2189 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch) 2186 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))2190 local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)) 2187 2191 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type) 2188 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))2192 local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type)) 2189 2193 else ifdef $(target)_POST_CMDS.$(bld_trg_arch) 2190 post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))2194 local post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch)) 2191 2195 else ifdef $(target)_POST_CMDS.$(bld_trg) 2192 post_cmds := $($(target)_POST_CMDS.$(bld_trg))2196 local post_cmds := $($(target)_POST_CMDS.$(bld_trg)) 2193 2197 else ifdef $(target)_POST_CMDS.$(bld_type) 2194 post_cmds := $($(target)_POST_CMDS.$(bld_type))2198 local post_cmds := $($(target)_POST_CMDS.$(bld_type)) 2195 2199 else ifdef $(target)_POST_CMDS 2196 post_cmds := $($(target)_POST_CMDS)2200 local post_cmds := $($(target)_POST_CMDS) 2197 2201 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2198 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2202 local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2199 2203 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch) 2200 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))2204 local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch)) 2201 2205 else ifdef POST_CMDS.$(bld_trg).$(bld_type) 2202 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))2206 local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type)) 2203 2207 else ifdef POST_CMDS.$(bld_trg_arch) 2204 post_cmds := $(POST_CMDS.$(bld_trg_arch))2208 local post_cmds := $(POST_CMDS.$(bld_trg_arch)) 2205 2209 else ifdef POST_CMDS.$(bld_trg) 2206 post_cmds := $(POST_CMDS.$(bld_trg))2210 local post_cmds := $(POST_CMDS.$(bld_trg)) 2207 2211 else ifdef POST_CMDS.$(bld_type) 2208 post_cmds := $(POST_CMDS.$(bld_type))2212 local post_cmds := $(POST_CMDS.$(bld_type)) 2209 2213 else 2210 post_cmds := $(POST_CMDS)2214 local post_cmds := $(POST_CMDS) 2211 2215 endif 2212 2216 2213 2217 # eliminate this guy? 2214 objs = $($(target)_OBJS_)2218 local objs = $($(target)_OBJS_) 2215 2219 2216 2220 # dependency file 2217 dep := $(out)$(SUFF_DEP)2221 local dep := $(out)$(SUFF_DEP) 2218 2222 ifndef NO_LINK_CMDS_DEPS 2219 2223 _DEPFILES_INCLUDED += $(dep) … … 2240 2244 2241 2245 # call the tool 2242 $(target)_CMDS_:= $(TOOL_$(tool)_LINK_LIBRARY_CMDS)2246 local cmds := $(TOOL_$(tool)_LINK_LIBRARY_CMDS) 2243 2247 ifneq ($(pre_cmds),) 2244 $(target)_CMDS_ := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)2248 local cmds := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds) 2245 2249 endif 2246 2250 ifneq ($(post_cmds),) 2247 $(target)_CMDS_ := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)2251 local cmds := $(cmds)$(NL)$(TAB)$(post_cmds) 2248 2252 endif 2249 2253 $(target)_OUTPUT_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT) … … 2256 2260 2257 2261 # installing and globals 2258 $(eval $(value def_target_install_pluss))2262 $(evalval def_target_install_pluss) 2259 2263 endef 2260 2264 … … 2264 2268 tool_do := LINK_LIBRARY 2265 2269 mode := 0644 2266 $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))2270 $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_lib)) 2267 2271 2268 2272 ifdef KBUILD_PROFILE_SELF … … 2287 2291 define def_link_common 2288 2292 # basics 2289 bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))2290 bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var)))2291 bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))2292 bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU))2293 2294 tool := $(call _TARGET_TOOL,$(target),LD)2295 name := $(firstword\2293 local bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 2294 local bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var))) 2295 local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH)) 2296 local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU)) 2297 2298 local tool := $(call _TARGET_TOOL,$(target),LD) 2299 local name := $(firstword\ 2296 2300 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\ 2297 2301 $($(target)_NAME.$(bld_trg_arch))\ … … 2300 2304 $($(target)_NAME)\ 2301 2305 $(target)) 2302 outbase := $(call TARGET_BASE,$(name),$(target))2306 local outbase := $(call TARGET_BASE,$(name),$(target)) 2303 2307 ifndef PATH_$(target) 2304 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))2308 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 2305 2309 else 2306 2310 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) … … 2308 2312 endif 2309 2313 endif 2310 suff := $(firstword \2314 local suff := $(firstword \ 2311 2315 $($(target)_$(EXT)SUFF) \ 2312 2316 $($(target)_$(EXT)SUFF) \ 2313 2317 $(TOOL_$(tool)_LD$(EXT)SUFF) \ 2314 2318 $($(EXTPRE)SUFF_$(EXT))) 2315 out := $(outbase)$(suff) 2316 TARGET_$(target) := $(out) 2317 $(target)_OBJS_ := 2318 defpath := $($(target)_PATH) 2319 othersrc := 2319 local out := $(outbase)$(suff) 2320 TARGET_$(target) := $(out) 2321 local defpath := $($(target)_PATH) 2322 # no local here - must be writable across some foreachs. 2323 othersrc := 2324 $(target)_OBJS_ := 2320 2325 2321 2326 # source -> object 2322 $(eval $(value def_target_sources))2327 $(evalval def_target_sources) 2323 2328 2324 2329 # more link stuff. 2325 tool := $(call _TARGET_TOOL,$(target),LD)2326 name := $(firstword\2330 local tool := $(call _TARGET_TOOL,$(target),LD) 2331 local name := $(firstword\ 2327 2332 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\ 2328 2333 $($(target)_NAME.$(bld_trg_arch))\ … … 2331 2336 $($(target)_NAME)\ 2332 2337 $(target)) 2333 outbase := $(call TARGET_BASE,$(name),$(target))2334 flags :=\2338 local outbase := $(call TARGET_BASE,$(name),$(target)) 2339 local flags :=\ 2335 2340 $(TOOL_$(tool)_LDFLAGS)\ 2336 2341 $(TOOL_$(tool)_LDFLAGS.$(bld_type))\ … … 2373 2378 $($(target)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\ 2374 2379 $($(target)_LDFLAGS.$(bld_trg_cpu)) 2375 l ibs :=\2380 local libs :=\ 2376 2381 $($(target)_LIBS.$(bld_trg_cpu))\ 2377 2382 $($(target)_LIBS.$(bld_trg).$(bld_trg_arch))\ … … 2414 2419 $(TOOL_$(tool)_LIBS.$(bld_type))\ 2415 2420 $(TOOL_$(tool)_LIBS) 2416 l ibpath :=\2421 local libpath :=\ 2417 2422 $($(target)_LIBPATH.$(bld_trg_cpu))\ 2418 2423 $($(target)_LIBPATH.$(bld_trg).$(bld_trg_arch))\ … … 2455 2460 $(TOOL_$(tool)_LIBPATH.$(bld_type))\ 2456 2461 $(TOOL_$(tool)_LIBPATH) 2457 dirdep := $(call DIRDEP,$(dir $(out)))2458 deps := $($(target)_DEPS)2459 orderdeps := $($(target)_ORDERDEPS)2462 local dirdep := $(call DIRDEP,$(dir $(out))) 2463 local deps := $($(target)_DEPS) 2464 local orderdeps := $($(target)_ORDERDEPS) 2460 2465 2461 2466 # Adjust paths if we got a default path. 2462 2467 ifneq ($(defpath),) 2463 l ibpath:= $(abspathex $(libpath),$(defpath))2464 $(target)_OBJS_ := $(abspathex $($(target)_OBJS_),$(defpath))2465 deps:= $(abspathex $(deps),$(defpath))2466 orderdeps:= $(abspathex $(orderdeps),$(defpath))2468 local libpath := $(abspathex $(libpath),$(defpath)) 2469 $(target)_OBJS_ := $(abspathex $($(target)_OBJS_),$(defpath)) 2470 local deps := $(abspathex $(deps),$(defpath)) 2471 local orderdeps := $(abspathex $(orderdeps),$(defpath)) 2467 2472 othersrc := $(abspathex $(othersrc),$(defpath)) 2468 2473 # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_PATH)/lib if relative to current dir! … … 2471 2476 # Custom pre-link actions. 2472 2477 ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2473 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2478 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2474 2479 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch) 2475 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))2480 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)) 2476 2481 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type) 2477 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))2482 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type)) 2478 2483 else ifdef $(target)_PRE_CMDS.$(bld_trg_arch) 2479 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))2484 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch)) 2480 2485 else ifdef $(target)_PRE_CMDS.$(bld_trg) 2481 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))2486 local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg)) 2482 2487 else ifdef $(target)_PRE_CMDS.$(bld_type) 2483 pre_cmds := $($(target)_PRE_CMDS.$(bld_type))2488 local pre_cmds := $($(target)_PRE_CMDS.$(bld_type)) 2484 2489 else ifdef $(target)_PRE_CMDS 2485 pre_cmds := $($(target)_PRE_CMDS)2490 local pre_cmds := $($(target)_PRE_CMDS) 2486 2491 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2487 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2492 local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2488 2493 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch) 2489 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))2494 local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch)) 2490 2495 else ifdef PRE_CMDS.$(bld_trg).$(bld_type) 2491 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))2496 local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type)) 2492 2497 else ifdef PRE_CMDS.$(bld_trg_arch) 2493 pre_cmds := $(PRE_CMDS.$(bld_trg_arch))2498 local pre_cmds := $(PRE_CMDS.$(bld_trg_arch)) 2494 2499 else ifdef PRE_CMDS.$(bld_trg) 2495 pre_cmds := $(PRE_CMDS.$(bld_trg))2500 local pre_cmds := $(PRE_CMDS.$(bld_trg)) 2496 2501 else ifdef PRE_CMDS.$(bld_type) 2497 pre_cmds := $(PRE_CMDS.$(bld_type))2502 local pre_cmds := $(PRE_CMDS.$(bld_type)) 2498 2503 else 2499 pre_cmds := $(PRE_CMDS)2504 local pre_cmds := $(PRE_CMDS) 2500 2505 endif 2501 2506 2502 2507 # Custom post-link actions. 2503 2508 ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2504 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2509 local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2505 2510 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch) 2506 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))2511 local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)) 2507 2512 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type) 2508 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))2513 local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type)) 2509 2514 else ifdef $(target)_POST_CMDS.$(bld_trg_arch) 2510 post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))2515 local post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch)) 2511 2516 else ifdef $(target)_POST_CMDS.$(bld_trg) 2512 post_cmds := $($(target)_POST_CMDS.$(bld_trg))2517 local post_cmds := $($(target)_POST_CMDS.$(bld_trg)) 2513 2518 else ifdef $(target)_POST_CMDS.$(bld_type) 2514 post_cmds := $($(target)_POST_CMDS.$(bld_type))2519 local post_cmds := $($(target)_POST_CMDS.$(bld_type)) 2515 2520 else ifdef $(target)_POST_CMDS 2516 post_cmds := $($(target)_POST_CMDS)2521 local post_cmds := $($(target)_POST_CMDS) 2517 2522 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type) 2518 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))2523 local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)) 2519 2524 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch) 2520 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))2525 local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch)) 2521 2526 else ifdef POST_CMDS.$(bld_trg).$(bld_type) 2522 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))2527 local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type)) 2523 2528 else ifdef POST_CMDS.$(bld_trg_arch) 2524 post_cmds := $(POST_CMDS.$(bld_trg_arch))2529 local post_cmds := $(POST_CMDS.$(bld_trg_arch)) 2525 2530 else ifdef POST_CMDS.$(bld_trg) 2526 post_cmds := $(POST_CMDS.$(bld_trg))2531 local post_cmds := $(POST_CMDS.$(bld_trg)) 2527 2532 else ifdef POST_CMDS.$(bld_type) 2528 post_cmds := $(POST_CMDS.$(bld_type))2533 local post_cmds := $(POST_CMDS.$(bld_type)) 2529 2534 else 2530 post_cmds := $(POST_CMDS)2535 local post_cmds := $(POST_CMDS) 2531 2536 endif 2532 2537 2533 2538 # eliminate this guy? 2534 objs = $($(target)_OBJS_)2539 local objs = $($(target)_OBJS_) 2535 2540 2536 2541 # installation targets … … 2552 2557 2553 2558 # dependency file 2554 dep := $(outbase)$(SUFF_DEP)2559 local dep := $(outbase)$(SUFF_DEP) 2555 2560 ifndef NO_LINK_CMDS_DEPS 2556 2561 _DEPFILES_INCLUDED += $(dep) … … 2577 2582 2578 2583 # call the tool 2579 $(target)_CMDS_:= $(TOOL_$(tool)_$(tool_do)_CMDS)2584 local cmds := $(TOOL_$(tool)_$(tool_do)_CMDS) 2580 2585 ifneq ($(pre_cmds),) 2581 $(target)_CMDS_ := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)2586 local cmds := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds) 2582 2587 endif 2583 2588 ifneq ($(post_cmds),) 2584 $(target)_CMDS_ := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)2589 local cmds := $(cmds)$(NL)$(TAB)$(post_cmds) 2585 2590 endif 2586 2591 $(target)_OUTPUT_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT) … … 2617 2622 2618 2623 # do the usual stuff. 2619 $(eval $(value def_link_common))2624 $(evalval def_link_common) 2620 2625 2621 2626 endef … … 2629 2634 mode := 0755 2630 2635 bld_trg_base_var := PLATFORM 2631 $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), $(eval $(value def_bldprog)))2636 $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), $(evalval def_bldprog)) 2632 2637 2633 2638 ifdef KBUILD_PROFILE_SELF … … 2651 2656 mode := 0644 2652 2657 bld_trg_base_var := TARGET 2653 $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))2658 $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common)) 2654 2659 2655 2660 ifdef KBUILD_PROFILE_SELF … … 2675 2680 tool_do := LINK_LIBRARY 2676 2681 definst := $(PATH_LIB) 2677 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))2682 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_lib)) 2678 2683 else 2679 2684 EXT := DLL 2680 2685 tool_do := LINK_DLL 2681 2686 definst := $(PATH_DLL) 2682 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))2687 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common)) 2683 2688 endif 2684 2689 … … 2703 2708 mode := 0755 2704 2709 bld_trg_base_var := TARGET 2705 $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))2710 $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common)) 2706 2711 2707 2712 ifdef KBUILD_PROFILE_SELF … … 2725 2730 mode := 0644 2726 2731 bld_trg_base_var := TARGET 2727 $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))2732 $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common)) 2728 2733 2729 2734 ifdef KBUILD_PROFILE_SELF … … 2749 2754 # the install rule 2750 2755 $(insdst) : $(srcsrc) | $(call DIRDEP,$(dir $(insdst))) 2751 $$(call MSG_INST_FILE,$(srcsrc),$(insdst))2756 %$$(call MSG_INST_FILE,$(srcsrc),$(insdst)) 2752 2757 $$(QUIET)$(inscmd) 2753 2758 endef … … 2757 2762 2758 2763 # deal with '=>' in the source file name. 2759 srcdst := $(subst =>, ,$(src))2760 srcsrc := $(firstword $(srcdst))2761 srcdstdir := $(dir $(word 2,$(srcdst)))2762 srcdst := $(word $(words $(srcdst)),$(srcdst))2764 local srcdst := $(subst =>, ,$(src)) 2765 local srcsrc := $(firstword $(srcdst)) 2766 local srcdstdir := $(dir $(word 2,$(srcdst))) 2767 local srcdst := $(word $(words $(srcdst)),$(srcdst)) 2763 2768 2764 2769 # _INSTFUN 2765 2770 ifdef $(srcsrc)_INSTFUN 2766 instfun := $(srcsrc)_INSTFUN2771 local instfun := $(srcsrc)_INSTFUN 2767 2772 else ifdef $(target)_INSTFUN 2768 instfun := $(target)_INSTFUN2773 local instfun := $(target)_INSTFUN 2769 2774 else 2770 instfun := _INSTALL_FILE2775 local instfun := _INSTALL_FILE 2771 2776 endif 2772 2777 2773 2778 # _INST 2774 2779 ifdef $(srcsrc)_INST 2775 inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir))2780 local inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir)) 2776 2781 else ifdef $(target)_INST 2777 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir))2782 local inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir)) 2778 2783 else 2779 inst := $(dir $(srcdstdir))2784 local inst := $(dir $(srcdstdir)) 2780 2785 endif 2781 2786 2782 2787 # calc target 2783 insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))2788 local insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS)) 2784 2789 #$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) inst=$(inst) => insdst=$(insdst)) 2785 2790 2786 2791 # mode, uid and gid 2787 mode := $(firstword \2792 local mode := $(firstword \ 2788 2793 $($(target)_$(srcsrc)_MODE.$(bld_trg).$(bld_trg_arch)) \ 2789 2794 $($(target)_$(srcsrc)_MODE.$(bld_trg)) \ … … 2801 2806 $($(target)_MODE.$(bld_trg)) \ 2802 2807 $($(target)_MODE)) 2803 uid := $(firstword \2808 local uid := $(firstword \ 2804 2809 $($(target)_$(srcsrc)_UID.$(bld_trg).$(bld_trg_arch)) \ 2805 2810 $($(target)_$(srcsrc)_UID.$(bld_trg)) \ … … 2817 2822 $($(target)_UID.$(bld_trg)) \ 2818 2823 $($(target)_UID)) 2819 gid := $(firstword \2824 local gid := $(firstword \ 2820 2825 $($(target)_$(srcsrc)_GID.$(bld_trg).$(bld_trg_arch)) \ 2821 2826 $($(target)_$(srcsrc)_GID.$(bld_trg)) \ … … 2833 2838 $($(target)_GID.$(bld_trg)) \ 2834 2839 $($(target)_GID)) 2835 flags := \2840 local flags := \ 2836 2841 $($(target)_IFFLAGS) \ 2837 2842 $($(target)_IFFLAGS.$(bld_trg)) \ … … 2853 2858 # Adjust the source if we got a default PATH. (This must be done this late!) 2854 2859 ifdef $(target)_PATH 2855 srcsrc := $(abspathex $(srcsrc),$($(target)_PATH))2860 local srcsrc := $(abspathex $(srcsrc),$($(target)_PATH)) 2856 2861 endif 2857 2862 2858 2863 # create the command 2859 2864 ifdef $(srcsrc)_INSTALLER 2860 inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))2865 local inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags)) 2861 2866 else ifdef $(target)_INSTALLER 2862 inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))2867 local inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags)) 2863 2868 else 2864 inscmd := $$(INSTALL)\2869 local inscmd := $$(INSTALL)\ 2865 2870 $(if $(uid),-o $(uid))\ 2866 2871 $(if $(gid),-g $(gid))\ … … 2881 2886 # the install rule 2882 2887 $(insdst) : | $(call DIRDEP,$(dir $(insdst))) 2883 $$(call MSG_INST_SYM,$(insdst),$(symdst))2888 %$$(call MSG_INST_SYM,$(insdst),$(symdst)) 2884 2889 $$(QUIET)$$(RM) -f $$@ 2885 2890 $$(QUIET)$$(LN_SYMLINK) $(symdst) $(insdst) … … 2890 2895 2891 2896 # deal with '=>' in the source file name. 2892 symdst := $(subst =>, ,$(src))2893 symlnk := $(firstword $(symdst))2894 symdst := $(word $(words $(symdst)),$(symdst))2897 local symdst := $(subst =>, ,$(src)) 2898 local symlnk := $(firstword $(symdst)) 2899 local symdst := $(word $(words $(symdst)),$(symdst)) 2895 2900 2896 2901 # _INSTFUN 2897 2902 ifdef $(symlnk)_INSTFUN 2898 instfun := $(symlnk)_INSTFUN2903 local instfun := $(symlnk)_INSTFUN 2899 2904 else ifdef $(target)_INSTFUN 2900 instfun := $(target)_INSTFUN2905 local instfun := $(target)_INSTFUN 2901 2906 else 2902 instfun := _INSTALL_FILE2907 local instfun := _INSTALL_FILE 2903 2908 endif 2904 2909 2905 2910 # _INST 2906 2911 ifdef $(symlnk)_INST 2907 inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))2912 local inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk)) 2908 2913 else ifdef $(target)_INST 2909 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))2914 local inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk)) 2910 2915 else 2911 inst := $(dir $(symlnk))2916 local inst := $(dir $(symlnk)) 2912 2917 endif 2913 2918 2914 2919 # calc target 2915 insdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS))2920 local insdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS)) 2916 2921 #$(warning symlnk=$(symlnk) symdst=$(symdst) insdst=$(insdst) instfun=$(instfun) inst='$(inst)') 2917 2922 … … 2927 2932 # the install rule 2928 2933 $(insdst): 2929 $$(call MSG_INST_DIR,$(insdst))2934 %$$(call MSG_INST_DIR,$(insdst)) 2930 2935 $$(QUIET)$$(INSTALL) -d \ 2931 2936 $(if $(uid),-o $(uid))\ … … 2944 2949 # _INST 2945 2950 ifdef $(directory)_INST 2946 inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))2951 local inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST)) 2947 2952 else ifdef $(target)_INST 2948 inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))2953 local inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST)) 2949 2954 else 2950 inst := $(PATH_INS)2951 endif 2952 2953 mode := $(firstword \2955 local inst := $(PATH_INS) 2956 endif 2957 2958 local mode := $(firstword \ 2954 2959 $($(target)_$(directory)_MODE.$(bld_trg).$(bld_trg_arch)) \ 2955 2960 $($(target)_$(directory)_MODE.$(bld_trg)) \ … … 2961 2966 $($(target)_MODE.$(bld_trg)) \ 2962 2967 $($(target)_MODE)) 2963 uid := $(firstword \2968 local uid := $(firstword \ 2964 2969 $($(target)_$(directory)_UID.$(bld_trg).$(bld_trg_arch)) \ 2965 2970 $($(target)_$(directory)_UID.$(bld_trg)) \ … … 2971 2976 $($(target)_UID.$(bld_trg)) \ 2972 2977 $($(target)_UID)) 2973 gid := $(firstword \2978 local gid := $(firstword \ 2974 2979 $($(target)_$(directory)_GID.$(bld_trg).$(bld_trg_arch)) \ 2975 2980 $($(target)_$(directory)_GID.$(bld_trg)) \ … … 2981 2986 $($(target)_GID.$(bld_trg)) \ 2982 2987 $($(target)_GID)) 2983 flags := \2988 local flags := \ 2984 2989 $($(target)_IDFLAGS)\ 2985 2990 $($(target)_IDFLAGS.$(bld_trg)) \ … … 2992 2997 $($(target)_$(directory)_IDFLAGS.$(bld_trg).$(bld_trg_arch)) 2993 2998 2994 insdst := $(inst)/$(directory)/2999 local insdst := $(inst)/$(directory)/ 2995 3000 #$(warning directory=$(directory) inst=$(inst) insdst=$(insdst) mode=$(mode) gid=$(gid) uid=$(uid)) 2996 3001 … … 3005 3010 define def_install 3006 3011 # the basics. 3007 bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))3008 bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))3009 bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))3010 bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))3012 local bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE)) 3013 local bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET)) 3014 local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)) 3015 local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU)) 3011 3016 3012 3017 INSTARGET_$(target) := $($(target)_GOALS) … … 3014 3019 3015 3020 $(foreach directory,$($(target)_DIRS) $($(target)_DIRS.$(bld_trg)) $($(target)_DIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_cpu)) $($(target)_DIRS.$(bld_type)), \ 3016 $(eval $(value def_install_directory)))3021 $(evalval def_install_directory)) 3017 3022 3018 3023 $(foreach src,$($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)), \ 3019 $(eval $(value def_install_src)))3024 $(evalval def_install_src)) 3020 3025 3021 3026 $(foreach src,$($(target)_SYMLINKS) $($(target)_SYMLINKS.$(bld_trg)) $($(target)_SYMLINKS.$(bld_trg).$(bld_trg_arch)) $($(target)_SYMLINKS.$(bld_trg_arch)) $($(target)_SYMLINKS.$(bld_trg_cpu)) $($(target)_SYMLINKS.$(bld_type)), \ 3022 $(eval $(value def_install_symlink)))3027 $(evalval def_install_symlink)) 3023 3028 3024 3029 # the collection target … … 3038 3043 ## process all install targets 3039 3044 $(foreach target, $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \ 3040 $(eval $(value def_install)))3045 $(evalval def_install)) 3041 3046 3042 3047 ifdef KBUILD_PROFILE_SELF … … 3068 3073 define def_mkdir_rule 3069 3074 $(directory): 3070 $$(call MSG_MKDIR,$$@)3075 %$$(call MSG_MKDIR,$$@) 3071 3076 $$(QUIET)$$(MKDIR) -p $$@ 3072 3077 endef … … 3090 3095 @$(ECHO) 'stat: $(make-stats )' 3091 3096 endif 3092 $(call MSG_NOTHING)3097 %$(call MSG_NOTHING) 3093 3098 3094 3099 … … 3097 3102 # 3098 3103 do-clean: 3099 $(call MSG_CLEAN)3104 %$(call MSG_CLEAN) 3100 3105 $(QUIET)$(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN) 3101 3106 $(QUIET)$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $(rsort $(dir $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN))) … … 3207 3212 .PHONY: pass_$(pass)_order 3208 3213 pass_$(pass)_order: $(pass_prev) 3209 $$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))3214 %$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass))) 3210 3215 + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass) 3211 3216 else … … 3213 3218 .PHONY: pass_$(pass)_order pass_$(pass)_banner 3214 3219 pass_$(pass)_banner: 3215 $$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))3220 %$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass))) 3216 3221 pass_$(pass)_order: \ 3217 3222 $(pass_prev) \ -
trunk/kBuild/header.kmk
r1441 r1496 1052 1052 QUIET := @ 1053 1053 QUIET2 := @ 1054 MSG_L1 ?= @$(ECHO) "kBuild: $1"1054 MSG_L1 ?= %@$(ECHO) "kBuild: $1" 1055 1055 MSG_L2 = 1056 1056 else ifeq ($(KBUILD_VERBOSE),1) … … 1058 1058 QUIET := @ 1059 1059 QUIET2 := @ 1060 MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"1060 MSG_L1 ?= %@$(ECHO) "kBuild: $1 $2" 1061 1061 MSG_L2 = 1062 1062 else ifeq ($(KBUILD_VERBOSE),2) … … 1064 1064 QUIET := 1065 1065 QUIET2 := @ 1066 MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"1067 MSG_L2 ?= @$(ECHO) "kBuild: $1"1066 MSG_L1 ?= %@$(ECHO) "kBuild: $1 $2" 1067 MSG_L2 ?= %@$(ECHO) "kBuild: $1" 1068 1068 else 1069 1069 # maximal output. 1070 1070 QUIET := 1071 1071 QUIET2 := 1072 MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"1073 MSG_L2 ?= @$(ECHO) "kBuild: $1"1072 MSG_L1 ?= %@$(ECHO) "kBuild: $1 $2" 1073 MSG_L2 ?= %@$(ECHO) "kBuild: $1" 1074 1074 endif 1075 1075 endif
Note:
See TracChangeset
for help on using the changeset viewer.