| 1 | # $Id: VCC100X86.kmk 2625 2012-08-07 20:26:48Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
|
|---|
| 4 | #
|
|---|
| 5 |
|
|---|
| 6 | #
|
|---|
| 7 | # Copyright (c) 2004-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
|
|---|
| 8 | #
|
|---|
| 9 | # This file is part of kBuild.
|
|---|
| 10 | #
|
|---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
|---|
| 12 | # it under the terms of the GNU General Public License as published by
|
|---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
|---|
| 14 | # (at your option) any later version.
|
|---|
| 15 | #
|
|---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | # GNU General Public License for more details.
|
|---|
| 20 | #
|
|---|
| 21 | # You should have received a copy of the GNU General Public License
|
|---|
| 22 | # along with kBuild; if not, write to the Free Software
|
|---|
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 24 | #
|
|---|
| 25 | #
|
|---|
| 26 | # As a special exception you are granted permission to include this file, via
|
|---|
| 27 | # the kmk include directive, as you wish without this in itself causing the
|
|---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
|---|
| 29 | # This exception does not however invalidate any other reasons why the makefile,
|
|---|
| 30 | # program, whatever should not be covered the GPL.
|
|---|
| 31 | #
|
|---|
| 32 | #
|
|---|
| 33 |
|
|---|
| 34 | TOOL_VCC100X86 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
|
|---|
| 35 |
|
|---|
| 36 | # Tool Specific Properties
|
|---|
| 37 | ifndef PATH_TOOL_VCC100X86
|
|---|
| 38 | PATH_TOOL_VCC100X86 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v10*)
|
|---|
| 39 | ifeq ($(PATH_TOOL_VCC100X86),)
|
|---|
| 40 | PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100)
|
|---|
| 41 | endif
|
|---|
| 42 | ifeq ($(PATH_TOOL_VCC100X86),)
|
|---|
| 43 | PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100AMD64)
|
|---|
| 44 | endif
|
|---|
| 45 | ifeq ($(PATH_TOOL_VCC100X86),)
|
|---|
| 46 | PATH_TOOL_VCC100X86 := $(wildcard $(PATH_DEVTOOLS)/x86.win32/vcc/v10*)
|
|---|
| 47 | endif
|
|---|
| 48 | ifeq ($(PATH_TOOL_VCC100X86),)
|
|---|
| 49 | PATH_TOOL_VCC100X86 := $(wildcard $(PATH_DEVTOOLS)/win.amd64/vcc/v10*)
|
|---|
| 50 | endif
|
|---|
| 51 | ifneq ($(PATH_TOOL_VCC100X86),)
|
|---|
| 52 | PATH_TOOL_VCC100X86 := $(lastword $(sort $(PATH_TOOL_VCC100X86)))
|
|---|
| 53 | else
|
|---|
| 54 | $(warning kBuild: PATH_TOOL_VCC100X86 cannot be determined!)
|
|---|
| 55 | PATH_TOOL_VCC100X86 := $(PATH_DEVTOOLS)/x86.win/vcc/v10
|
|---|
| 56 | endif
|
|---|
| 57 | else
|
|---|
| 58 | # Resolve any fancy stuff once and for all.
|
|---|
| 59 | PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100X86)
|
|---|
| 60 | endif
|
|---|
| 61 | PATH_TOOL_VCC100X86_BIN ?= $(PATH_TOOL_VCC100X86)/bin
|
|---|
| 62 | PATH_TOOL_VCC100X86_LIB ?= $(PATH_TOOL_VCC100X86)/lib
|
|---|
| 63 | PATH_TOOL_VCC100X86_INC ?= $(PATH_TOOL_VCC100X86)/include
|
|---|
| 64 | PATH_TOOL_VCC100X86_ATLMFC ?= $(PATH_TOOL_VCC100X86)/atlmfc
|
|---|
| 65 | PATH_TOOL_VCC100X86_ATLMFC_INC ?= $(PATH_TOOL_VCC100X86_ATLMFC)/include
|
|---|
| 66 | PATH_TOOL_VCC100X86_ATLMFC_LIB ?= $(PATH_TOOL_VCC100X86_ATLMFC)/lib
|
|---|
| 67 | TOOL_VCC100X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
|
|---|
| 68 | TOOL_VCC100X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
|
|---|
| 69 | TOOL_VCC100X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/ml.exe
|
|---|
| 70 | TOOL_VCC100X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/lib.exe
|
|---|
| 71 | TOOL_VCC100X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe
|
|---|
| 72 | TOOL_VCC100X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/dumpbin.exe
|
|---|
| 73 | TOOL_VCC100X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/editbin.exe
|
|---|
| 74 | TOOL_VCC100X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
|
|---|
| 75 | TOOL_VCC100X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
|
|---|
| 76 |
|
|---|
| 77 | # The following in duplicated in VCC100.kmk and VCC100X86.kmk.
|
|---|
| 78 | TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
|
|---|
| 79 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
|---|
| 80 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
|
|---|
| 81 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
|---|
| 82 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
|---|
| 83 | $1))
|
|---|
| 84 | TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
|
|---|
| 85 |
|
|---|
| 86 | ## Disabled fast DEP_IDB based dependencies.
|
|---|
| 87 | #VCC100X86_OLD_DEPS = 1
|
|---|
| 88 |
|
|---|
| 89 | ## Constructs the correct .pdb name (the name is lowercased).
|
|---|
| 90 | # @param $(1) Base name, no extention.
|
|---|
| 91 | # @param $(2) The extension.
|
|---|
| 92 | TOOL_VCC100X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | # General Properties used by kBuild
|
|---|
| 96 | TOOL_VCC100X86_COBJSUFF ?= .obj
|
|---|
| 97 | TOOL_VCC100X86_CFLAGS ?= -TC -nologo
|
|---|
| 98 | TOOL_VCC100X86_CFLAGS.debug ?= -Zi
|
|---|
| 99 | TOOL_VCC100X86_CFLAGS.dbgopt ?= -O2 -Zi
|
|---|
| 100 | TOOL_VCC100X86_CFLAGS.release ?= -O2
|
|---|
| 101 | TOOL_VCC100X86_CFLAGS.profile ?= -O2
|
|---|
| 102 | TOOL_VCC100X86_CINCS ?= $(PATH_TOOL_VCC100X86_INC)
|
|---|
| 103 | TOOL_VCC100X86_CDEFS ?=
|
|---|
| 104 |
|
|---|
| 105 | TOOL_VCC100X86_CXXOBJSUFF ?= .obj
|
|---|
| 106 | TOOL_VCC100X86_CXXFLAGS ?= -TP -nologo
|
|---|
| 107 | TOOL_VCC100X86_CXXFLAGS.debug ?= -Zi
|
|---|
| 108 | TOOL_VCC100X86_CXXFLAGS.dbgopt ?= -O2 -Zi
|
|---|
| 109 | TOOL_VCC100X86_CXXFLAGS.release ?= -O2
|
|---|
| 110 | TOOL_VCC100X86_CXXFLAGS.profile ?= -O2
|
|---|
| 111 | TOOL_VCC100X86_CXXINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
|
|---|
| 112 | TOOL_VCC100X86_CXXDEFS ?=
|
|---|
| 113 |
|
|---|
| 114 | TOOL_VCC100X86_ASOBJSUFF ?= .obj
|
|---|
| 115 |
|
|---|
| 116 | TOOL_VCC100X86_RCOBJSUFF ?= .res
|
|---|
| 117 | TOOL_VCC100X86_RCINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
|
|---|
| 118 |
|
|---|
| 119 | TOOL_VCC100X86_ARFLAGS ?= -nologo
|
|---|
| 120 | TOOL_VCC100X86_ARLIBSUFF ?= .lib
|
|---|
| 121 |
|
|---|
| 122 | TOOL_VCC100X86_LDFLAGS ?= -nologo -machine:x86
|
|---|
| 123 | TOOL_VCC100X86_LDFLAGS.debug ?= -debug
|
|---|
| 124 | TOOL_VCC100X86_LDFLAGS.dbgopt ?= -debug
|
|---|
| 125 | TOOL_VCC100X86_LDFLAGS.profile ?= -debug
|
|---|
| 126 | TOOL_VCC100X86_LDFLAGS.release ?=
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 | ## Compile C source.
|
|---|
| 131 | # @param $(target) Normalized main target name.
|
|---|
| 132 | # @param $(source) Source filename (relative).
|
|---|
| 133 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 134 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 135 | # @param $(flags) Flags.
|
|---|
| 136 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 137 | # @param $(incs) Includes. No -I or something.
|
|---|
| 138 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 139 | # @param $(deps) Other dependencies.
|
|---|
| 140 | #
|
|---|
| 141 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 142 | # @param $(objsuff) Object suffix.
|
|---|
| 143 | TOOL_VCC100X86_COMPILE_C_DEPEND =
|
|---|
| 144 | TOOL_VCC100X86_COMPILE_C_DEPORD =
|
|---|
| 145 | ifdef KBUILD_USE_KOBJCACHE
|
|---|
| 146 | TOOL_VCC100X86_COMPILE_C_USES_KOBJCACHE = 1
|
|---|
| 147 | TOOL_VCC100X86_COMPILE_C_OUTPUT = $(outbase).i
|
|---|
| 148 | TOOL_VCC100AMD64_COMPILE_C_OUTPUT_MAYBE =
|
|---|
| 149 | define TOOL_VCC100X86_COMPILE_C_CMDS
|
|---|
| 150 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
|
|---|
| 151 | --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
|
|---|
| 152 | --kObjCache-cpp $(outbase).i\
|
|---|
| 153 | $(TOOL_VCC100X86_CC) -E\
|
|---|
| 154 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 155 | $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 156 | $(subst /,\\,$(abspath $(source))) \
|
|---|
| 157 | --kObjCache-cc $(obj)\
|
|---|
| 158 | $(TOOL_VCC100X86_CC) -c\
|
|---|
| 159 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 160 | -Fo$(obj)\
|
|---|
| 161 | $(outbase).i
|
|---|
| 162 | endef
|
|---|
| 163 | else # !KBUILD_USE_KOBJCACHE
|
|---|
| 164 | TOOL_VCC100X86_COMPILE_C_OUTPUT = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb)
|
|---|
| 165 | TOOL_VCC100X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb)
|
|---|
| 166 | define TOOL_VCC100X86_COMPILE_C_CMDS
|
|---|
| 167 | $(QUIET)$(TOOL_VCC100X86_CC) -c\
|
|---|
| 168 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 169 | -Fd$(outbase)-obj.pdb \
|
|---|
| 170 | -FD\
|
|---|
| 171 | -Fo$(obj)\
|
|---|
| 172 | $(subst /,\\,$(abspath $(source)))
|
|---|
| 173 | $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100X86_PDB,$(outbase)-obj,idb)
|
|---|
| 174 | endef
|
|---|
| 175 | endif # !KBUILD_USE_KOBJCACHE
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 | ## Compile C++ source.
|
|---|
| 179 | # @param $(target) Normalized main target name.
|
|---|
| 180 | # @param $(source) Source filename (relative).
|
|---|
| 181 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 182 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 183 | # @param $(flags) Flags.
|
|---|
| 184 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 185 | # @param $(incs) Includes. No -I or something.
|
|---|
| 186 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 187 | # @param $(deps) Other dependencies.
|
|---|
| 188 | #
|
|---|
| 189 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 190 | # @param $(objsuff) Object suffix.
|
|---|
| 191 | TOOL_VCC100X86_COMPILE_CXX_DEPEND =
|
|---|
| 192 | TOOL_VCC100X86_COMPILE_CXX_DEPORD =
|
|---|
| 193 | ifdef KBUILD_USE_KOBJCACHE
|
|---|
| 194 | TOOL_VCC100X86_COMPILE_CXX_USES_KOBJCACHE = 1
|
|---|
| 195 | TOOL_VCC100X86_COMPILE_CXX_OUTPUT = $(outbase).ii
|
|---|
| 196 | TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT_MAYBE =
|
|---|
| 197 | define TOOL_VCC100X86_COMPILE_CXX_CMDS
|
|---|
| 198 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
|
|---|
| 199 | --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
|
|---|
| 200 | --kObjCache-cpp $(outbase).ii\
|
|---|
| 201 | $(TOOL_VCC100X86_CXX) -E\
|
|---|
| 202 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 203 | $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 204 | $(subst /,\\,$(abspath $(source))) \
|
|---|
| 205 | --kObjCache-cc $(obj)\
|
|---|
| 206 | $(TOOL_VCC100X86_CXX) -c\
|
|---|
| 207 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 208 | -Fo$(obj)\
|
|---|
| 209 | $(outbase).ii
|
|---|
| 210 | endef
|
|---|
| 211 | else # !KBUILD_USE_KOBJCACHE
|
|---|
| 212 | TOOL_VCC100X86_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb)
|
|---|
| 213 | TOOL_VCC100X86_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb)
|
|---|
| 214 | define TOOL_VCC100X86_COMPILE_CXX_CMDS
|
|---|
| 215 | $(QUIET)$(TOOL_VCC100X86_CXX) -c\
|
|---|
| 216 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 217 | -Fd$(outbase)-obj.pdb \
|
|---|
| 218 | -FD\
|
|---|
| 219 | -Fo$(obj)\
|
|---|
| 220 | $(subst /,\\,$(abspath $(source)))
|
|---|
| 221 | $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100X86_PDB,$(outbase)-obj,idb)
|
|---|
| 222 | endef
|
|---|
| 223 | endif # !KBUILD_USE_KOBJCACHE
|
|---|
| 224 |
|
|---|
| 225 | ## @todo configure the assembler template.
|
|---|
| 226 |
|
|---|
| 227 | ## Compile resource source.
|
|---|
| 228 | # @param $(target) Normalized main target name.
|
|---|
| 229 | # @param $(source) Source filename (relative).
|
|---|
| 230 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 231 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 232 | # @param $(flags) Flags.
|
|---|
| 233 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 234 | # @param $(incs) Includes. No -I or something.
|
|---|
| 235 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 236 | # @param $(deps) Other dependencies.
|
|---|
| 237 | #
|
|---|
| 238 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 239 | # @param $(objsuff) Object suffix.
|
|---|
| 240 | TOOL_VCC100X86_COMPILE_RC_DEPEND =
|
|---|
| 241 | TOOL_VCC100X86_COMPILE_RC_DEPORD =
|
|---|
| 242 | TOOL_VCC100X86_COMPILE_RC_OUTPUT =
|
|---|
| 243 | define TOOL_VCC100X86_COMPILE_RC_CMDS
|
|---|
| 244 | $(QUIET)$(TOOL_VCC100X86_RC) \
|
|---|
| 245 | $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
|
|---|
| 246 | /fo$(obj)\
|
|---|
| 247 | $(subst /,\\,$(abspath $(source)))
|
|---|
| 248 | endef
|
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 | ## Link library
|
|---|
| 252 | # @param $(target) Normalized main target name.
|
|---|
| 253 | # @param $(out) Library name.
|
|---|
| 254 | # @param $(objs) Object files to put in the library.
|
|---|
| 255 | # @param $(flags) Flags.
|
|---|
| 256 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 257 | # @param $(deps) Other dependencies.
|
|---|
| 258 | # @param $(othersrc) Unhandled sources.
|
|---|
| 259 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 260 | #
|
|---|
| 261 | TOOL_VCC100X86_LINK_LIBRARY_DEPEND = $(othersrc)
|
|---|
| 262 | TOOL_VCC100X86_LINK_LIBRARY_DEPORD =
|
|---|
| 263 | TOOL_VCC100X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
|---|
| 264 | TOOL_VCC100X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
|---|
| 265 | define TOOL_VCC100X86_LINK_LIBRARY_CMDS
|
|---|
| 266 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 267 | $(foreach arg,\
|
|---|
| 268 | $(subst /,\\,$(objs) \
|
|---|
| 269 | $(filter-out %.def,$(othersrc))) \
|
|---|
| 270 | $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
|
|---|
| 271 | ,\"$(arg)\")
|
|---|
| 272 | $(QUIET)$(TOOL_VCC100X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
|---|
| 273 | endef
|
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 | ## Link program
|
|---|
| 277 | # @param $(target) Normalized main target name.
|
|---|
| 278 | # @param $(out) Program name.
|
|---|
| 279 | # @param $(objs) Object files to link together.
|
|---|
| 280 | # @param $(libs) Libraries to search.
|
|---|
| 281 | # @param $(libpath) Library search paths.
|
|---|
| 282 | # @param $(flags) Flags.
|
|---|
| 283 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 284 | # @param $(deps) Other dependencies.
|
|---|
| 285 | # @param $(othersrc) Unhandled sources.
|
|---|
| 286 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 287 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 288 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 289 | #
|
|---|
| 290 | TOOL_VCC100X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 291 | TOOL_VCC100X86_LINK_PROGRAM_DEPORD =
|
|---|
| 292 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 293 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
|---|
| 294 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
|---|
| 295 | TOOL_VCC100X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
|---|
| 296 | define TOOL_VCC100X86_LINK_PROGRAM_CMDS
|
|---|
| 297 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 298 | $(foreach arg,\
|
|---|
| 299 | $(subst /,\\,$(objs)) \
|
|---|
| 300 | $(subst /,\\,$(libs)) \
|
|---|
| 301 | ,\"$(arg)\")
|
|---|
| 302 | $(QUIET)$(TOOL_VCC100X86_LD) $(flags) \
|
|---|
| 303 | /OUT:$(out) \
|
|---|
| 304 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
|---|
| 305 | /MAP:$(outbase).map \
|
|---|
| 306 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 307 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 308 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 309 | @$(outbase).rsp
|
|---|
| 310 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
|---|
| 311 | $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
|---|
| 312 | endef
|
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 | ## Link DLL.
|
|---|
| 316 | # @param $(target) Normalized main target name.
|
|---|
| 317 | # @param $(out) DLL name.
|
|---|
| 318 | # @param $(objs) Object files to link together.
|
|---|
| 319 | # @param $(libs) Libraries to search.
|
|---|
| 320 | # @param $(libpath) Library search paths.
|
|---|
| 321 | # @param $(flags) Flags.
|
|---|
| 322 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 323 | # @param $(deps) Other dependencies.
|
|---|
| 324 | # @param $(othersrc) Unhandled sources.
|
|---|
| 325 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 326 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 327 | #
|
|---|
| 328 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 329 | TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 330 | TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
|---|
| 331 | TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
|
|---|
| 332 | TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
|---|
| 333 | TOOL_VCC100X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
|---|
| 334 | TOOL_VCC100X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
|---|
| 335 | define TOOL_VCC100X86_LINK_DLL_CMDS
|
|---|
| 336 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 337 | $(foreach arg,\
|
|---|
| 338 | $(subst /,\\,$(objs)) \
|
|---|
| 339 | $(subst /,\\,$(libs)) \
|
|---|
| 340 | ,\"$(arg)\")
|
|---|
| 341 | $(QUIET)$(TOOL_VCC100X86_LD) $(flags) \
|
|---|
| 342 | /OUT:$(out) \
|
|---|
| 343 | /IMPLIB:$(outbase).lib \
|
|---|
| 344 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
|---|
| 345 | /MAP:$(outbase).map \
|
|---|
| 346 | /DLL \
|
|---|
| 347 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 348 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 349 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 350 | @$(outbase).rsp
|
|---|
| 351 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
|---|
| 352 | $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
|---|
| 353 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
|---|
| 354 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
|---|
| 355 | endef
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 359 | # @param $(target) Normalized main target name.
|
|---|
| 360 | # @param $(out) System module name.
|
|---|
| 361 | # @param $(objs) Object files to link together.
|
|---|
| 362 | # @param $(libs) Libraries to search.
|
|---|
| 363 | # @param $(libpath) Library search paths.
|
|---|
| 364 | # @param $(flags) Flags.
|
|---|
| 365 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 366 | # @param $(deps) Other dependencies.
|
|---|
| 367 | # @param $(othersrc) Unhandled sources.
|
|---|
| 368 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 369 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 370 | #
|
|---|
| 371 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 372 | TOOL_VCC100X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 373 | TOOL_VCC100X86_LINK_SYSMOD_DEPORD =
|
|---|
| 374 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 375 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
|---|
| 376 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
|---|
| 377 | TOOL_VCC100X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
|---|
| 378 | define TOOL_VCC100X86_LINK_SYSMOD_CMDS
|
|---|
| 379 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 380 | $(foreach arg,\
|
|---|
| 381 | $(subst /,\\,$(objs)) \
|
|---|
| 382 | $(subst /,\\,$(libs)) \
|
|---|
| 383 | ,\"$(arg)\")
|
|---|
| 384 | $(QUIET)$(TOOL_VCC100X86_LD) $(flags) \
|
|---|
| 385 | /OUT:$(out) \
|
|---|
| 386 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
|---|
| 387 | /MAP:$(outbase).map \
|
|---|
| 388 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 389 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 390 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 391 | @$(outbase).rsp
|
|---|
| 392 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
|---|
| 393 | $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
|---|
| 394 | endef
|
|---|
| 395 |
|
|---|