Changeset 380 for trunk/kBuild/tools
- Timestamp:
- Dec 18, 2005, 2:52:47 PM (20 years ago)
- Location:
- trunk/kBuild/tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/tools/ALP.kmk
r353 r380 55 55 # @param $(outbase) Output basename (full). Use this for list files and such. 56 56 # @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) 57 TOOL_ALP_COMPILE_AS_OUTPUT = $(outbase).lst 58 TOOL_ALP_COMPILE_AS_DEPEND = 59 TOOL_ALP_COMPILE_AS_DEPORD = 60 define TOOL_ALP_COMPILE_AS_CMDS 61 $(TOOL_ALP_AS)\ 62 62 $(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)\ 66 66 -Fo:$(obj) 67 _OUT_FILES += $(outbase).lst68 69 67 endef 70 68 -
trunk/kBuild/tools/GCC.kmk
r353 r380 76 76 # @param $(dirdep) Directory creation dependency. 77 77 # @param $(deps) Other dependencies. 78 #79 78 # @param $(outbase) Output basename (full). Use this for list files and such. 80 79 # @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 # 81 TOOL_GCC_COMPILE_C_OUTPUT = 82 TOOL_GCC_COMPILE_C_DEPEND = 83 TOOL_GCC_COMPILE_C_DEPORD = 84 define TOOL_GCC_COMPILE_C_CMDS 85 85 $(TOOL_GCC_CC) -c\ 86 86 $(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)\ 89 89 $(call ABSPATH,$(source)) 90 91 90 endef 92 91 … … 105 104 # @param $(outbase) Output basename (full). Use this for list files and such. 106 105 # @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) 106 TOOL_GCC_COMPILE_CXX_OUTPUT = 107 TOOL_GCC_COMPILE_CXX_DEPEND = 108 TOOL_GCC_COMPILE_CXX_DEPORD = 109 define TOOL_GCC_COMPILE_CXX_CMDS 111 110 $(TOOL_GCC_CXX) -c\ 112 111 $(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)\ 115 114 $(call ABSPATH,$(source)) 116 117 115 endef 118 116 … … 120 118 ## Link library 121 119 # @param $(target) Normalized main target name. 122 # @param $( lib)Library name.120 # @param $(out) Library name. 123 121 # @param $(objs) Object files to put in the library. 124 122 # @param $(flags) Flags. … … 127 125 # 128 126 # @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 127 TOOL_GCC_LINK_LIBRARY_OUTPUT = 128 TOOL_GCC_LINK_LIBRARY_DEPEND = 129 TOOL_GCC_LINK_LIBRARY_DEPORD = 130 define TOOL_GCC_LINK_LIBRARY_CMDS 131 $(TOOL_GCC_AR) $(flags) $(out) $(objs) 136 132 endef 137 133 … … 151 147 # 152 148 # @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 149 TOOL_GCC_LINK_PROGRAM_OUTPUT = 150 TOOL_GCC_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 151 TOOL_GCC_LINK_PROGRAM_DEPORD = 152 define 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))) 166 155 endef 167 156 … … 179 168 # @param $(custom_pre) Custom step invoked before linking. 180 169 # @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. 171 TOOL_GCC_LINK_DLL_OUTPUT = 172 TOOL_GCC_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 173 TOOL_GCC_LINK_DLL_DEPORD = 174 define TOOL_GCC_LINK_DLL_CMDS 175 $(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $(out) $(objs) \ 191 176 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) 192 ifneq ($(custom_post),)193 $(eval $(custom_post))194 endif195 196 177 endef 197 178 -
trunk/kBuild/tools/GCC3.kmk
r353 r380 94 94 # @param $(outbase) Output basename (full). Use this for list files and such. 95 95 # @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) 96 TOOL_GCC3_COMPILE_C_OUTPUT = 97 TOOL_GCC3_COMPILE_C_DEPEND = 98 TOOL_GCC3_COMPILE_C_DEPORD = 99 define TOOL_GCC3_COMPILE_C_CMDS 100 100 $(TOOL_GCC3_CC) -c\ 101 101 $(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)\ 104 104 $(call ABSPATH,$(source)) 105 106 105 endef 107 106 … … 117 116 # @param $(dirdep) Directory creation dependency. 118 117 # @param $(deps) Other dependencies. 119 #120 118 # @param $(outbase) Output basename (full). Use this for list files and such. 121 119 # @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) 120 TOOL_GCC3_COMPILE_CXX_OUTPUT = 121 TOOL_GCC3_COMPILE_CXX_DEPEND = 122 TOOL_GCC3_COMPILE_CXX_DEPORD = 123 define TOOL_GCC3_COMPILE_CXX_CMDS 126 124 $(TOOL_GCC3_CXX) -c\ 127 125 $(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)\ 130 128 $(call ABSPATH,$(source)) 131 132 129 endef 133 130 … … 135 132 ## Link library 136 133 # @param $(target) Normalized main target name. 137 # @param $( lib) Library name.134 # @param $(out) Library name. 138 135 # @param $(objs) Object files to put in the library. 139 136 # @param $(flags) Flags. … … 141 138 # @param $(deps) Other dependencies. 142 139 # @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. 141 TOOL_GCC3_LINK_LIBRARY_OUTPUT = $(out).ar-script 142 TOOL_GCC3_LINK_LIBRARY_DEPEND = $(filter %.a %.lib,$(othersrc)) 143 TOOL_GCC3_LINK_LIBRARY_DEPORD = 144 define 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 177 153 endef 178 154 … … 190 166 # @param $(custom_pre) Custom step invoked before linking. 191 167 # @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. 169 TOOL_GCC3_LINK_PROGRAM_OUTPUT = $(outbase).map 170 TOOL_GCC3_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 171 TOOL_GCC3_LINK_PROGRAM_DEPORD = 172 define 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)))\ 205 176 $(call TOOL_GCC3_LD_MAP,$(outbase).map) 206 ifneq ($(custom_post),)207 $(eval $(custom_post))208 endif209 _OUT_FILES += $(outbase).map210 211 177 endef 212 178 … … 224 190 # @param $(custom_pre) Custom step invoked before linking. 225 191 # @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. 193 TOOL_GCC3_LINK_DLL_OUTPUT = $(outbase).map 194 TOOL_GCC3_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 195 TOOL_GCC3_LINK_DLL_DEPORD = 196 define 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)))\ 241 202 $(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 203 endef 204 248 205 249 206 ## Link system module (windows aka driver, linux aka kernel module) … … 259 216 # @param $(custom_pre) Custom step invoked before linking. 260 217 # @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. 219 TOOL_GCC3_LINK_SYSMOD_OUTPUT = $(outbase).map 220 TOOL_GCC3_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 221 TOOL_GCC3_LINK_SYSMOD_DEPORD = 222 define 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)))\ 274 226 $(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 227 endef 228 -
trunk/kBuild/tools/GCC3OMF.kmk
r353 r380 87 87 # @param $(outbase) Output basename (full). Use this for list files and such. 88 88 # @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) 89 TOOL_GCC3OMF_COMPILE_C_OUTPUT = 90 TOOL_GCC3OMF_COMPILE_C_DEPEND = 91 TOOL_GCC3OMF_COMPILE_C_DEPORD = 92 define TOOL_GCC3OMF_COMPILE_C_CMDS 93 93 $(TOOL_GCC3OMF_CC) -c\ 94 94 $(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)\ 97 97 $(call ABSPATH,$(source)) 98 99 98 endef 100 99 … … 113 112 # @param $(outbase) Output basename (full). Use this for list files and such. 114 113 # @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) 114 TOOL_GCC3OMF_COMPILE_CXX_OUTPUT = 115 TOOL_GCC3OMF_COMPILE_CXX_DEPEND = 116 TOOL_GCC3OMF_COMPILE_CXX_DEPORD = 117 define TOOL_GCC3OMF_COMPILE_CXX_CMDS 119 118 $(TOOL_GCC3OMF_CXX) -c\ 120 119 $(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)\ 123 122 $(call ABSPATH,$(source)) 124 125 123 endef 126 124 … … 128 126 ## Link library 129 127 # @param $(target) Normalized main target name. 130 # @param $( lib) Library name.128 # @param $(out) Library name. 131 129 # @param $(objs) Object files to put in the library. 132 130 # @param $(flags) Flags. … … 136 134 # 137 135 # @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 136 TOOL_GCC3OMF_LINK_LIBRARY_OUTPUT = 137 TOOL_GCC3OMF_LINK_LIBRARY_DEPEND = $(filter %.a %.lib %.def %.imp,$(othersrc)) 138 TOOL_GCC3OMF_LINK_LIBRARY_DEPORD = 139 define 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)) 146 142 endef 147 143 … … 161 157 # 162 158 # @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))) \ 159 TOOL_GCC3OMF_LINK_PROGRAM_OUTPUT = $(outbase).map 160 TOOL_GCC3OMF_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 161 $(filter %.def, $(othersrc)) 162 TOOL_GCC3OMF_LINK_PROGRAM_DEPORD = 163 define 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)))\ 174 168 $(call TOOL_GCC3_LD_MAP,$(outbase).map) 175 ifneq ($(custom_post),)176 $(eval $(custom_post))177 endif178 _OUT_FILES += $(outbase).map179 180 169 endef 181 170 … … 195 184 # 196 185 # @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 186 TOOL_GCC3OMF_LINK_DLL_OUTPUT = $(outbase).map 187 TOOL_GCC3OMF_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 188 $(filter %.def, $(othersrc)) 189 TOOL_GCC3OMF_LINK_DLL_DEPORD = 190 define 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) 214 196 endef 215 197 … … 228 210 # 229 211 # @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))) \ 212 TOOL_GCC3OMF_LINK_SYSMOD_OUTPUT = $(outbase).map 213 TOOL_GCC3OMF_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 214 $(filter %.def, $(othersrc)) 215 TOOL_GCC3OMF_LINK_SYSMOD_DEPORD = 216 define 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)))\ 241 221 $(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 222 endef 223 -
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! -
trunk/kBuild/tools/NASM.kmk
r353 r380 52 52 # @param $(dirdep) Directory creation dependency. 53 53 # @param $(deps) Other dependencies. 54 #55 54 # @param $(outbase) Output basename (full). Use this for list files and such. 56 55 # @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 # 57 TOOL_NASM_COMPILE_AS_OUTPUT = $(outbase).lst 58 TOOL_NASM_COMPILE_AS_DEPEND = 59 TOOL_NASM_COMPILE_AS_DEPORD = 60 define TOOL_NASM_COMPILE_AS_CMDS 61 $(TOOL_NASM_AS)\ 62 62 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\ 63 -l $(outbase).lst 64 -o $(obj) 63 -l $(outbase).lst\ 64 -o $(obj)\ 65 65 $(call ABSPATH,$(source)) 66 _OUT_FILES += $(outbase).lst67 68 66 endef 69 67 -
trunk/kBuild/tools/VCC70.kmk
r353 r380 82 82 # @param $(outbase) Output basename (full). Use this for list files and such. 83 83 # @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) 84 TOOL_VCC70_COMPILE_C_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj) 85 TOOL_VCC70_COMPILE_C_DEPEND = 86 TOOL_VCC70_COMPILE_C_DEPORD = 87 define TOOL_VCC70_COMPILE_C_CMDS 88 88 $(TOOL_VCC70_CC) -c\ 89 89 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ … … 95 95 $(subst /,\\,$(call ABSPATH,$(source)))\ 96 96 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) - 97 _OUT_FILES += $(call TOOL_VCC70_PDB, $(outbase)-obj)98 99 97 endef 100 98 … … 113 111 # @param $(outbase) Output basename (full). Use this for list files and such. 114 112 # @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) 113 TOOL_VCC70_COMPILE_CXX_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj) 114 TOOL_VCC70_COMPILE_CXX_DEPEND = 115 TOOL_VCC70_COMPILE_CXX_DEPORD = 116 define TOOL_VCC70_COMPILE_CXX_CMDS 119 117 $(TOOL_VCC70_CXX) -c\ 120 118 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ … … 126 124 $(subst /,\\,$(call ABSPATH,$(source)))\ 127 125 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) - 128 _OUT_FILES += $(call TOOL_VCC70_PDB, $(outbase)-obj)129 130 126 endef 131 127 … … 133 129 ## Link library 134 130 # @param $(target) Normalized main target name. 135 # @param $( lib)Library name.131 # @param $(out) Library name. 136 132 # @param $(objs) Object files to put in the library. 137 133 # @param $(flags) Flags. 138 134 # @param $(dirdep) Directory creation dependency. 139 # @param $(deps) 135 # @param $(deps) Other dependencies. 140 136 # @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 # 139 TOOL_VCC70_LINK_LIBRARY_OUTPUT = $(outbase).lst $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) 140 TOOL_VCC70_LINK_LIBRARY_DEPEND = $(othersrc) 141 TOOL_VCC70_LINK_LIBRARY_DEPORD = 142 define TOOL_VCC70_LINK_LIBRARY_CMDS 143 $(TOOL_VCC70_AR) $(flags) /OUT:$(out) $(subst /,\\,$(objs) $(filter %.a %.lib,$(othersrc))) \ 149 144 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) 150 _OUT_FILES += $(outbase).lst $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase))151 152 145 endef 153 146 … … 165 158 # @param $(custom_pre) Custom step invoked before linking. 166 159 # @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 # 162 TOOL_VCC70_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk 163 TOOL_VCC70_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) 164 TOOL_VCC70_LINK_PROGRAM_DEPORD = 165 define TOOL_VCC70_LINK_PROGRAM_CMDS 177 166 $(TOOL_VCC70_LD) $(flags) \ 178 167 /OUT:$(out) \ … … 184 173 $(subst /,\\,$(objs)) \ 185 174 $(subst /,\\,$(libs)) 186 ifneq ($(custom_post),)187 $(eval $(custom_post))188 endif189 _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk190 191 endef192 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_SYSMOD209 #$ (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 endif216 $(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 endif228 _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk229 230 175 endef 231 176 … … 245 190 # 246 191 # @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 192 TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk 193 TOOL_VCC70_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) 194 TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB)) 195 define TOOL_VCC70_LINK_DLL_CMDS 255 196 $(TOOL_VCC70_LD) $(flags) \ 256 197 /OUT:$(out) \ … … 268 209 if test -f $(outbase).lib; then $(CP_EXT) $(outbase).lib $(PATH_LIB)/; fi 269 210 endif 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)) 212 endef 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. 229 TOOL_VCC70_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase)) $(outbase).ilk 230 TOOL_VCC70_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) 231 TOOL_VCC70_LINK_SYSMOD_DEPORD = 232 define 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)) 242 endef 243
Note:
See TracChangeset
for help on using the changeset viewer.