Changeset 380 for trunk/kBuild/tools/MINGW32.kmk
- Timestamp:
- Dec 18, 2005, 2:52:47 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/tools/MINGW32.kmk
r353 r380 106 106 # @param $(dirdep) Directory creation dependency. 107 107 # @param $(deps) Other dependencies. 108 #109 108 # @param $(outbase) Output basename (full). Use this for list files and such. 110 109 # @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) 110 TOOL_MINGW32_COMPILE_C_OUTPUT = 111 TOOL_MINGW32_COMPILE_C_DEPEND = 112 TOOL_MINGW32_COMPILE_C_DEPORD = 113 define TOOL_MINGW32_COMPILE_C_CMDS 115 114 $(TOOL_MINGW32_CC) -c\ 116 115 $(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)\ 119 118 $(call ABSPATH,$(source)) 120 121 119 endef 122 120 … … 132 130 # @param $(dirdep) Directory creation dependency. 133 131 # @param $(deps) Other dependencies. 134 #135 132 # @param $(outbase) Output basename (full). Use this for list files and such. 136 133 # @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) 134 TOOL_MINGW32_COMPILE_CXX_OUTPUT = 135 TOOL_MINGW32_COMPILE_CXX_DEPEND = 136 TOOL_MINGW32_COMPILE_CXX_DEPORD = 137 define TOOL_MINGW32_COMPILE_CXX_CMDS 141 138 $(TOOL_MINGW32_CXX) -c\ 142 139 $(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)\ 145 142 $(call ABSPATH,$(source)) 146 147 143 endef 148 144 … … 157 153 # 158 154 # @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 155 TOOL_MINGW32_LINK_LIBRARY_OUTPUT = $(lib).ar-script 156 TOOL_MINGW32_LINK_LIBRARY_DEPEND = $(filter %.a %.lib,$(othersrc)) 157 TOOL_MINGW32_LINK_LIBRARY_DEPORD = 158 define 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 166 167 endef 167 168 … … 181 182 # 182 183 # @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 184 TOOL_MINGW32_LINK_PROGRAM_OUTPUT = 185 TOOL_MINGW32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 186 TOOL_MINGW32_LINK_PROGRAM_DEPORD = 187 define 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))) 197 191 endef 198 192 … … 210 204 # @param $(custom_pre) Custom step invoked before linking. 211 205 # @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. 207 TOOL_MINGW32_LINK_DLL_OUTPUT = $(outbase).a $(outbase).exp 208 TOOL_MINGW32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 209 $(filter %.def %.res,$(othersrc)) 210 TOOL_MINGW32_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB)) 211 define 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))\ 230 220 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) 231 ifeq ($(filter %.exp .def,$(othersrc)),)232 221 $(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 222 endef 223 ## @todo seperate install stuff!
Note:
See TracChangeset
for help on using the changeset viewer.