Changeset 222 for trunk/kBuild
- Timestamp:
- Feb 8, 2005, 6:57:01 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r221 r222 52 52 # all of a type 53 53 _OBJS := 54 _BLDPROGS := 54 55 _LIBS := 55 56 _DLLS := … … 77 78 # @param $source normalized main target 78 79 # @param $type tooltype 80 # @param bld_trg build target. 79 81 _SOURCE_TOOL = $(strip $(firstword \ 80 $($(target)_$(source)_$(type)TOOL.$( BUILD_TARGET)) \82 $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \ 81 83 $($(target)_$(source)_$(type)TOOL) \ 82 $($(target)_$(source)_TOOL.$( BUILD_TARGET)) \84 $($(target)_$(source)_TOOL.$(bld_trg)) \ 83 85 $($(target)_$(source)_TOOL) \ 84 $($(target)_$(type)TOOL.$( BUILD_TARGET)) \86 $($(target)_$(type)TOOL.$(bld_trg)) \ 85 87 $($(target)_$(type)TOOL) \ 86 $($(target)_TOOL.$( BUILD_TARGET)) \88 $($(target)_TOOL.$(bld_trg)) \ 87 89 $($(target)_TOOL) \ 88 $($(source)_$(type)TOOL.$( BUILD_TARGET)) \90 $($(source)_$(type)TOOL.$(bld_trg)) \ 89 91 $($(source)_$(type)TOOL) \ 90 $($(source)_TOOL.$( BUILD_TARGET)) \92 $($(source)_TOOL.$(bld_trg)) \ 91 93 $($(source)_TOOL) \ 92 $($(type)TOOL.$( BUILD_TARGET)) \94 $($(type)TOOL.$(bld_trg)) \ 93 95 $($(type)TOOL) \ 94 $(TOOL.$( BUILD_TARGET)) \96 $(TOOL.$(bld_trg)) \ 95 97 $(TOOL) )) 96 97 _SOURCE_TOOL_OLD = $(strip $(firstword \98 $($(target)_$(source)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_$(source)_TOOL.$(BUILD_TARGET)) \99 $($(target)_$(source)_$(type)TOOL) $($target_$source_TOOL) \100 $($(target)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_TOOL.$(BUILD_TARGET)) \101 $($(target)_$(type)TOOL) $($target_TOOL) \102 $($(source)_$(type)TOOL.$(BUILD_TARGET)) $($(source)_TOOL.$(BUILD_TARGET)) \103 $($(source)_$(type)TOOL) $($(source)_TOOL) \104 $($(type)TOOL.$(BUILD_TARGET)) $(TOOL.$(BUILD_TARGET)) \105 $($(type)TOOL) $(TOOL) ))106 98 107 99 ## Figure out the tool for a target. 108 100 # @param $target normalized target. 109 101 # @param $source tooltype. 102 # @param bld_trg build target. 110 103 _TARGET_TOOL = $(strip $(firstword \ 111 $($(target)_$(source)TOOL.$( BUILD_TARGET)) \104 $($(target)_$(source)TOOL.$(bld_trg)) \ 112 105 $($(target)_$(source)TOOL) \ 113 $($(target)_TOOL.$( BUILD_TARGET)) \106 $($(target)_TOOL.$(bld_trg)) \ 114 107 $($(target)_TOOL) \ 115 108 $($(source)TOOL) \ 116 $($(source)TOOL.$( BUILD_TARGET)) \117 $(TOOL.$( BUILD_TARGET)) \109 $($(source)TOOL.$(bld_trg)) \ 110 $(TOOL.$(bld_trg)) \ 118 111 $(TOOL) \ 119 112 )) … … 668 661 669 662 # 670 # NEEDED671 # 672 673 ## Needed(one).663 # BLDPROGS 664 # 665 666 ## Build program (one). 674 667 # @param $(target) Normalized target (program) name. 675 define def_ needed668 define def_bldprog 676 669 # basics 677 $(eval tool := $(call _TARGET_TOOL,$(target),LD))678 $(eval outbase := $(call _TARGET_BASE,$(target),$(target)))679 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))680 670 $(eval bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))) 681 671 $(eval bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_PLATFORM))) 682 672 $(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_PLATFORM_ARCH))) 683 673 $(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_PLATFORM_CPU))) 674 $(eval tool := $(call _TARGET_TOOL,$(target),LD)) 675 $(eval outbase := $(call _TARGET_BASE,$(target),$(target))) 676 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))) 684 677 $(eval exesuff := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(HOSTSUFF_EXE))) 685 678 $(eval exe := $(outbase)$(exesuff)) … … 804 797 $(eval $(TOOL_$(tool)_LINK_PROGRAM)) 805 798 # publish rule (still need work) 806 if ndef $(target)_INST799 ifdef $(target)_INST 807 800 $(eval pubexe := $(PATH_BIN)/$(notdir $(exe))) 808 801 $(pubexe) : $(exe) $(dir $(pubexe)).dir_created 809 802 $(CP) $(exe) $(pubexe) 810 803 811 _ NEEDED+= $(pubexe)804 _BLDPROGS += $(pubexe) 812 805 _OUT_FILES += $(exe) $(pubexe) 813 806 else 814 _ NEEDED+= $(exe)807 _BLDPROGS += $(exe) 815 808 _OUT_FILES += $(exe) 816 809 endif … … 818 811 endef 819 812 820 # Process needed.821 $(foreach target, $( NEEDED) $(NEEDED.$(BUILD_TARGET)), $(eval $(def_needed)))813 # Process build programs. 814 $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)), $(eval $(def_bldprog))) 822 815 823 816 … … 831 824 define def_lib 832 825 # library basics 833 $(eval tool := $(call _TARGET_TOOL,$(target),AR))834 ifeq ($(tool),)835 $$(error kBuild: Library target $(target) doesn't have a tool defined!)836 endif837 826 ## @todo prefix 838 $(eval outbase := $(call _TARGET_BASE,$(target),$(target)))839 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))840 827 $(eval bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))) 841 828 $(eval bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) 842 829 $(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))) 843 830 $(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))) 831 $(eval tool := $(call _TARGET_TOOL,$(target),AR)) 832 ifeq ($(tool),) 833 $$(error kBuild: Library target $(target) doesn't have a tool defined!) 834 endif 835 $(eval outbase := $(call _TARGET_BASE,$(target),$(target))) 836 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))) 844 837 $(eval libsuff := $(firstword\ 845 838 $($(target)_LIBSUFF.$(bld_trg))\ … … 902 895 define def_dll 903 896 # dllmod basics 904 $(eval tool := $(call _TARGET_TOOL,$(target),LD))905 $(eval outbase := $(call _TARGET_BASE,$(target),$(target)))906 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))907 897 $(eval bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))) 908 898 $(eval bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) 909 899 $(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))) 910 900 $(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))) 901 $(eval tool := $(call _TARGET_TOOL,$(target),LD)) 902 $(eval outbase := $(call _TARGET_BASE,$(target),$(target))) 903 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))) 911 904 $(eval dllsuff := $(firstword $($(target)_DLLSUFF) $($(target)_DLLSUFF) $(TOOL_$(tool)_LDDLLSUFF) $(SUFF_DLL))) 912 905 $(eval dll := $(outbase)$(dllsuff)) … … 1088 1081 define def_program 1089 1082 # basics 1090 $(eval tool := $(call _TARGET_TOOL,$(target),LD))1091 $(eval outbase := $(call _TARGET_BASE,$(target),$(target)))1092 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))1093 1083 $(eval bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))) 1094 1084 $(eval bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) 1095 1085 $(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))) 1096 1086 $(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))) 1087 $(eval tool := $(call _TARGET_TOOL,$(target),LD)) 1088 $(eval outbase := $(call _TARGET_BASE,$(target),$(target))) 1089 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))) 1097 1090 $(eval exesuff := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(SUFF_EXE))) 1098 1091 $(eval exe := $(outbase)$(exesuff)) … … 1244 1237 define def_sysmod 1245 1238 # sysmod basics 1246 $(eval tool := $(call _TARGET_TOOL,$(target),LD))1247 $(eval outbase := $(call _TARGET_BASE,$(target),$(target)))1248 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))1249 1239 $(eval bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))) 1250 1240 $(eval bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) 1251 1241 $(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))) 1252 1242 $(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))) 1243 $(eval tool := $(call _TARGET_TOOL,$(target),LD)) 1244 $(eval outbase := $(call _TARGET_BASE,$(target),$(target))) 1245 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))) 1253 1246 $(eval syssuff := $(firstword $($(target)_SYSSUFF) $($(target)_SYSSUFF) $(TOOL_$(tool)_LDSYSSUFF) $(SUFF_SYS))) 1254 1247 $(eval sys := $(outbase)$(syssuff)) … … 1444 1437 # Do all the default passes if it's unspecified. 1445 1438 1446 #PASSES ?= neededlibraries binaries others publish1447 PASSES ?= neededlibraries dlls binaries others1439 #PASSES ?= bldprogs libraries binaries others publish 1440 PASSES ?= bldprogs libraries dlls binaries others 1448 1441 1449 1442 ## @todo figure out a generic way of configuring how pass works! … … 1503 1496 1504 1497 1505 ## PASS: needed1498 ## PASS: bldprogs 1506 1499 # This pass builds targets which are required for building the rest. 1507 pass_ needed_doit: $(_NEEDEDS)1508 pass := needed1509 PASS := NEEDED1500 pass_bldprogs_doit: $(_BLDPROGS) 1501 pass := bldprogs 1502 PASS := BLDPROGS 1510 1503 $(eval $(def_pass)) 1511 1504 … … 1605 1598 1606 1599 # misc shortcuts. 1607 target: neededlibraries binaries others1600 target: bldprogs libraries binaries others 1608 1601 objects: $(_OBJS) 1602 bldprogs: $(_BLDPROGS) 1609 1603 libraries: $(_LIBS) $(_IMPORT_LIBS) $(_OTHER_LIBRARIES) 1610 1604 dlls: $(_DLLS)
Note:
See TracChangeset
for help on using the changeset viewer.