Changeset 380 for trunk/kBuild/tools


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/tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • 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.