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

Big command dependency job. More installation stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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!
Note: See TracChangeset for help on using the changeset viewer.