Changeset 380 for trunk/kBuild


Ignore:
Timestamp:
Dec 18, 2005, 2:52:47 PM (20 years ago)
Author:
bird
Message:

Big command dependency job. More installation stuff.

Location:
trunk/kBuild
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r353 r380  
    4747_DEPFILES :=
    4848
     49# included dependency files.
     50_DEPFILES_INCLUDED :=
     51
     52
    4953# All kind of output files except for _OBJS and _DEPFILES.
    5054# Compiling or linking definition outputting other things that $@ and any
     
    6367_SYSMODS  :=
    6468_INSTALLS :=
     69_INSTALLS_DIRS :=
    6570_OTHERS   :=
    66 _DIRS     := $(PATH_TARGET)/
     71_DIRS     := $(PATH_TARGET)/ $(PATH_TARGET)
    6772_IMPORT_LIBS :=
    6873
     
    366371$(foreach sdk, $(_SDKS), $(eval $(value def_sdks_include_one)))
    367372
     373
    368374#
    369375# Object processing.
    370376#
    371377
    372 ## Generates the '::' rule for building all objects of a source file.
     378## wrapper the compile command dependency check.
     379ifndef NO_COMPILE_CMDS_DEPS
     380_DEP_COMPILE_CMDS = $(if $(subst $(strip $($(target)_$(source)_CMDS_PREV_)),,$(strip $($(target)_$(source)_CMDS_))),FORCE,)
     381else
     382_DEP_COMPILE_CMDS =
     383endif
     384
     385## Generates the rules for building a specific object, and the '::' aliases
     386# for building a source file.
    373387# @param    $(obj)    The object file.
    374 define def_target_obj_rule
     388define def_target_source_rule
     389$(obj) $($(target)_$(source)_OUTPUT_): \
     390                $($(target)_$(source)_DEPEND_) \
     391                $(_DEP_COMPILE_CMDS) \
     392                | \
     393                $($(target)_$(source)_DEPORD_)
     394        $(call MSG_L1,Creating $$@)
     395        $(RM) -f $(dep) $(out) $($(target)_$(source)_OUTPUT_)
     396        $(custom_pre)
     397               
     398$($(target)_$(source)_CMDS_)
     399
     400        $(custom_post)
     401ifndef NO_COMPILE_CMDS_DEPS
     402        @$(APPEND) "$(dep)"
     403        @$(APPEND) "$(dep)" 'define $(target)_$(source)_CMDS_PREV_'
     404        @$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_$(source)_CMDS_))'
     405        @$(APPEND) "$(dep)" 'endef'
     406endif   
     407
    375408$(basename $(notdir $(obj))).o::
    376409        + $$(MAKE) -B -f $$(MAKEFILE) $(obj)
     
    378411        + $$(MAKE) -B -f $$(MAKEFILE) $(obj)
    379412endef
     413
     414
     415## wrapper the link command dependency check.
     416ifndef NO_COMPILE_CMDS_DEPS
     417_DEP_LINK_CMDS = $(if $(subst $(strip $($(target)_CMDS_PREV_)),,$(strip $($(target)_CMDS_))),FORCE,)
     418else
     419_DEP_LINK_CMDS =
     420endif
     421
     422## Generate the link rule for a target.
     423# @param    $(target)               The normalized target name.
     424# @param    $(dirdep)               Directories we depend upon begin created before linking.
     425# @param    $(dep)                  The name of the dependency file.
     426# @param    $(out)
     427# @param    $($(target)_OUTPUT_)    Output files from the link.
     428# @param    $($(target)_DEPEND_)        Dependencies.
     429# @param    $($(target)_DEPORD_)    Dependencies which should only affect build order.
     430# @param    $($(target)_CMDS_)      The link commands.
     431# @param    $($(target)_CMDS_PREV_) The link commands from the previous run.
     432define def_link_rule
     433$(out) $($(target)_OUTPUT_): \
     434                $($(target)_DEPEND_) \
     435                $(_DEP_LINK_CMDS) \
     436                | \
     437                $($(target)_DEPORD_)
     438        $(call MSG_L1,Creating $$@)
     439        $(RM) -f $(dep) $($(target)_OUTPUT_)
     440        $(custom_pre)
     441               
     442$($(target)_CMDS_)
     443
     444        $(custom_post)
     445ifndef NO_LINK_CMDS_DEP
     446        @$(APPEND) "$(dep)" 'define $(target)_CMDS_PREV_'
     447        @$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_CMDS_))'
     448        @$(APPEND) "$(dep)" 'endef'
     449endif   
     450
     451$(basename $(notdir $(out)))::
     452        + $$(MAKE) -B -f $$(MAKEFILE) $(out)
     453endef
     454
     455
     456## Generate the link & lib install rule
     457# @param    $(target)   Normalized target name.
     458# @param    $(out)      The build target.
     459# @param    $(INSTARGET_$(target))  The installation targets.
     460# @param    $(mode)     The file mode (optional)
     461define def_link_install_rule
     462$(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target))))
     463        $(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@
     464endef
     465
    380466
    381467
     
    628714        $(SUFF_OBJ))
    629715obj         := $(outbase)$(objsuff)
    630 dep         := $(outbase)$(SUFF_DEP)
    631716deps        := \
    632717        $($(target)_$(source)_DEPS)\
     
    645730        $($(target)_DEPS.$(bld_trg_cpu))
    646731
     732# dependencies
     733dep         := $(obj)$(SUFF_DEP)
     734ifndef NO_COMPILE_DEPS
     735_DEPFILES_INCLUDED += $(dep)
     736$(if $(wildcard $(dep)),$(eval include $(dep)))
     737endif
    647738
    648739#$ (warning dbg: target=$(target) source=$(source) tool=$(tool) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    649 ifndef TOOL_$(tool)_COMPILE_$(type)
     740ifndef TOOL_$(tool)_COMPILE_$(type)_CMDS
    650741$(warning kBuild: tools: \
    651742        1 $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \
     
    665756        15 $(TOOL.$(bld_trg)) \
    666757        16 $(TOOL) )
    667 $(error kBuild: TOOL_$(tool)_COMPILE_$(type) is not defined. source=$(source) target=$(target) )
    668 endif
    669 
    670 # generate the rules
    671 $(eval $(TOOL_$(tool)_COMPILE_$(type)))
    672 
    673 $(eval $(def_target_obj_rule))
    674 
     758$(error kBuild: TOOL_$(tool)_COMPILE_$(type)_CMDS is not defined. source=$(source) target=$(target) )
     759endif
     760
     761# call the tool
     762$(target)_$(source)_CMDS_   := $(TOOL_$(tool)_COMPILE_$(type)_CMDS)
     763$(target)_$(source)_OUTPUT_ := $(TOOL_$(tool)_COMPILE_$(type)_OUTPUT)
     764$(target)_$(source)_DEPEND_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPEND) $(deps) $(source)
     765$(target)_$(source)_DEPORD_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPORD) $(dirdep)
     766
     767# generate the compile rule.
     768$(eval $(def_target_source_rule))
     769
     770_OUT_FILES      += $($(target)_$(source)_OUTPUT_)
    675771$(target)_OBJS_ += $(obj)
    676 _DEPFILES       += $(dep)
    677772
    678773endef
     
    697792        ,$(eval $(value def_target_source_c_cpp_asm)) )
    698793
    699 endef
    700 
    701 ## Generate the link & lib install rule
    702 # @param    $(target)   Normalized target name.
    703 # @param    $(out)      The build target.
    704 # @param    $(INSTARGET_$(target))  The installation targets.
    705 define def_link_install_rule
    706 $(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target))))
    707         $(RM) -f $$@
    708         $(CP) $(out) $$@
    709794endef
    710795
     
    804889deps        := $($(target)_DEPS)
    805890
    806 lib     := $(out)
    807 libsuff := $(suff)
    808 $(eval $(TOOL_$(tool)_LINK_LIBRARY))
     891# dependency file
     892dep := $(out)$(SUFF_DEP)
     893ifndef NO_LINK_CMDS_DEP
     894_DEPFILES_INCLUDED += $(dep)
     895$(if $(wildcard $(dep)),$(eval include $(dep)))
     896endif
     897
     898# check that the tool is defined.
     899ifndef TOOL_$(tool)_LINK_LIBRARY_CMDS
     900$(warning kBuild: tools: \
     901        1 $($(target)_$(source)TOOL.$(bld_trg)) \
     902        2 $($(target)_$(source)TOOL) \
     903        3 $($(target)_TOOL.$(bld_trg)) \
     904        4 $($(target)_TOOL) \
     905        5 $($(source)TOOL) \
     906        6 $($(source)TOOL.$(bld_trg)) \
     907        7 $(TOOL.$(bld_trg)) \
     908        8 $(TOOL) )
     909$(error kBuild: TOOL_$(tool)_LINK_LIBRARY_CMDS isn't defined! target=$(target) )
     910endif
     911
     912# call the tool
     913$(target)_CMDS_   := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)
     914$(target)_OUTPUT_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT)
     915$(target)_DEPEND_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPEND) $(deps) $(objs)
     916$(target)_DEPORD_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPORD) $(dirdep)
     917
     918# generate the link rule.               
     919$(eval $(def_link_rule))
    809920
    810921# installing and globals
    811922definst := $(PATH_LIB)
    812 typevar :=_LIBS
     923typevar := _LIBS
    813924$(eval $(value def_target_install_pluss))
    814925endef
    815926
    816927# Process libraries
     928mode := 0644
    817929$(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)), $(eval $(value def_lib)))
    818930
     
    829941# @param    $(definst)  The default _INST value.
    830942# @param    $(typevar)  The name of the variable with all the root targets of its type.
    831 define def_link_prolog
     943define def_link_common
    832944# basics
    833945bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
     
    9891101endif # NOINST
    9901102
    991 endef
    992 
    993 
    994 ##
    995 # Typical link epilog.
    996 #
    997 # @param        $(target)   Normalized target name.
    998 # @param        $(out)      The output file.
    999 define def_link_epilog
    1000 
    1001 _INSTALLS    += $(INSTARGET_$(target))
    1002 _OBJS        += $($(target)_OBJS_)
    1003 _OUT_FILES   += $(out)
    1004 _CLEAN_FILES += $($(target)_CLEAN)
    1005 
    1006 endef
    1007 
    1008 
    1009 #
    1010 # BLDPROGS
    1011 #
    1012 
    1013 ## Build program (one).
    1014 # @param    $(target)   Normalized target (program) name.
    1015 define def_bldprog
    1016 
    1017 # set NOINST if not forced installation.
    1018 ifndef $(target)_INST
    1019 $(target)_NOINST := 1
    1020 endif
    1021 
    1022 # prolog
    1023 $(eval $(value def_link_prolog))
    1024 
    1025 # body
    1026 ifndef TOOL_$(tool)_LINK_PROGRAM
    1027 $(warning kBuild: tools: \
    1028         1 $($(target)_$(source)TOOL.$(bld_trg)) \
    1029         2 $($(target)_$(source)TOOL) \
    1030         3 $($(target)_TOOL.$(bld_trg)) \
    1031         4 $($(target)_TOOL) \
    1032         5 $(TOOL.$(bld_trg)) \
    1033         6 $(TOOL) )
    1034 $(error kBuild: TOOL_$(tool)_LINK_PROGRAM is not defined. target=$(target) )
    1035 endif
    1036 $(eval $(TOOL_$(tool)_LINK_PROGRAM))
    1037 
    1038 # epilog
    1039 $(eval $(value def_link_epilog))
    1040 
    1041 endef
    1042 
    1043 # Process build programs.
    1044 EXT     := EXE
    1045 EXTPRE  := HOST
    1046 definst := $(PATH_BIN)
    1047 typevar := _BLDPROGS
    1048 bld_trg_base_var := PLATFORM
    1049 $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)), $(eval $(value def_bldprog)))
    1050 
    1051 
    1052 
    1053 #
    1054 # DLLS
    1055 #
    1056 
    1057 ## DLL (one).
    1058 # @param    $(target)   Normalized target (program) name.
    1059 define def_dll
    1060 
    1061 # prolog
    1062 $(eval $(value def_link_prolog))
    1063 
    1064 # body
    1065 ifndef TOOL_$(tool)_LINK_DLL
     1103# dependency file
     1104dep := $(outbase)$(SUFF_DEP)
     1105ifndef NO_LINK_CMDS_DEP
     1106_DEPFILES_INCLUDED += $(dep)
     1107$(if $(wildcard $(dep)),$(eval include $(dep)))
     1108endif
     1109
     1110# check that the tool is defined.
     1111ifndef TOOL_$(tool)_$(tool_do)_CMDS
    10661112$(warning kBuild: tools: \
    10671113        1 $($(target)_$(source)TOOL.$(bld_trg)) \
     
    10731119        7 $(TOOL.$(bld_trg)) \
    10741120        8 $(TOOL) )
    1075 $(error kBuild: TOOL_$(tool)_LINK_DLL is not defined. target=$(target) )
    1076 endif
    1077 $(eval $(TOOL_$(tool)_LINK_DLL))
    1078 
    1079 # epilog
    1080 $(eval $(value def_link_epilog))
    1081 
    1082 endef
     1121$(error kBuild: TOOL_$(tool)_$(tool_do)_CMDS isn't defined! target=$(target) )
     1122endif
     1123
     1124# call the tool
     1125$(target)_CMDS_   := $(TOOL_$(tool)_$(tool_do)_CMDS)
     1126$(target)_OUTPUT_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT)
     1127$(target)_DEPEND_ := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $(objs)
     1128$(target)_DEPORD_ := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep)
     1129
     1130# generate the link rule.               
     1131$(eval $(def_link_rule))
     1132
     1133               
     1134# Update globals.
     1135_OBJS        += $($(target)_OBJS_)
     1136_OUT_FILES   += $($(target)_OUTPUT_) $(out)
     1137_CLEAN_FILES += $($(target)_CLEAN)
     1138_INSTALLS    += $(INSTARGET_$(target))
     1139
     1140endef
     1141
     1142
     1143#
     1144# BLDPROGS
     1145#
     1146
     1147## Build program (one).
     1148# @param    $(target)   Normalized target (program) name.
     1149define def_bldprog
     1150
     1151# set NOINST if not forced installation.
     1152ifndef $(target)_INST
     1153$(target)_NOINST := 1
     1154endif
     1155
     1156# do the usual stuff.
     1157$(eval $(value def_link_common))
     1158
     1159endef
     1160
     1161# Process build programs.
     1162EXT     := EXE
     1163EXTPRE  := HOST
     1164tool_do := LINK_PROGRAM
     1165definst := $(PATH_BIN)
     1166typevar := _BLDPROGS
     1167mode    := 0755
     1168bld_trg_base_var := PLATFORM
     1169$(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)), $(eval $(value def_bldprog)))
     1170
     1171
     1172
     1173#
     1174# DLLS
     1175#
    10831176
    10841177# Process dlls
    10851178EXT     := DLL
    10861179EXTPRE  :=
     1180tool_do := LINK_DLL
    10871181definst := $(PATH_DLL)
    10881182typevar := _DLLS
     1183mode    := 0755
    10891184bld_trg_base_var := TARGET
    1090 $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)), $(eval $(value def_dll)))
    1091 
     1185$(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)), $(eval $(value def_link_common)))
    10921186
    10931187
     
    11001194$(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(value def_lib)))
    11011195else
    1102 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(value def_dll)))
     1196$(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(value def_link_common)))
    11031197endif
    11041198$(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), \
     
    11091203# PROGRAMS
    11101204#
    1111 
    1112 ## Program (one).
    1113 # @param    $(target)   Normalized target (program) name.
    1114 define def_program
    1115 
    1116 # prolog
    1117 $(eval $(value def_link_prolog))
    1118 
    1119 # body
    1120 ifndef TOOL_$(tool)_LINK_PROGRAM
    1121 $(warning kBuild: tools: \
    1122         1 $($(target)_$(source)TOOL.$(bld_trg)) \
    1123         2 $($(target)_$(source)TOOL) \
    1124         3 $($(target)_TOOL.$(bld_trg)) \
    1125         4 $($(target)_TOOL) \
    1126         5 $($(source)TOOL) \
    1127         6 $($(source)TOOL.$(bld_trg)) \
    1128         7 $(TOOL.$(bld_trg)) \
    1129         8 $(TOOL) )
    1130 $(error kBuild: TOOL_$(tool)_LINK_PROGRAM is not defined. target=$(target) )
    1131 endif
    1132 $(eval $(TOOL_$(tool)_LINK_PROGRAM))
    1133 
    1134 # epilog
    1135 $(eval $(value def_link_epilog))
    1136 
    1137 endef
    11381205
    11391206# Process programs
    11401207EXT     := EXE
    11411208EXTPRE  :=
     1209tool_do := LINK_PROGRAM
    11421210definst := $(PATH_BIN)
    11431211typevar := _PROGRAMS
     1212mode    := 0755
    11441213bld_trg_base_var := TARGET
    1145 $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)), $(eval $(value def_program)))
     1214$(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)), $(eval $(value def_link_common)))
    11461215
    11471216
     
    11501219# SYSMODS
    11511220#
    1152 
    1153 ## System module (one).
    1154 # @param    $(target)   Normalized target (program) name.
    1155 define def_sysmod
    1156 
    1157 # prolog
    1158 $(eval $(value def_link_prolog))
    1159 
    1160 # body
    1161 ifndef TOOL_$(tool)_LINK_SYSMOD
    1162 $(warning kBuild: tools: \
    1163         1 $($(target)_$(source)TOOL.$(bld_trg)) \
    1164         2 $($(target)_$(source)TOOL) \
    1165         3 $($(target)_TOOL.$(bld_trg)) \
    1166         4 $($(target)_TOOL) \
    1167         5 $($(source)TOOL) \
    1168         6 $($(source)TOOL.$(bld_trg)) \
    1169         7 $(TOOL.$(bld_trg)) \
    1170         8 $(TOOL) )
    1171 $(error kBuild: TOOL_$(tool)_LINK_SYSMOD is not defined. target=$(target) )
    1172 endif
    1173 $(eval $(TOOL_$(tool)_LINK_SYSMOD))
    1174 
    1175 # epilog
    1176 $(eval $(value def_link_epilog))
    1177 
    1178 endef
    11791221
    11801222# Process sysmods
    11811223EXT     := SYS
    11821224EXTPRE  :=
     1225tool_do := LINK_SYSMOD
    11831226definst := $(PATH_SYS)
    11841227typevar := _SYSMODS
     1228mode    := 0644
    11851229bld_trg_base_var := TARGET
    1186 $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)), $(eval $(value def_sysmod)))
     1230$(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)), $(eval $(value def_link_common)))
    11871231
    11881232
     
    12011245# the install rule
    12021246$(insdst) : $(srcsrc) | $(call DIRDEP,$(dir $(insdst)))
    1203         $$(RM) -f $$@
     1247        $$(if $$(filter $(INSTALL),$(inscmd)),,$$(RM) -f $$@)
    12041248        $(inscmd)
    12051249endef
     
    12261270# _INST
    12271271ifdef $(srcsrc)_INST
    1228 inst = $(srcsrc)_INST
     1272inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdst))
    12291273else
    12301274ifdef $(target)_INST
    1231 inst = $(target)_INST
    1232 else
    1233 inst =
     1275inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdst))
     1276else
     1277inst := $(dir $(srcdst))
    12341278endif
    12351279endif
    12361280
    12371281# calc target
    1238 insdst := $(call $(instfun),$(srcdst),$(target),$($(inst)),$(PATH_INS))
     1282insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
    12391283#$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) srcdst=$(srcsrc) inst=$(inst) => insdst=$(insdst))
    12401284
     
    12461290inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target))
    12471291else
    1248 inscmd := $$(CP) $(srcsrc) $(insdst)
     1292inscmd := $$(INSTALL) $(srcsrc) $(insdst)
    12491293endif
    12501294endif
     
    12621306$(insdst) : | $(call DIRDEP,$(dir $(insdst)))
    12631307        $$(RM) -f $$@
    1264         $$(LN_SYMLINK) $(srcsrc) $(insdst)
     1308        $$(LN_SYMLINK) $(symdst) $(insdst)
    12651309endef
    12661310
     
    12691313
    12701314# deal with '=>' in the source file name.
    1271 srcdst := $(subst =>, ,$(src))
    1272 srcsrc := $(firstword $(srcdst))
    1273 srcdst := $(word $(words $(srcdst)),$(srcdst))
     1315symdst := $(subst =>, ,$(src))
     1316symlnk := $(firstword $(symdst))
     1317symdst := $(word $(words $(symdst)),$(symdst))
    12741318
    12751319# _INSTFUN
    1276 ifdef $(srcsrc)_INSTFUN
    1277 instfun := $(srcsrc)_INSTFUN
     1320ifdef $(symlnk)_INSTFUN
     1321instfun := $(symlnk)_INSTFUN
    12781322else
    12791323ifdef $(target)_INSTFUN
     
    12851329
    12861330# _INST
    1287 ifdef $(srcsrc)_INST
    1288 inst = $(srcsrc)_INST
     1331ifdef $(symlnk)_INST
     1332inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))
    12891333else
    12901334ifdef $(target)_INST
    1291 inst = $(target)_INST
    1292 else
    1293 inst =
     1335inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))
     1336else
     1337inst := $(dir $(symlnk))
    12941338endif
    12951339endif
    12961340
    12971341# calc target
    1298 insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
    1299 #$(warning srcsrc=$(srcsrc) srcdst=$(srcdst) insdst=$(insdst))
     1342insdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS))
     1343#$(warning symlnk=$(symlnk) symdst=$(symdst) insdst=$(insdst) instfun=$(instfun) inst='$(inst)')
    13001344
    13011345# generate the rule (need double evaluation here)
     
    13041348INSTARGET_$(target) += $(insdst)
    13051349endef
     1350
     1351               
     1352## generate the install rule
     1353define def_install_directory_rule
     1354# the install rule
     1355$(insdst):
     1356        $(INSTALL) -d \
     1357                $(if $(uid),-o $(uid))\
     1358                $(if $(gid),-g $(gid))\
     1359                $(if $(mode),-m $(mode))\
     1360                $(insdst)
     1361               
     1362.NOTPARALLEL: $(insdst)
     1363endef
     1364               
     1365
     1366## create one directory
     1367define def_install_directory
     1368
     1369# _INST
     1370ifdef $(directory)_INST
     1371inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))
     1372else
     1373ifdef $(target)_INST
     1374inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))
     1375else
     1376inst := $(PATH_INS)
     1377endif
     1378endif
     1379
     1380mode := $(firstword \
     1381        $($(target)_$(directory)_MODE.$(bld_trg)) \
     1382        $($(target)_$(directory)_MODE) \
     1383        $($(directory)_MODE.$(bld_trg)) \
     1384        $($(directory)_MODE) \
     1385        $($(target)_MODE.$(bld_trg)) \
     1386        $($(target)_MODE))
     1387uid := $(firstword \
     1388        $($(target)_$(directory)_UID.$(bld_trg)) \
     1389        $($(target)_$(directory)_UID) \
     1390        $($(directory)_UID.$(bld_trg)) \
     1391        $($(directory)_UID) \
     1392        $($(target)_UID.$(bld_trg)) \
     1393        $($(target)_UID))
     1394gid := $(firstword \
     1395        $($(target)_$(directory)_GID.$(bld_trg)) \
     1396        $($(target)_$(directory)_GID) \
     1397        $($(directory)_GID.$(bld_trg)) \
     1398        $($(directory)_GID) \
     1399        $($(target)_GID.$(bld_trg)) \
     1400        $($(target)_GID))
     1401
     1402insdst := $(inst)/$(directory)/
     1403#$(warning directory=$(directory) inst=$(inst) insdst=$(insdst) mode=$(mode) gid=$(gid) uid=$(uid))
     1404
     1405# generate the rule (need double evaluation here)
     1406$(eval $(def_install_directory_rule))
     1407
     1408INSTARGET_DIRS_$(target) += $(insdst)
     1409endef
     1410
    13061411
    13071412## process one install target.
     
    13131418
    13141419INSTARGET_$(target) :=
     1420INSTARGET_DIRS_$(target) :=
     1421
     1422$(foreach directory,$($(target)_DIRS) $($(target)_DIRS.$(bld_trg)) $($(target)_DIRS.$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_cpu)) $($(target)_DIRS.$(bld_type)), \
     1423        $(eval $(value def_install_directory)))
     1424
    13151425$(foreach src,$($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)), \
    13161426        $(eval $(value def_install_src)))
     
    13191429        $(eval $(value def_install_symlink)))
    13201430
    1321 _INSTALLS  += $(INSTARGET_$(target))
     1431_INSTALLS += $(INSTARGET_$(target)) $($(target)_GOALS)
     1432_INSTALLS_DIRS += $(INSTARGET_DIRS_$(target))
    13221433endef
    13231434
     
    13421453#
    13431454_DIR_ALL := $(sort $(addsuffix /,$(patsubst %/,%,$(_DIRS))) $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS)))
     1455$(foreach directory,$(_INSTALLS_DIRS), $(eval _DIR_ALL := $(filter-out $(directory),$(_DIR_ALL))))
     1456
    13441457
    13451458define def_mkdir_rule
     
    13631476#
    13641477do-clean:
    1365         $(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_CLEAN_FILES) $(OTHER_CLEAN)
     1478        $(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN)
    13661479
    13671480
     
    14351548$(foreach makefile,$(MAKEFILES_AFTER_$(PASS))  $(MAKEFILES_AFTER_$(PASS).$(BUILD_TARGET)) ,$(eval $(def_pass_makefile)))
    14361549
    1437 ifdef KBUILD_SAFE_PARALLELL
     1550ifdef KBUILD_SAFE_PARALLEL
    14381551.NOTPARALLEL: pass_$(pass) pass_$(pass)_before pass_$(pass)_after pass_$(pass)_this
    14391552.PHONY:       pass_$(pass) pass_$(pass)_before pass_$(pass)_after pass_$(pass)_this pass_$(pass)_doit
     
    14661579# @param        $(prev_pass)    The previous pass name.
    14671580define def_pass_order
    1468 ifdef KBUILD_SAFE_PARALLELL
     1581ifdef KBUILD_SAFE_PARALLEL
    14691582.NOTPARALLEL: pass_$(pass)_order
    14701583.PHONY: pass_$(pass)_order
     
    15011614        + $(MAKE) -f $(firstword $(MAKEFILE_LIST)) all_recursive
    15021615
     1616# @todo make this a non-default pass!           
    15031617uninstall:
    15041618        $(RM) -f $(_INSTALLS)
     1619       
     1620install: pass_installs
    15051621
    15061622# misc shortcuts.
    1507 targets:   bldprogs libraries dlls programs sysmods others install
     1623targets:   bldprogs libraries dlls programs sysmods others installs
    15081624objects:   $(_OBJS)
    15091625bldprogs:  $(_BLDPROGS)
     
    15131629sysmods:   $(_SYSMODS)
    15141630others:    $(_OTHERS)
    1515 install $(_INSTALLS)
     1631installs:  $(_INSTALLS_DIRS) $(_INSTALLS)
    15161632
    15171633
     
    15321648        @$(ECHO) "  TARGET_$(target)=$(TARGET_$(target))" $(NLTAB)\
    15331649        @$(ECHO) "  INSTARGET_$(target)=$(INSTARGET_$(target))" $(NLTAB)\
    1534 $(foreach prop,$(PROPS_SINGLE) $(PROPS_ACCUMULATE) OBJS_, \
     1650$(foreach prop,$(PROPS_SINGLE) $(PROPS_ACCUMULATE) OBJS_ CLEAN, \
    15351651        $(eval _tmp:=$(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) \
    15361652        $(if $($(target)_$(prop).$(_tmp)),\
  • trunk/kBuild/header.kmk

    r353 r380  
    3434
    3535#
     36# The FORCE rule.
     37#
     38FORCE:
     39                               
     40#
    3641# Try avoid inference rules.
    3742#
     
    4954lastword = $(word $(words $(1)), $(1))
    5055
     56##
     57# Newline character(s).
     58define NL
     59
     60
     61endef
     62
     63##
     64# Tab character.
     65TAB := $(subst .,       ,.)
     66
     67##
     68# Space character.
     69SP := $(subst ., ,.)
     70
     71##
     72# Checks if two strings are equal.
     73# @returns      blank if equal
     74# @returns      non-blank if not equal.
     75# @param    $1   String 1.
     76# @param    $2   String 2
     77STRCMP = $(
    5178
    5279#
     
    337364# Standard kBuild tools.
    338365#
    339 DEP                 := $(PATH_TOOLS)/kDep$(HOSTSUFF_EXE)
    340 DEP_PRE             := $(PATH_TOOLS)/kDepPre$(HOSTSUFF_EXE)
    341366ifeq ($(MAKE),kmk)
    342 MAKE                := $(PATH_TOOLS)/kmk$(HOSTSUFF_EXE)
    343 endif
    344 
    345 # Standard Unix shell utils
    346 ifdef KMK_BUILTIN
    347 ECHO                := kmk_builtin_echo
    348 MKDIR               := kmk_builtin_mkdir
    349 RM                  := kmk_builtin_rm
    350 CP                  := kmk_builtin_cp
    351 else
    352 ECHO                := echo
    353 MKDIR               := $(PATH_TOOLS)/mkdir$(HOSTSUFF_EXE)
    354 RM                  := $(PATH_TOOLS)/rm$(HOSTSUFF_EXE)
    355 CP                  := $(PATH_TOOLS)/cp$(HOSTSUFF_EXE)
    356 APPEND              := $(PATH_TOOLS)/append$(HOSTSUFF_EXE)
    357 endif
    358 CP_EXT              := $(PATH_TOOLS)/cp$(HOSTSUFF_EXE)
    359 MV                  := $(PATH_TOOLS)/mv$(HOSTSUFF_EXE)
    360 SED                 := $(PATH_TOOLS)/sed$(HOSTSUFF_EXE)
    361 CAT                 := $(PATH_TOOLS)/cat$(HOSTSUFF_EXE)
    362 LN_SYMLINK          := $(CP)
    363 #LN_SYMLINK          := ln -s
    364 # Bourn shell clone.
    365 MAKESHELL           := $(PATH_TOOLS)/ash$(HOSTSUFF_EXE)
    366 SHELL               := $(MAKESHELL)
     367MAKE        := $(PATH_TOOLS)/kmk$(HOSTSUFF_EXE)
     368endif
     369
     370DEP_EXT     := $(PATH_TOOLS)/kDep$(HOSTSUFF_EXE)
     371ifeq ($(filter kDep,$(KMK_BUILTIN)),kDep)
     372DEP         := kmk_builtin_kDepPre
     373else
     374DEP         := $(DEP_EXT)
     375endif
     376
     377DEP_PRE_EXT := $(PATH_TOOLS)/kDepPre$(HOSTSUFF_EXE)
     378ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepPre)
     379DEP_PRE     := $(if kmk_builtin_kDepPre
     380else
     381DEP_PRE     := $(DEP_PRE_EXT)
     382endif
     383
     384APPEND_EXT  := $(PATH_TOOLS)/kmk_append$(HOSTSUFF_EXE)
     385ifeq ($(filter append,$(KMK_BUILTIN)),append)
     386APPEND      := kmk_builtin_append
     387else
     388APPEND      := $(APPEND_EXT)
     389endif
     390
     391CAT_EXT     := $(PATH_TOOLS)/kmk_cat$(HOSTSUFF_EXE)
     392ifeq ($(filter cat,$(KMK_BUILTIN)),cat)
     393CAT         := kmk_builtin_cat
     394else
     395CAT         := $(CAT_EXT)
     396endif
     397
     398CP_EXT      := $(PATH_TOOLS)/kmk_cp$(HOSTSUFF_EXE)
     399ifeq ($(filter cp,$(KMK_BUILTIN)),cp)
     400CP          := kmk_builtin_cp
     401else
     402CP          := $(CP_EXT)
     403endif
     404
     405ECHO_EXT    := $(PATH_TOOLS)/kmk_echo$(HOSTSUFF_EXE)
     406ifeq ($(filter echo,$(KMK_BUILTIN)),echo)
     407ECHO        := kmk_builtin_echo
     408else
     409ECHO        := $(ECHO_EXT)
     410endif
     411
     412INSTALL_EXT := $(PATH_TOOLS)/kmk_install$(HOSTSUFF_EXE)
     413ifeq ($(filter install,$(KMK_BUILTIN)),install)
     414INSTALL     := kmk_builtin_install
     415else
     416INSTALL     := $(INSTALL_EXT)
     417endif
     418
     419LN_EXT      := $(PATH_TOOLS)/kmk_ln$(HOSTSUFF_EXE)
     420ifeq ($(filter ln,$(KMK_BUILTIN)),ln)
     421LN          := kmk_builtin_ln
     422else
     423LN          := $(LN_EXT)
     424endif
     425
     426MKDIR_EXT   := $(PATH_TOOLS)/kmk_mkdir$(HOSTSUFF_EXE)
     427ifeq ($(filter mkdir,$(KMK_BUILTIN)),mkdir)
     428MKDIR       := kmk_builtin_mkdir
     429else
     430MKDIR       := $(MKDIR_EXT)
     431endif
     432
     433MV_EXT      := $(PATH_TOOLS)/kmk_mv$(HOSTSUFF_EXE)
     434ifeq ($(filter mv,$(KMK_BUILTIN)),mv)
     435MV          := kmk_builtin_mv
     436else
     437MV          := $(MV_EXT)
     438endif
     439
     440RM_EXT      := $(PATH_TOOLS)/kmk_rm$(HOSTSUFF_EXE)
     441ifeq ($(filter rm,$(KMK_BUILTIN)),rm)
     442RM          := kmk_builtin_rm
     443else
     444RM          := $(RM_EXT)
     445endif
     446
     447SED_EXT     := $(PATH_TOOLS)/kmk_sed$(HOSTSUFF_EXE)
     448ifeq ($(filter sed,$(KMK_BUILTIN)),sed)
     449SED         := kmk_builtin_sed
     450else
     451SED         := $(SED_EXT)
     452endif
     453
     454# Our default shell is the Almquist shell from *BSD.
     455ASH         := $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)
     456MAKESHELL   := $(ASH)
     457SHELL       := $(ASH)
    367458export SHELL MAKESHELL
    368459
    369 # kBuild utils.
    370 ifeq ($(filter append,$(KMK_BUILTIN)),append)
    371 APPEND              := kmk_builtin_append
    372 else
    373 APPEND              := $(PATH_TOOLS)/append$(HOSTSUFF_EXE)
    374 endif
     460# Symlinking is problematic on some platforms...                       
     461LN_SYMLINK  := $(LN) -s
     462
    375463
    376464
     
    539627PASS_INSTALLS       := Install
    540628PASS_INSTALLS_trgs  :=
    541 PASS_INSTALLS_vars  := _INSTALLS
     629PASS_INSTALLS_vars  := _INSTALLS_DIRS _INSTALLS
    542630PASS_INSTALLS_pass  := installs
    543631
  • trunk/kBuild/tools/ALP.kmk

    r353 r380  
    5555# @param    $(outbase)  Output basename (full). Use this for list files and such.
    5656# @param    $(objsuff)  Object suffix.
    57 define TOOL_ALP_COMPILE_AS
    58 #$ (warning dbg: TOOL_ALP_COMPILE_AS: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    59 $(obj) $(outbase).lst: $(deps) $(source) | $(dirdep)
    60         $(call MSG_L2,Compiling $$@ using ALP)
    61         $(TOOL_ALP_AS) \
     57TOOL_ALP_COMPILE_AS_OUTPUT = $(outbase).lst
     58TOOL_ALP_COMPILE_AS_DEPEND =
     59TOOL_ALP_COMPILE_AS_DEPORD =
     60define TOOL_ALP_COMPILE_AS_CMDS
     61        $(TOOL_ALP_AS)\
    6262                $(flags) $(addsuffix /,$(addprefix -I:, $(incs))) $(addprefix -D:, $(defs))\
    63                 $(source) \
    64                 -Fl:$(outbase).lst \
    65                 -Fd:$(dep) \
     63                $(source)\
     64                -Fl:$(outbase).lst\
     65                -Fd:$(dep)\
    6666                -Fo:$(obj)
    67 _OUT_FILES += $(outbase).lst
    68 
    6967endef
    7068
  • trunk/kBuild/tools/GCC.kmk

    r353 r380  
    7676# @param    $(dirdep)   Directory creation dependency.
    7777# @param    $(deps)             Other dependencies.
    78 #
    7978# @param    $(outbase)  Output basename (full). Use this for list files and such.
    8079# @param    $(objsuff)  Object suffix.
    81 define TOOL_GCC_COMPILE_C
    82 #$ (warning dbg: TOOL_GCC_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    83 $(obj): $(deps) $(source) | $(dirdep)
    84         $(call MSG_L2,Compiling $$@ using GCC)
     80#
     81TOOL_GCC_COMPILE_C_OUTPUT =
     82TOOL_GCC_COMPILE_C_DEPEND =
     83TOOL_GCC_COMPILE_C_DEPORD =
     84define TOOL_GCC_COMPILE_C_CMDS
    8585        $(TOOL_GCC_CC) -c\
    8686                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    87                 -Wp,-MD,$(dep) -Wp,-MT,$$@ \
    88                 -o $$@\
     87                -Wp,-MD,$(dep) -Wp,-MT,$(out) \
     88                -o $(out)\
    8989                $(call ABSPATH,$(source))
    90 
    9190endef
    9291
     
    105104# @param    $(outbase)  Output basename (full). Use this for list files and such.
    106105# @param    $(objsuff)  Object suffix.
    107 define TOOL_GCC_COMPILE_CXX
    108 #$ (warning dbg: TOOL_GCC_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    109 $(obj): $(deps) $(source) | $(dirdep)
    110         $(call MSG_L2,Compiling $$@ using GCC)
     106TOOL_GCC_COMPILE_CXX_OUTPUT =
     107TOOL_GCC_COMPILE_CXX_DEPEND =
     108TOOL_GCC_COMPILE_CXX_DEPORD =
     109define TOOL_GCC_COMPILE_CXX_CMDS
    111110        $(TOOL_GCC_CXX) -c\
    112111                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    113                 -Wp,-MD,$(dep) -Wp,-MT,$$@ \
    114                 -o $$@\
     112                -Wp,-MD,$(dep) -Wp,-MT,$(out) \
     113                -o $(out)\
    115114                $(call ABSPATH,$(source))
    116 
    117115endef
    118116
     
    120118## Link library
    121119# @param    $(target)   Normalized main target name.
    122 # @param    $(lib)              Library name.
     120# @param    $(out)      Library name.
    123121# @param    $(objs)     Object files to put in the library.
    124122# @param    $(flags)    Flags.
     
    127125#
    128126# @param    $(outbase)  Output basename (full). Use this for list files and such.
    129 define TOOL_GCC_LINK_LIBRARY
    130 #$ (warning dbg: TOOL_GCC_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
    131 $(lib): $(deps) $(objs) | $(dirdep)
    132         $(call MSG_L1,Creating Library $$@)
    133         $(RM) -f $$@
    134         $(TOOL_GCC_AR) $(flags) $$@ $(objs)
    135 
     127TOOL_GCC_LINK_LIBRARY_OUTPUT =
     128TOOL_GCC_LINK_LIBRARY_DEPEND =
     129TOOL_GCC_LINK_LIBRARY_DEPORD =
     130define TOOL_GCC_LINK_LIBRARY_CMDS
     131        $(TOOL_GCC_AR) $(flags) $(out) $(objs)
    136132endef
    137133
     
    151147#
    152148# @param    $(outbase)  Output basename (full). Use this for list files and such.
    153 define TOOL_GCC_LINK_PROGRAM
    154 #$ (warning dbg: TOOL_GCC_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    155 $(out): $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    156         $(call MSG_L1,Creating Program $$@)
    157 ifneq ($(custom_pre),)
    158         $(eval $(custom_pre))
    159 endif
    160         $(TOOL_GCC_LD) $(flags) -o $$@ $(objs) \
    161         $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
    162 ifneq ($(custom_post),)
    163         $(eval $(custom_post))
    164 endif
    165 
     149TOOL_GCC_LINK_PROGRAM_OUTPUT =
     150TOOL_GCC_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     151TOOL_GCC_LINK_PROGRAM_DEPORD =
     152define TOOL_GCC_LINK_PROGRAM_CMDS
     153        $(TOOL_GCC_LD) $(flags) -o $(out) $(objs) \
     154                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
    166155endef
    167156
     
    179168# @param    $(custom_pre)   Custom step invoked before linking.
    180169# @param    $(custom_post)  Custom step invoked after linking.
    181 #
    182 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    183 define TOOL_GCC_LINK_DLL
    184 #$ (warning dbg: TOOL_GCC_LINK_DLL: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    185 $(out): $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    186         $(call MSG_L1,Creating Program $$@)
    187 ifneq ($(custom_pre),)
    188         $(eval $(custom_pre))
    189 endif
    190         $(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
     170# @param    $(outbase)      Output basename (full). Use this for list files and such.
     171TOOL_GCC_LINK_DLL_OUTPUT =
     172TOOL_GCC_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     173TOOL_GCC_LINK_DLL_DEPORD =
     174define TOOL_GCC_LINK_DLL_CMDS
     175        $(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $(out) $(objs) \
    191176                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
    192 ifneq ($(custom_post),)
    193         $(eval $(custom_post))
    194 endif
    195 
    196177endef
    197178
  • trunk/kBuild/tools/GCC3.kmk

    r353 r380  
    9494# @param    $(outbase)  Output basename (full). Use this for list files and such.
    9595# @param    $(objsuff)  Object suffix.
    96 define TOOL_GCC3_COMPILE_C
    97 #$ (warning dbg: TOOL_GCC3_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
    98 $(obj): $(deps) $(source) | $(dirdep)
    99         $(call MSG_L2,Compiling $$@ using GCC3)
     96TOOL_GCC3_COMPILE_C_OUTPUT =
     97TOOL_GCC3_COMPILE_C_DEPEND =
     98TOOL_GCC3_COMPILE_C_DEPORD =
     99define TOOL_GCC3_COMPILE_C_CMDS
    100100        $(TOOL_GCC3_CC) -c\
    101101                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    102                 -Wp,-MD,$(dep) -Wp,-MT,$$@ -Wp,-MP \
    103                 -o $$@\
     102                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
     103                -o $(obj)\
    104104                $(call ABSPATH,$(source))
    105 
    106105endef
    107106
     
    117116# @param    $(dirdep)   Directory creation dependency.
    118117# @param    $(deps)             Other dependencies.
    119 #
    120118# @param    $(outbase)  Output basename (full). Use this for list files and such.
    121119# @param    $(objsuff)  Object suffix.
    122 define TOOL_GCC3_COMPILE_CXX
    123 #$ (warning dbg: TOOL_GCC3_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
    124 $(obj): $(deps) $(source) | $(dirdep)
    125         $(call MSG_L2,Compiling $$@ using GCC3)
     120TOOL_GCC3_COMPILE_CXX_OUTPUT =
     121TOOL_GCC3_COMPILE_CXX_DEPEND =
     122TOOL_GCC3_COMPILE_CXX_DEPORD =
     123define TOOL_GCC3_COMPILE_CXX_CMDS
    126124        $(TOOL_GCC3_CXX) -c\
    127125                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    128                 -Wp,-MD,$(dep) -Wp,-MT,$$@ -Wp,-MP \
    129                 -o $$@\
     126                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
     127                -o $(obj)\
    130128                $(call ABSPATH,$(source))
    131 
    132129endef
    133130
     
    135132## Link library
    136133# @param    $(target)   Normalized main target name.
    137 # @param    $(lib)              Library name.
     134# @param    $(out)              Library name.
    138135# @param    $(objs)     Object files to put in the library.
    139136# @param    $(flags)    Flags.
     
    141138# @param    $(deps)             Other dependencies.
    142139# @param    $(othersrc) Unhandled sources.
    143 #
    144 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    145 
    146 define TOOL_GCC3_LINK_LIBRARY_ADDMOD
    147 
    148         echo "ADDMOD $(o)" >> $(lib).ar-script
    149 endef
    150 
    151 define TOOL_GCC3_LINK_LIBRARY_EXPAND_LIB
    152 
    153         $(MKDIR) -p $(dir $(outbase))ar.extract/$(notdir $(srclib))
    154         cd $(dir $(outbase))ar.extract/$(notdir $(srclib)) && $(TOOL_GCC3_AR) x $(srclib)
    155         for o in `$(TOOL_GCC3_AR) t $(srclib)`; do echo "ADDMOD $(dir $(outbase))ar.extract/$(notdir $(srclib))/$$$${o}" >> $(lib).ar-script; done
    156 endef
    157 
    158 define TOOL_GCC3_LINK_LIBRARY
    159 #$ (warning dbg: TOOL_GCC3_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    160 $(lib): $(deps) $(objs) $(filter %.a %.lib,$(othersrc)) | $(dirdep)
    161         $(call MSG_L1,Creating Library $$@)
    162         $(RM) -f $$@
    163 ifneq ($(strip $(filter %.a %.lib,$(othersrc))),)
    164         echo "CREATE $$@" > $(lib).ar-script
    165         $(foreach o, $(objs),$(TOOL_GCC3_LINK_LIBRARY_ADDMOD))
    166         $(foreach srclib, $(filter %.a %.lib,$(othersrc)),$(TOOL_GCC3_LINK_LIBRARY_EXPAND_LIB))
    167         echo "SAVE" >> $(lib).ar-script
    168         echo "END" >> $(lib).ar-script
    169         $(TOOL_GCC3_AR) -M < $(lib).ar-script
    170         $(RM) -Rf "$(dir $(outbase))ar.extract/"
    171 
    172 _OUT_FILES += $(lib).ar-script
    173 else
    174         $(TOOL_GCC3_AR) $(flags) $$@ $(objs)
    175 endif
    176 
     140# @param    $(outbase)  Output basename (full). Use this for list files and such.
     141TOOL_GCC3_LINK_LIBRARY_OUTPUT = $(out).ar-script
     142TOOL_GCC3_LINK_LIBRARY_DEPEND = $(filter %.a %.lib,$(othersrc))
     143TOOL_GCC3_LINK_LIBRARY_DEPORD =
     144define TOOL_GCC3_LINK_LIBRARY_CMDS
     145        $(APPEND) $(out).ar-script "CREATE $(out)"
     146        $(foreach o, $(objs)\
     147                ,$(NL)$(TAB)$(APPEND) $(out).ar-script "ADDMOD $(o)")
     148        $(foreach srclib, $(filter %.a %.lib,$(othersrc))\
     149                ,$(NL)$(TAB)$(APPEND) $(out).ar-script "ADDLIB $(srclib)")
     150        $(APPEND) $(out).ar-script "SAVE"
     151        $(APPEND) $(out).ar-script "END"
     152        $(TOOL_GCC3_AR) -M < $(out).ar-script
    177153endef
    178154
     
    190166# @param    $(custom_pre)   Custom step invoked before linking.
    191167# @param    $(custom_post)  Custom step invoked after linking.
    192 #
    193 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    194 define TOOL_GCC3_LINK_PROGRAM
    195 #$ (warning dbg: TOOL_GCC3_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    196 $(out) $(outbase).map: $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    197         $(call MSG_L1,Creating Program $$@)
    198 ifneq ($(custom_pre),)
    199         $(eval $(custom_pre))
    200 endif
    201         $(RM) -f $$@
    202         $(TOOL_GCC3_LD) $(flags) -o $$@ $(objs) \
    203                 $(foreach p,$(libpath), -L$(p)) \
    204                 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
     168# @param    $(outbase)  Output basename (full). Use this for list files and such.
     169TOOL_GCC3_LINK_PROGRAM_OUTPUT = $(outbase).map
     170TOOL_GCC3_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     171TOOL_GCC3_LINK_PROGRAM_DEPORD =
     172define TOOL_GCC3_LINK_PROGRAM_CMDS
     173        $(TOOL_GCC3_LD) $(flags) -o $(out) $(objs)\
     174                $(foreach p,$(libpath), -L$(p))\
     175                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))\
    205176                $(call TOOL_GCC3_LD_MAP,$(outbase).map)
    206 ifneq ($(custom_post),)
    207         $(eval $(custom_post))
    208 endif
    209 _OUT_FILES += $(outbase).map
    210 
    211177endef
    212178
     
    224190# @param    $(custom_pre)   Custom step invoked before linking.
    225191# @param    $(custom_post)  Custom step invoked after linking.
    226 #
    227 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    228 define TOOL_GCC3_LINK_DLL
    229 #$ (warning dbg: TOOL_GCC3_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    230 $(out) $(outbase).map: $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    231         $(call MSG_L1,Creating Program $$@)
    232 ifneq ($(custom_pre),)
    233         $(eval $(custom_pre))
    234 endif
    235         $(RM) -f $$@
    236         $(TOOL_GCC3_LD) $(TOOL_GCC3_LDFLAGS.dll) $(flags) -o $$@ \
    237                 $(if $(filter-out win32 os2, $(BUILD_TARGET)),$(call TOOL_GCC3_LD_SONAME,$(target),$(out))) \
    238                 $(objs) \
    239                 $(foreach p,$(libpath), -L$(p)) \
    240                 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
     192# @param    $(outbase)  Output basename (full). Use this for list files and such.
     193TOOL_GCC3_LINK_DLL_OUTPUT = $(outbase).map
     194TOOL_GCC3_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     195TOOL_GCC3_LINK_DLL_DEPORD =
     196define TOOL_GCC3_LINK_DLL_CMDS
     197        $(TOOL_GCC3_LD) $(TOOL_GCC3_LDFLAGS.dll) $(flags) -o $(out)\
     198                $(if $(filter-out win32 os2, $(BUILD_TARGET)),$(call TOOL_GCC3_LD_SONAME,$(target),$(out)))\
     199                $(objs)\
     200                $(foreach p,$(libpath), -L$(p))\
     201                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))\
    241202                $(call TOOL_GCC3_LD_MAP,$(outbase).map)
    242 ifneq ($(custom_post),)
    243         $(eval $(custom_post))
    244 endif
    245 _OUT_FILES += $(outbase).map
    246 
    247 endef
     203endef
     204
    248205
    249206## Link system module (windows aka driver, linux aka kernel module)
     
    259216# @param    $(custom_pre)   Custom step invoked before linking.
    260217# @param    $(custom_post)  Custom step invoked after linking.
    261 #
    262 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    263 define TOOL_GCC3_LINK_SYSMOD
    264 #$ (warning dbg: TOOL_GCC3_LINK_SYSMOD: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    265 $(out) $(outbase).map: $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    266         $(call MSG_L1,Creating Program $$@)
    267 ifneq ($(custom_pre),)
    268         $(eval $(custom_pre))
    269 endif
    270         $(RM) -f $$@
    271         $(TOOL_GCC3_LD_SYSMOD) $(TOOL_GCC3_LDFLAGS.sysmod) $(flags) -o $$@ $(objs) \
    272                 $(foreach p,$(libpath), -L$(p)) \
    273                 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
     218# @param    $(outbase)  Output basename (full). Use this for list files and such.
     219TOOL_GCC3_LINK_SYSMOD_OUTPUT = $(outbase).map
     220TOOL_GCC3_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     221TOOL_GCC3_LINK_SYSMOD_DEPORD =
     222define TOOL_GCC3_LINK_SYSMOD_CMDS
     223        $(TOOL_GCC3_LD_SYSMOD) $(TOOL_GCC3_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
     224                $(foreach p,$(libpath), -L$(p))\
     225                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))\
    274226                $(call TOOL_GCC3_LD_SYSMOD_MAP,$(outbase).map)
    275 ifneq ($(custom_post),)
    276         $(eval $(custom_post))
    277 endif
    278 _OUT_FILES += $(outbase).map
    279 
    280 endef
    281 
     227endef
     228
  • trunk/kBuild/tools/GCC3OMF.kmk

    r353 r380  
    8787# @param    $(outbase)  Output basename (full). Use this for list files and such.
    8888# @param    $(objsuff)  Object suffix.
    89 define TOOL_GCC3OMF_COMPILE_C
    90 #$ (warning dbg: TOOL_GCC3OMF_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    91 $(obj): $(deps) $(source) | $(dirdep)
    92         $(call MSG_L2,Compiling $$@ using GCC3)
     89TOOL_GCC3OMF_COMPILE_C_OUTPUT =
     90TOOL_GCC3OMF_COMPILE_C_DEPEND =
     91TOOL_GCC3OMF_COMPILE_C_DEPORD =
     92define TOOL_GCC3OMF_COMPILE_C_CMDS
    9393        $(TOOL_GCC3OMF_CC) -c\
    9494                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    95                 -Wp,-MD,$(dep) -Wp,-MT,$$@ -Wp,-MP \
    96                 -o $$@\
     95                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
     96                -o $(obj)\
    9797                $(call ABSPATH,$(source))
    98 
    9998endef
    10099
     
    113112# @param    $(outbase)  Output basename (full). Use this for list files and such.
    114113# @param    $(objsuff)  Object suffix.
    115 define TOOL_GCC3OMF_COMPILE_CXX
    116 #$ (warning dbg: TOOL_GCC3OMF_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    117 $(obj): $(deps) $(source) | $(dirdep)
    118         $(call MSG_L2,Compiling $$@ using GCC3)
     114TOOL_GCC3OMF_COMPILE_CXX_OUTPUT =
     115TOOL_GCC3OMF_COMPILE_CXX_DEPEND =
     116TOOL_GCC3OMF_COMPILE_CXX_DEPORD =
     117define TOOL_GCC3OMF_COMPILE_CXX_CMDS
    119118        $(TOOL_GCC3OMF_CXX) -c\
    120119                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    121                 -Wp,-MD,$(dep) -Wp,-MT,$$@ -Wp,-MP \
    122                 -o $$@\
     120                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \
     121                -o $(obj)\
    123122                $(call ABSPATH,$(source))
    124 
    125123endef
    126124
     
    128126## Link library
    129127# @param    $(target)   Normalized main target name.
    130 # @param    $(lib)              Library name.
     128# @param    $(out)              Library name.
    131129# @param    $(objs)     Object files to put in the library.
    132130# @param    $(flags)    Flags.
     
    136134#
    137135# @param    $(outbase)  Output basename (full). Use this for list files and such.
    138 define TOOL_GCC3OMF_LINK_LIBRARY
    139 #$ (warning dbg: TOOL_GCC3OMF_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    140 $(lib): $(deps) $(objs) $(filter %.a %.lib %.def %.imp,$(othersrc)) | $(dirdep)
    141         $(call MSG_L1,Creating Library $$@)
    142         $(RM) -f $$@
    143         $(if $(filter %.def %.imp,$(othersrc)),$(TOOL_GCC3OMF_AR_IMP) -o $$@ $(filter %.def %.imp,$(othersrc)),)
    144         $(TOOL_GCC3OMF_AR) $(flags) $$@ $(objs) $(filter %.a %.lib,$(othersrc))
    145 
     136TOOL_GCC3OMF_LINK_LIBRARY_OUTPUT =
     137TOOL_GCC3OMF_LINK_LIBRARY_DEPEND = $(filter %.a %.lib %.def %.imp,$(othersrc))
     138TOOL_GCC3OMF_LINK_LIBRARY_DEPORD =
     139define TOOL_GCC3OMF_LINK_LIBRARY_CMDS
     140        $(if $(filter %.def %.imp,$(othersrc)),$(TOOL_GCC3OMF_AR_IMP) -o $(out) $(filter %.def %.imp,$(othersrc)),)
     141        $(TOOL_GCC3OMF_AR) $(flags) $(out) $(objs) $(filter %.a %.lib,$(othersrc))
    146142endef
    147143
     
    161157#
    162158# @param    $(outbase)  Output basename (full). Use this for list files and such.
    163 define TOOL_GCC3OMF_LINK_PROGRAM
    164 #$ (warning dbg: TOOL_GCC3OMF_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    165 $(out) $(outbase).map: $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(filter %.def, $(othersrc)) | $(dirdep)
    166         $(call MSG_L1,Creating Program $$@)
    167 ifneq ($(custom_pre),)
    168         $(eval $(custom_pre))
    169 endif
    170         $(TOOL_GCC3OMF_LD) $(flags) -o $$@ $(objs) \
    171                 $(filter %.def, $(othersrc)) \
    172                 $(foreach p,$(libpath), -L$(p)) \
    173                 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
     159TOOL_GCC3OMF_LINK_PROGRAM_OUTPUT = $(outbase).map
     160TOOL_GCC3OMF_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     161        $(filter %.def, $(othersrc))
     162TOOL_GCC3OMF_LINK_PROGRAM_DEPORD =
     163define TOOL_GCC3OMF_LINK_PROGRAM_CMDS
     164        $(TOOL_GCC3OMF_LD) $(flags) -o $(out) $(objs)\
     165                $(filter %.def, $(othersrc))\
     166                $(foreach p,$(libpath), -L$(p))\
     167                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))\
    174168                $(call TOOL_GCC3_LD_MAP,$(outbase).map)
    175 ifneq ($(custom_post),)
    176         $(eval $(custom_post))
    177 endif
    178 _OUT_FILES += $(outbase).map
    179 
    180169endef
    181170
     
    195184#
    196185# @param    $(outbase)  Output basename (full). Use this for list files and such.
    197 define TOOL_GCC3OMF_LINK_DLL
    198 #$ (warning dbg: TOOL_GCC3OMF_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    199 $(out) $(outbase).map: $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(filter %.def, $(othersrc)) | $(dirdep)
    200         $(call MSG_L1,Creating Program $$@)
    201 ifneq ($(custom_pre),)
    202         $(eval $(custom_pre))
    203 endif
    204         $(TOOL_GCC3OMF_LD) $(TOOL_GCC3OMF_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
    205         $(filter %.def, $(othersrc)) \
    206         $(foreach p,$(libpath), -L$(p)) \
    207         $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
    208         $(call TOOL_GCC3_LD_MAP,$(outbase).map)
    209 ifneq ($(custom_post),)
    210         $(eval $(custom_post))
    211 endif
    212 _OUT_FILES += $(outbase).map
    213 
     186TOOL_GCC3OMF_LINK_DLL_OUTPUT = $(outbase).map
     187TOOL_GCC3OMF_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     188        $(filter %.def, $(othersrc))
     189TOOL_GCC3OMF_LINK_DLL_DEPORD =
     190define TOOL_GCC3OMF_LINK_DLL_CMDS
     191        $(TOOL_GCC3OMF_LD) $(TOOL_GCC3OMF_LDFLAGS.dll) $(flags) -o $(out) $(objs)\
     192                $(filter %.def, $(othersrc))\
     193                $(foreach p,$(libpath), -L$(p))\
     194                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))\
     195                $(call TOOL_GCC3_LD_MAP,$(outbase).map)
    214196endef
    215197
     
    228210#
    229211# @param    $(outbase)  Output basename (full). Use this for list files and such.
    230 define TOOL_GCC3OMF_LINK_SYSMOD
    231 #$ (warning dbg: TOOL_GCC3OMF_LINK_SYSMOD: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    232 $(out) $(outbase).map: $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(filter %.def, $(othersrc)) | $(dirdep)
    233         $(call MSG_L1,Creating Program $$@)
    234 ifneq ($(custom_pre),)
    235         $(eval $(custom_pre))
    236 endif
    237         $(TOOL_GCC3OMF_LD_SYSMOD) $(TOOL_GCC3OMF_LDFLAGS.sysmod) $(flags) -o $$@ $(objs) \
    238                 $(filter %.def, $(othersrc)) \
    239                 $(foreach p,$(libpath), -L$(p)) \
    240                 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \
     212TOOL_GCC3OMF_LINK_SYSMOD_OUTPUT = $(outbase).map
     213TOOL_GCC3OMF_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     214         $(filter %.def, $(othersrc))
     215TOOL_GCC3OMF_LINK_SYSMOD_DEPORD =
     216define TOOL_GCC3OMF_LINK_SYSMOD_CMDS
     217        $(TOOL_GCC3OMF_LD_SYSMOD) $(TOOL_GCC3OMF_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
     218                $(filter %.def, $(othersrc))\
     219                $(foreach p,$(libpath), -L$(p))\
     220                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))\
    241221                $(call TOOL_GCC3_LD_SYSMOD_MAP,$(outbase).map)
    242 ifneq ($(custom_post),)
    243         $(eval $(custom_post))
    244 endif
    245 _OUT_FILES += $(outbase).map
    246 
    247 endef
    248 
     222endef
     223
  • trunk/kBuild/tools/MINGW32.kmk

    r353 r380  
    106106# @param    $(dirdep)   Directory creation dependency.
    107107# @param    $(deps)             Other dependencies.
    108 #
    109108# @param    $(outbase)  Output basename (full). Use this for list files and such.
    110109# @param    $(objsuff)  Object suffix.
    111 define TOOL_MINGW32_COMPILE_C
    112 #$ (warning dbg: TOOL_MINGW32_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    113 $(obj): $(deps) $(source) | $(dirdep)
    114         $(call MSG_L2,Compiling $$@ using MINGW32)
     110TOOL_MINGW32_COMPILE_C_OUTPUT =
     111TOOL_MINGW32_COMPILE_C_DEPEND =
     112TOOL_MINGW32_COMPILE_C_DEPORD =
     113define TOOL_MINGW32_COMPILE_C_CMDS
    115114        $(TOOL_MINGW32_CC) -c\
    116115                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    117                 -Wp,-MD,$(dep) -Wp,-MT,$$@ \
    118                 -o $$@\
     116                -Wp,-MD,$(dep) -Wp,-MT,$(obj)\
     117                -o $(obj)\
    119118                $(call ABSPATH,$(source))
    120 
    121119endef
    122120
     
    132130# @param    $(dirdep)   Directory creation dependency.
    133131# @param    $(deps)     Other dependencies.
    134 #
    135132# @param    $(outbase)  Output basename (full). Use this for list files and such.
    136133# @param    $(objsuff)  Object suffix.
    137 define TOOL_MINGW32_COMPILE_CXX
    138 #$ (warning dbg: TOOL_MINGW32_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    139 $(obj): $(deps) $(source) | $(dirdep)
    140         $(call MSG_L2,Compiling $$@ using MINGW32)
     134TOOL_MINGW32_COMPILE_CXX_OUTPUT =
     135TOOL_MINGW32_COMPILE_CXX_DEPEND =
     136TOOL_MINGW32_COMPILE_CXX_DEPORD =
     137define TOOL_MINGW32_COMPILE_CXX_CMDS
    141138        $(TOOL_MINGW32_CXX) -c\
    142139                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    143                 -Wp,-MD,$(dep) -Wp,-MT,$$@ \
    144                 -o $$@\
     140                -Wp,-MD,$(dep) -Wp,-MT,$(obj)\
     141                -o $(obj)\
    145142                $(call ABSPATH,$(source))
    146 
    147143endef
    148144
     
    157153#
    158154# @param    $(outbase)  Output basename (full). Use this for list files and such.
    159 define TOOL_MINGW32_LINK_LIBRARY
    160 #$ (warning dbg: TOOL_MINGW32_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
    161 $(lib): $(deps) $(objs) | $(dirdep)
    162         $(call MSG_L1,Creating Library $$@)
    163         $(RM) -f $$@
    164         $(TOOL_MINGW32_AR) $(flags) $$@ $(objs)
    165 
     155TOOL_MINGW32_LINK_LIBRARY_OUTPUT = $(lib).ar-script
     156TOOL_MINGW32_LINK_LIBRARY_DEPEND = $(filter %.a %.lib,$(othersrc))
     157TOOL_MINGW32_LINK_LIBRARY_DEPORD =
     158define TOOL_MINGW32_LINK_LIBRARY_CMDS
     159        $(APPEND) $(lib).ar-script "CREATE $(out)"
     160        $(foreach o, $(objs)\
     161                ,$(NL)$(TAB)$(APPEND) $(lib).ar-script "ADDMOD $(o)")
     162        $(foreach srclib, $(filter %.a %.lib,$(othersrc))\
     163                ,$(NL)$(TAB)$(APPEND) $(lib).ar-script "ADDLIB $(srclib)")
     164        $(APPEND) $(lib).ar-script "SAVE"
     165        $(APPEND) $(lib).ar-script "END"
     166        $(TOOL_MINGW32_AR) -M < $(lib).ar-script
    166167endef
    167168
     
    181182#
    182183# @param    $(outbase)  Output basename (full). Use this for list files and such.
    183 define TOOL_MINGW32_LINK_PROGRAM
    184 #$ (warning dbg: TOOL_MINGW32_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
    185 $(out): $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    186         $(call MSG_L1,Creating Program $$@)
    187 ifneq ($(custom_pre),)
    188         $(eval $(custom_pre))
    189 endif
    190         $(TOOL_MINGW32_LD) $(flags) -o $$@ $(objs) \
    191         $(foreach p,$(libpath), -L$(p)) \
    192         $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
    193 ifneq ($(custom_post),)
    194         $(eval $(custom_post))
    195 endif
    196 
     184TOOL_MINGW32_LINK_PROGRAM_OUTPUT =
     185TOOL_MINGW32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     186TOOL_MINGW32_LINK_PROGRAM_DEPORD =
     187define TOOL_MINGW32_LINK_PROGRAM_CMDS
     188        $(TOOL_MINGW32_LD) $(flags) -o $(out) $(objs)\
     189                $(foreach p,$(libpath), -L$(p))\
     190                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
    197191endef
    198192
     
    210204# @param    $(custom_pre)   Custom step invoked before linking.
    211205# @param    $(custom_post)  Custom step invoked after linking.
    212 #
    213 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    214 define TOOL_MINGW32_LINK_DLL
    215 #$ (warning dbg: TOOL_MINGW32_LINK_DLL: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    216 $(out) $(outbase).a $(outbase).exp: \
    217                 $(deps) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | $(dirdep)
    218         $(call MSG_L1,Creating Program $$@)
    219 ifneq ($(custom_pre),)
    220         $(eval $(custom_pre))
    221 endif
    222         $(TOOL_MINGW32_DLLWRAP) $(flags) \
    223                 --dllname=$(out) \
    224                 --output-exp=$(outbase).exp \
    225                 --output-lib=$(outbase).a \
    226                 $(foreach def,$(filter %.def,$(othersrc)), --def $(def)) \
    227                 $(filter %.res,$(othersrc)) \
    228                 $(objs) \
    229                 $(foreach p,$(libpath), -L$(p)) \
     206# @param    $(outbase)  Output basename (full). Use this for list files and such.
     207TOOL_MINGW32_LINK_DLL_OUTPUT = $(outbase).a $(outbase).exp
     208TOOL_MINGW32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     209        $(filter %.def %.res,$(othersrc))
     210TOOL_MINGW32_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
     211define TOOL_MINGW32_LINK_DLL_CMDS
     212        $(TOOL_MINGW32_DLLWRAP) $(flags)\
     213                --dllname=$(out)\
     214                --output-exp=$(outbase).exp\
     215                --output-lib=$(outbase).a\
     216                $(foreach def,$(filter %.def,$(othersrc)), --def $(def))\
     217                $(filter %.res,$(othersrc))\
     218                $(objs)\
     219                $(foreach p,$(libpath), -L$(p))\
    230220                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
    231 ifeq ($(filter %.exp .def,$(othersrc)),)
    232221        $(CP) $(outbase).exp $(outbase).a $(PATH_LIB)/
    233 endif
    234 ifneq ($(custom_post),)
    235         $(eval $(custom_post))
    236 endif
    237 _OUT_FILES += $(outbase).a $(outbase).exp
    238 
    239 endef
    240 
     222endef
     223## @todo seperate install stuff!
  • trunk/kBuild/tools/NASM.kmk

    r353 r380  
    5252# @param    $(dirdep)   Directory creation dependency.
    5353# @param    $(deps)     Other dependencies.
    54 #
    5554# @param    $(outbase)  Output basename (full). Use this for list files and such.
    5655# @param    $(objsuff)  Object suffix.
    57 define TOOL_NASM_COMPILE_AS
    58 #$ (warning dbg: TOOL_NASM_COMPILE_AS: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
    59 $(obj) $(outbase).lst: $(deps) $(source) | $(dirdep)
    60         $(call MSG_L2,Compiling $$@ using NASM)
    61         $(TOOL_NASM_AS) \
     56#
     57TOOL_NASM_COMPILE_AS_OUTPUT = $(outbase).lst
     58TOOL_NASM_COMPILE_AS_DEPEND =
     59TOOL_NASM_COMPILE_AS_DEPORD =
     60define TOOL_NASM_COMPILE_AS_CMDS
     61        $(TOOL_NASM_AS)\
    6262                $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
    63                 -l $(outbase).lst \
    64                 -o $(obj) \
     63                -l $(outbase).lst\
     64                -o $(obj)\
    6565                $(call ABSPATH,$(source))
    66 _OUT_FILES += $(outbase).lst
    67 
    6866endef
    6967
  • trunk/kBuild/tools/VCC70.kmk

    r353 r380  
    8282# @param    $(outbase)  Output basename (full). Use this for list files and such.
    8383# @param    $(objsuff)  Object suffix.
    84 define TOOL_VCC70_COMPILE_C
    85 #$ (warning dbg: TOOL_VCC70_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
    86 $(obj) $(call TOOL_VCC70_PDB, $(outbase)-obj): $(deps) $(source) | $(dirdep)
    87         $(call MSG_L2,Compiling $$@ using VCC70)
     84TOOL_VCC70_COMPILE_C_OUTPUT     = $(call TOOL_VCC70_PDB, $(outbase)-obj)
     85TOOL_VCC70_COMPILE_C_DEPEND     =
     86TOOL_VCC70_COMPILE_C_DEPORD =
     87define TOOL_VCC70_COMPILE_C_CMDS
    8888        $(TOOL_VCC70_CC) -c\
    8989                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
     
    9595                $(subst /,\\,$(call ABSPATH,$(source)))\
    9696                | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
    97 _OUT_FILES += $(call TOOL_VCC70_PDB, $(outbase)-obj)
    98 
    9997endef
    10098
     
    113111# @param    $(outbase)  Output basename (full). Use this for list files and such.
    114112# @param    $(objsuff)  Object suffix.
    115 define TOOL_VCC70_COMPILE_CXX
    116 #$ (warning dbg: TOOL_VCC70_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
    117 $(obj) $(call TOOL_VCC70_PDB, $(outbase)-obj): $(deps) $(source) | $(dirdep)
    118         $(call MSG_L2,Compiling $$@ using VCC70)
     113TOOL_VCC70_COMPILE_CXX_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj)
     114TOOL_VCC70_COMPILE_CXX_DEPEND =
     115TOOL_VCC70_COMPILE_CXX_DEPORD =
     116define TOOL_VCC70_COMPILE_CXX_CMDS
    119117        $(TOOL_VCC70_CXX) -c\
    120118                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
     
    126124                $(subst /,\\,$(call ABSPATH,$(source)))\
    127125                | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
    128 _OUT_FILES += $(call TOOL_VCC70_PDB, $(outbase)-obj)
    129 
    130126endef
    131127
     
    133129## Link library
    134130# @param    $(target)   Normalized main target name.
    135 # @param    $(lib)              Library name.
     131# @param    $(out)      Library name.
    136132# @param    $(objs)     Object files to put in the library.
    137133# @param    $(flags)    Flags.
    138134# @param    $(dirdep)   Directory creation dependency.
    139 # @param    $(deps)             Other dependencies.
     135# @param    $(deps)     Other dependencies.
    140136# @param    $(othersrc) Unhandled sources.
    141 #
    142 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    143 define TOOL_VCC70_LINK_LIBRARY
    144 #$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
    145 $(lib) $(outbase).lst $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)): $(deps) $(objs) $(othersrc) | $(dirdep)
    146         $(call MSG_L1,Creating Library $$@)
    147         $(RM) -f $$@
    148         $(TOOL_VCC70_AR) $(flags) /OUT:$(lib) $(subst /,\\,$(objs) $(filter %.a %.lib,$(othersrc))) \
     137# @param    $(outbase)  Output basename (full). Use this for list files and such.
     138#
     139TOOL_VCC70_LINK_LIBRARY_OUTPUT = $(outbase).lst $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase))
     140TOOL_VCC70_LINK_LIBRARY_DEPEND = $(othersrc)
     141TOOL_VCC70_LINK_LIBRARY_DEPORD =
     142define TOOL_VCC70_LINK_LIBRARY_CMDS
     143        $(TOOL_VCC70_AR) $(flags) /OUT:$(out) $(subst /,\\,$(objs) $(filter %.a %.lib,$(othersrc))) \
    149144                $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
    150 _OUT_FILES += $(outbase).lst $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase))
    151 
    152145endef
    153146
     
    165158# @param    $(custom_pre)   Custom step invoked before linking.
    166159# @param    $(custom_post)  Custom step invoked after linking.
    167 #
    168 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    169 define TOOL_VCC70_LINK_PROGRAM
    170 #$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    171 $(out) $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk: \
    172                 $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) | $(dirdep)
    173         $(call MSG_L1,Creating Program $$@)
    174 ifneq ($(custom_pre),)
    175         $(eval $(custom_pre))
    176 endif
     160# @param    $(outbase)      Output basename (full). Use this for list files and such.
     161#
     162TOOL_VCC70_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk
     163TOOL_VCC70_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
     164TOOL_VCC70_LINK_PROGRAM_DEPORD =
     165define TOOL_VCC70_LINK_PROGRAM_CMDS
    177166        $(TOOL_VCC70_LD) $(flags) \
    178167                /OUT:$(out) \
     
    184173                $(subst /,\\,$(objs)) \
    185174                $(subst /,\\,$(libs))
    186 ifneq ($(custom_post),)
    187         $(eval $(custom_post))
    188 endif
    189 _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk
    190 
    191 endef
    192 
    193 
    194 ## Link system module (windows aka driver, linux aka kernel module)
    195 # @param    $(target)       Normalized main target name.
    196 # @param    $(out)          System module name.
    197 # @param    $(objs)         Object files to link together.
    198 # @param    $(libs)         Libraries to search.
    199 # @param    $(libpath)      Library search paths.
    200 # @param    $(flags)        Flags.
    201 # @param    $(dirdep)       Directory creation dependency.
    202 # @param    $(deps)         Other dependencies.
    203 # @param    $(othersrc)     Unhandled sources.
    204 # @param    $(custom_pre)   Custom step invoked before linking.
    205 # @param    $(custom_post)  Custom step invoked after linking.
    206 #
    207 # @param    $(outbase)  Output basename (full). Use this for list files and such.
    208 define TOOL_VCC70_LINK_SYSMOD
    209 #$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    210 $(out) $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk: \
    211                 $(deps) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) | $(dirdep)
    212         $(call MSG_L1,Creating Program $$@)
    213 ifneq ($(custom_pre),)
    214         $(eval $(custom_pre))
    215 endif
    216         $(TOOL_VCC70_LD) $(flags) \
    217                 /OUT:$(out) \
    218                 /MAPINFO:EXPORTS /MAPINFO:LINES \
    219                 /MAP:$(outbase).map \
    220                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
    221                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
    222                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
    223                 $(subst /,\\,$(objs)) \
    224                 $(subst /,\\,$(libs))
    225 ifneq ($(custom_post),)
    226         $(eval $(custom_post))
    227 endif
    228 _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk
    229 
    230175endef
    231176
     
    245190#
    246191# @param    $(outbase)  Output basename (full). Use this for list files and such.
    247 define TOOL_VCC70_LINK_DLL
    248 #$ (warning dbg: TOOL_VCC70_LINK_DLL: target=$(target) out=$(out) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    249 $(out) $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk: \
    250                 $(deps) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) | $(dirdep)
    251         $(call MSG_L1,Creating Program $$@)
    252 ifneq ($(custom_pre),)
    253         $(eval $(custom_pre))
    254 endif
     192TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk
     193TOOL_VCC70_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
     194TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
     195define TOOL_VCC70_LINK_DLL_CMDS
    255196        $(TOOL_VCC70_LD) $(flags) \
    256197                /OUT:$(out) \
     
    268209        if test -f $(outbase).lib; then $(CP_EXT) $(outbase).lib $(PATH_LIB)/; fi
    269210endif
    270 ifneq ($(custom_post),)
    271         $(eval $(custom_post))
    272 endif
    273 _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk
    274 _DIRS += $(PATH_LIB)
    275 
    276 endef
    277 
     211$(eval _DIRS += $(PATH_LIB))
     212endef
     213
     214
     215## Link system module (windows aka driver, linux aka kernel module)
     216# @param    $(target)       Normalized main target name.
     217# @param    $(out)          System module name.
     218# @param    $(objs)         Object files to link together.
     219# @param    $(libs)         Libraries to search.
     220# @param    $(libpath)      Library search paths.
     221# @param    $(flags)        Flags.
     222# @param    $(dirdep)       Directory creation dependency.
     223# @param    $(deps)         Other dependencies.
     224# @param    $(othersrc)     Unhandled sources.
     225# @param    $(custom_pre)   Custom step invoked before linking.
     226# @param    $(custom_post)  Custom step invoked after linking.
     227#
     228# @param    $(outbase)  Output basename (full). Use this for list files and such.
     229TOOL_VCC70_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk
     230TOOL_VCC70_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
     231TOOL_VCC70_LINK_SYSMOD_DEPORD =
     232define TOOL_VCC70_LINK_SYSMOD_CMDS
     233        $(TOOL_VCC70_LD) $(flags) \
     234                /OUT:$(out) \
     235                /MAPINFO:EXPORTS /MAPINFO:LINES \
     236                /MAP:$(outbase).map \
     237                $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
     238                $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
     239                $(foreach p,$(libpath), /LIBPATH:$(p)) \
     240                $(subst /,\\,$(objs)) \
     241                $(subst /,\\,$(libs))
     242endef
     243
Note: See TracChangeset for help on using the changeset viewer.