| 1 | # $Id: VCC100.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 $(KBUILD_TARGET).
|
|---|
| 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_VCC100 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting $(KBUILD_TARGET).
|
|---|
| 35 |
|
|---|
| 36 | # Tool Specific Properties
|
|---|
| 37 | ifndef PATH_TOOL_VCC100
|
|---|
| 38 | PATH_TOOL_VCC100 := $(wildcard $(PATH_DEVTOOLS_TRG)/vcc/v10*)
|
|---|
| 39 | ifeq ($(PATH_TOOL_VCC100),)
|
|---|
| 40 | PATH_TOOL_VCC100 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v10*)
|
|---|
| 41 | endif
|
|---|
| 42 | ifeq ($(PATH_TOOL_VCC100),)
|
|---|
| 43 | PATH_TOOL_VCC100 := $(wildcard $(PATH_DEVTOOLS)/x86.win32/vcc/v10*)
|
|---|
| 44 | endif
|
|---|
| 45 | ifeq ($(PATH_TOOL_VCC100),)
|
|---|
| 46 | PATH_TOOL_VCC100 := $(wildcard $(PATH_DEVTOOLS)/win.amd64/vcc/v10*)
|
|---|
| 47 | endif
|
|---|
| 48 | ifeq ($(PATH_TOOL_VCC100),)
|
|---|
| 49 | PATH_TOOL_VCC100 := $(lastword $(sort $(PATH_TOOL_VCC100)))
|
|---|
| 50 | endif
|
|---|
| 51 | # if not found, we'll enter 'pathless' mode.
|
|---|
| 52 | else
|
|---|
| 53 | # Resolve any fancy stuff once and for all.
|
|---|
| 54 | PATH_TOOL_VCC100 := $(PATH_TOOL_VCC100)
|
|---|
| 55 | endif
|
|---|
| 56 | ifneq ($(PATH_TOOL_VCC100),)
|
|---|
| 57 | ifeq ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
|
|---|
| 58 | PATH_TOOL_VCC100_BIN.amd64 ?= $(PATH_TOOL_VCC100)/bin/amd64
|
|---|
| 59 | else
|
|---|
| 60 | PATH_TOOL_VCC100_BIN.amd64 ?= $(PATH_TOOL_VCC100)/bin/x86_amd64
|
|---|
| 61 | endif
|
|---|
| 62 | PATH_TOOL_VCC100_BIN.x86 ?= $(PATH_TOOL_VCC100)/bin
|
|---|
| 63 | PATH_TOOL_VCC100_BIN ?= $(PATH_TOOL_VCC100_BIN.$(KBUILD_TARGET_ARCH))
|
|---|
| 64 | PATH_TOOL_VCC100_LIB.amd64 ?= $(PATH_TOOL_VCC100)/lib/amd64
|
|---|
| 65 | PATH_TOOL_VCC100_LIB.x86 ?= $(PATH_TOOL_VCC100)/lib
|
|---|
| 66 | PATH_TOOL_VCC100_LIB ?= $(PATH_TOOL_VCC100_LIB.$(KBUILD_TARGET_ARCH))
|
|---|
| 67 | PATH_TOOL_VCC100_INC ?= $(PATH_TOOL_VCC100)/include
|
|---|
| 68 | PATH_TOOL_VCC100_ATLMFC ?= $(PATH_TOOL_VCC100X86)/atlmfc
|
|---|
| 69 | PATH_TOOL_VCC100_ATLMFC_INC ?= $(PATH_TOOL_VCC100_ATLMFC)/include
|
|---|
| 70 | PATH_TOOL_VCC100_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC100_ATLMFC)/lib
|
|---|
| 71 | PATH_TOOL_VCC100_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC100_ATLMFC)/lib/amd64
|
|---|
| 72 | PATH_TOOL_VCC100_ATLMFC_LIB ?= $(PATH_TOOL_VCC100_ATLMFC_LIB.$(KBUILD_TARGET_ARCH))
|
|---|
| 73 | TOOL_VCC100_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/cl.exe
|
|---|
| 74 | TOOL_VCC100_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/cl.exe
|
|---|
| 75 | TOOL_VCC100_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/ml64.exe
|
|---|
| 76 | TOOL_VCC100_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/lib.exe
|
|---|
| 77 | TOOL_VCC100_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/link.exe
|
|---|
| 78 | TOOL_VCC100_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/dumpbin.exe
|
|---|
| 79 | TOOL_VCC100_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/editbin.exe
|
|---|
| 80 | else
|
|---|
| 81 | # Pathless, relies on the environment.
|
|---|
| 82 | TOOL_VCC100_CC ?= $(EXEC_X86_WIN32) cl.exe
|
|---|
| 83 | TOOL_VCC100_CXX ?= $(EXEC_X86_WIN32) cl.exe
|
|---|
| 84 | TOOL_VCC100_AS ?= $(EXEC_X86_WIN32) ml64.exe
|
|---|
| 85 | TOOL_VCC100_AR ?= $(EXEC_X86_WIN32) lib.exe
|
|---|
| 86 | TOOL_VCC100_LD ?= $(EXEC_X86_WIN32) link.exe
|
|---|
| 87 | TOOL_VCC100_DUMPBIN ?= $(EXEC_X86_WIN32) dumpbin.exe
|
|---|
| 88 | TOOL_VCC100_EDITBIN ?= $(EXEC_X86_WIN32) editbin.exe
|
|---|
| 89 | endif
|
|---|
| 90 | TOOL_VCC100_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
|
|---|
| 91 | TOOL_VCC100_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
|
|---|
| 92 |
|
|---|
| 93 | # The following in duplicated in VCC100.kmk and VCC100X86.kmk.
|
|---|
| 94 | TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
|
|---|
| 95 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
|---|
| 96 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
|
|---|
| 97 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
|---|
| 98 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
|---|
| 99 | $1))
|
|---|
| 100 | TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
|
|---|
| 101 |
|
|---|
| 102 | ## Disabled fast DEP_IDB based dependencies.
|
|---|
| 103 | #VCC100_OLD_DEPS = 1
|
|---|
| 104 |
|
|---|
| 105 | ## Constructs the correct .pdb name (the name is lowercased).
|
|---|
| 106 | # @param $(1) Base name, no extention.
|
|---|
| 107 | # @param $(2) The extension.
|
|---|
| 108 | TOOL_VCC100_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
|---|
| 109 |
|
|---|
| 110 | TOOL_VCC100_COBJSUFF ?= .obj
|
|---|
| 111 | TOOL_VCC100_CFLAGS ?= -TC -nologo
|
|---|
| 112 | TOOL_VCC100_CFLAGS.debug ?= -Zi
|
|---|
| 113 | TOOL_VCC100_CFLAGS.dbgopt ?= -O2 -Zi
|
|---|
| 114 | TOOL_VCC100_CFLAGS.release ?= -O2
|
|---|
| 115 | TOOL_VCC100_CFLAGS.profile ?= -O2
|
|---|
| 116 | TOOL_VCC100_CINCS ?= $(PATH_TOOL_VCC100_INC)
|
|---|
| 117 | TOOL_VCC100_CDEFS ?=
|
|---|
| 118 |
|
|---|
| 119 | TOOL_VCC100_CXXOBJSUFF ?= .obj
|
|---|
| 120 | TOOL_VCC100_CXXFLAGS ?= -TP -nologo
|
|---|
| 121 | TOOL_VCC100_CXXFLAGS.debug ?= -Zi
|
|---|
| 122 | TOOL_VCC100_CXXFLAGS.dbgopt ?= -O2 -Zi
|
|---|
| 123 | TOOL_VCC100_CXXFLAGS.release ?= -O2
|
|---|
| 124 | TOOL_VCC100_CXXFLAGS.profile ?= -O2
|
|---|
| 125 | TOOL_VCC100_CXXINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
|
|---|
| 126 | TOOL_VCC100_CXXDEFS ?=
|
|---|
| 127 |
|
|---|
| 128 | TOOL_VCC100_ASOBJSUFF ?= .obj
|
|---|
| 129 |
|
|---|
| 130 | TOOL_VCC100_RCOBJSUFF ?= .res
|
|---|
| 131 | TOOL_VCC100_RCINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
|
|---|
| 132 |
|
|---|
| 133 | TOOL_VCC100_ARFLAGS.amd64 ?= -machine:amd64
|
|---|
| 134 | TOOL_VCC100_ARFLAGS.x86 ?= -machine:x86
|
|---|
| 135 | TOOL_VCC100_ARFLAGS ?= -nologo
|
|---|
| 136 | TOOL_VCC100_ARLIBSUFF ?= .lib
|
|---|
| 137 |
|
|---|
| 138 | TOOL_VCC100_LDFLAGS.amd64 ?= -machine:amd64
|
|---|
| 139 | TOOL_VCC100_LDFLAGS.x86 ?= -machine:x86
|
|---|
| 140 | TOOL_VCC100_LDFLAGS ?= -nologo
|
|---|
| 141 | TOOL_VCC100_LDFLAGS.debug ?= -debug
|
|---|
| 142 | TOOL_VCC100_LDFLAGS.dbgopt ?= -debug
|
|---|
| 143 | TOOL_VCC100_LDFLAGS.profile ?= -debug
|
|---|
| 144 | TOOL_VCC100_LDFLAGS.release ?=
|
|---|
| 145 | TOOL_VCC100_LIBPATH.amd64 ?= $(PATH_TOOL_VCC100_LIB.amd64) $(PATH_TOOL_VCC100_ATLMFC_LIB.amd64)
|
|---|
| 146 | TOOL_VCC100_LIBPATH.x86 ?= $(PATH_TOOL_VCC100_LIB.x86) $(PATH_TOOL_VCC100_ATLMFC_LIB.x86)
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | ## Compile C source.
|
|---|
| 151 | # @param $(target) Normalized main target name.
|
|---|
| 152 | # @param $(source) Source filename (relative).
|
|---|
| 153 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 154 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 155 | # @param $(flags) Flags.
|
|---|
| 156 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 157 | # @param $(incs) Includes. No -I or something.
|
|---|
| 158 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 159 | # @param $(deps) Other dependencies.
|
|---|
| 160 | #
|
|---|
| 161 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 162 | # @param $(objsuff) Object suffix.
|
|---|
| 163 | TOOL_VCC100_COMPILE_C_DEPEND =
|
|---|
| 164 | TOOL_VCC100_COMPILE_C_DEPORD =
|
|---|
| 165 | ifdef KBUILD_USE_KOBJCACHE
|
|---|
| 166 | TOOL_VCC100_COMPILE_C_USES_KOBJCACHE = 1
|
|---|
| 167 | TOOL_VCC100_COMPILE_C_OUTPUT = $(outbase).i
|
|---|
| 168 | TOOL_VCC100_COMPILE_C_OUTPUT_MAYBE =
|
|---|
| 169 | define TOOL_VCC100_COMPILE_C_CMDS
|
|---|
| 170 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
|
|---|
| 171 | --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
|
|---|
| 172 | --kObjCache-cpp $(outbase).i\
|
|---|
| 173 | $(TOOL_VCC100_CC) -E\
|
|---|
| 174 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 175 | $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 176 | $(subst /,\\,$(abspath $(source))) \
|
|---|
| 177 | --kObjCache-cc $(obj)\
|
|---|
| 178 | $(TOOL_VCC100_CC) -c\
|
|---|
| 179 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 180 | -Fo$(obj)\
|
|---|
| 181 | $(outbase).i
|
|---|
| 182 | endef
|
|---|
| 183 | else # !KBUILD_USE_KOBJCACHE
|
|---|
| 184 | TOOL_VCC100_COMPILE_C_OUTPUT = $(call TOOL_VCC100_PDB, $(outbase)-obj,idb)
|
|---|
| 185 | TOOL_VCC100_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100_PDB, $(outbase)-obj,pdb)
|
|---|
| 186 | define TOOL_VCC100_COMPILE_C_CMDS
|
|---|
| 187 | $(QUIET)$(TOOL_VCC100_CC) -c\
|
|---|
| 188 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 189 | -Fd$(outbase)-obj.pdb \
|
|---|
| 190 | -FD\
|
|---|
| 191 | -Fo$(obj)\
|
|---|
| 192 | $(subst /,\\,$(abspath $(source)))
|
|---|
| 193 | $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100_PDB,$(outbase)-obj,idb)
|
|---|
| 194 | endef
|
|---|
| 195 | endif # !KBUILD_USE_KOBJCACHE
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 | ## Compile C++ source.
|
|---|
| 199 | # @param $(target) Normalized main target name.
|
|---|
| 200 | # @param $(source) Source filename (relative).
|
|---|
| 201 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 202 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 203 | # @param $(flags) Flags.
|
|---|
| 204 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 205 | # @param $(incs) Includes. No -I or something.
|
|---|
| 206 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 207 | # @param $(deps) Other dependencies.
|
|---|
| 208 | #
|
|---|
| 209 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 210 | # @param $(objsuff) Object suffix.
|
|---|
| 211 | TOOL_VCC100_COMPILE_CXX_DEPEND =
|
|---|
| 212 | TOOL_VCC100_COMPILE_CXX_DEPORD =
|
|---|
| 213 | ifdef KBUILD_USE_KOBJCACHE
|
|---|
| 214 | TOOL_VCC100_COMPILE_CXX_USES_KOBJCACHE = 1
|
|---|
| 215 | TOOL_VCC100_COMPILE_CXX_OUTPUT = $(outbase).ii
|
|---|
| 216 | TOOL_VCC100_COMPILE_CXX_OUTPUT_MAYBE =
|
|---|
| 217 | define TOOL_VCC100_COMPILE_CXX_CMDS
|
|---|
| 218 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
|
|---|
| 219 | --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
|
|---|
| 220 | --kObjCache-cpp $(outbase).ii\
|
|---|
| 221 | $(TOOL_VCC100_CXX) -E\
|
|---|
| 222 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 223 | $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 224 | $(subst /,\\,$(abspath $(source))) \
|
|---|
| 225 | --kObjCache-cc $(obj)\
|
|---|
| 226 | $(TOOL_VCC100_CXX) -c\
|
|---|
| 227 | $(subst -Zi,-Z7,$(flags))\
|
|---|
| 228 | -Fo$(obj)\
|
|---|
| 229 | $(outbase).ii
|
|---|
| 230 | endef
|
|---|
| 231 | else # !KBUILD_USE_KOBJCACHE
|
|---|
| 232 | TOOL_VCC100_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100_PDB, $(outbase)-obj,idb)
|
|---|
| 233 | TOOL_VCC100_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100_PDB, $(outbase)-obj,pdb)
|
|---|
| 234 | define TOOL_VCC100_COMPILE_CXX_CMDS
|
|---|
| 235 | $(QUIET)$(TOOL_VCC100_CXX) -c\
|
|---|
| 236 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 237 | -Fd$(outbase)-obj.pdb \
|
|---|
| 238 | -FD\
|
|---|
| 239 | -Fo$(obj)\
|
|---|
| 240 | $(subst /,\\,$(abspath $(source)))
|
|---|
| 241 | $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100_PDB,$(outbase)-obj,idb)
|
|---|
| 242 | endef
|
|---|
| 243 | endif # !KBUILD_USE_KOBJCACHE
|
|---|
| 244 |
|
|---|
| 245 | ## @todo configure the assembler template.
|
|---|
| 246 |
|
|---|
| 247 | ## Compile resource source.
|
|---|
| 248 | # @param $(target) Normalized main target name.
|
|---|
| 249 | # @param $(source) Source filename (relative).
|
|---|
| 250 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 251 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 252 | # @param $(flags) Flags.
|
|---|
| 253 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 254 | # @param $(incs) Includes. No -I or something.
|
|---|
| 255 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 256 | # @param $(deps) Other dependencies.
|
|---|
| 257 | #
|
|---|
| 258 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 259 | # @param $(objsuff) Object suffix.
|
|---|
| 260 | TOOL_VCC100_COMPILE_RC_OUTPUT =
|
|---|
| 261 | TOOL_VCC100_COMPILE_RC_DEPEND =
|
|---|
| 262 | TOOL_VCC100_COMPILE_RC_DEPORD =
|
|---|
| 263 | define TOOL_VCC100_COMPILE_RC_CMDS
|
|---|
| 264 | $(QUIET)$(TOOL_VCC100_RC) \
|
|---|
| 265 | $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
|
|---|
| 266 | /fo$(obj)\
|
|---|
| 267 | $(subst /,\\,$(abspath $(source)))
|
|---|
| 268 | endef
|
|---|
| 269 |
|
|---|
| 270 |
|
|---|
| 271 | ## Link library
|
|---|
| 272 | # @param $(target) Normalized main target name.
|
|---|
| 273 | # @param $(out) Library name.
|
|---|
| 274 | # @param $(objs) Object files to put in the library.
|
|---|
| 275 | # @param $(flags) Flags.
|
|---|
| 276 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 277 | # @param $(deps) Other dependencies.
|
|---|
| 278 | # @param $(othersrc) Unhandled sources.
|
|---|
| 279 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 280 | #
|
|---|
| 281 | TOOL_VCC100_LINK_LIBRARY_DEPEND = $(othersrc)
|
|---|
| 282 | TOOL_VCC100_LINK_LIBRARY_DEPORD =
|
|---|
| 283 | TOOL_VCC100_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
|---|
| 284 | TOOL_VCC100_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
|---|
| 285 | define TOOL_VCC100_LINK_LIBRARY_CMDS
|
|---|
| 286 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 287 | $(foreach arg,\
|
|---|
| 288 | $(subst /,\\,$(objs) \
|
|---|
| 289 | $(filter-out %.def,$(othersrc))) \
|
|---|
| 290 | $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
|
|---|
| 291 | ,\"$(arg)\")
|
|---|
| 292 | $(QUIET)$(TOOL_VCC100_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
|---|
| 293 | endef
|
|---|
| 294 |
|
|---|
| 295 |
|
|---|
| 296 |
|
|---|
| 297 |
|
|---|
| 298 | ## Link program
|
|---|
| 299 | # @param $(target) Normalized main target name.
|
|---|
| 300 | # @param $(out) Program name.
|
|---|
| 301 | # @param $(objs) Object files to link together.
|
|---|
| 302 | # @param $(libs) Libraries to search.
|
|---|
| 303 | # @param $(libpath) Library search paths.
|
|---|
| 304 | # @param $(flags) Flags.
|
|---|
| 305 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 306 | # @param $(deps) Other dependencies.
|
|---|
| 307 | # @param $(othersrc) Unhandled sources.
|
|---|
| 308 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 309 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 310 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 311 | #
|
|---|
| 312 | TOOL_VCC100_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 313 | TOOL_VCC100_LINK_PROGRAM_DEPORD =
|
|---|
| 314 | TOOL_VCC100_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 315 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
|---|
| 316 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
|---|
| 317 | TOOL_VCC100_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
|---|
| 318 | define TOOL_VCC100_LINK_PROGRAM_CMDS
|
|---|
| 319 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 320 | $(foreach arg,\
|
|---|
| 321 | $(subst /,\\,$(objs)) \
|
|---|
| 322 | $(subst /,\\,$(libs)) \
|
|---|
| 323 | ,\"$(arg)\")
|
|---|
| 324 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \
|
|---|
| 325 | /OUT:$(out) \
|
|---|
| 326 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
|---|
| 327 | /MAP:$(outbase).map \
|
|---|
| 328 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 329 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 330 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 331 | @$(outbase).rsp
|
|---|
| 332 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
|---|
| 333 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
|---|
| 334 | endef
|
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 | ## Link DLL.
|
|---|
| 338 | # @param $(target) Normalized main target name.
|
|---|
| 339 | # @param $(out) DLL name.
|
|---|
| 340 | # @param $(objs) Object files to link together.
|
|---|
| 341 | # @param $(libs) Libraries to search.
|
|---|
| 342 | # @param $(libpath) Library search paths.
|
|---|
| 343 | # @param $(flags) Flags.
|
|---|
| 344 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 345 | # @param $(deps) Other dependencies.
|
|---|
| 346 | # @param $(othersrc) Unhandled sources.
|
|---|
| 347 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 348 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 349 | #
|
|---|
| 350 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 351 | TOOL_VCC100_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 352 | TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
|---|
| 353 | TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
|
|---|
| 354 | TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
|---|
| 355 | TOOL_VCC100_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
|---|
| 356 | TOOL_VCC100_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
|---|
| 357 | define TOOL_VCC100_LINK_DLL_CMDS
|
|---|
| 358 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 359 | $(foreach arg,\
|
|---|
| 360 | $(subst /,\\,$(objs)) \
|
|---|
| 361 | $(subst /,\\,$(libs)) \
|
|---|
| 362 | ,\"$(arg)\")
|
|---|
| 363 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \
|
|---|
| 364 | /OUT:$(out) \
|
|---|
| 365 | /IMPLIB:$(outbase).lib \
|
|---|
| 366 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
|---|
| 367 | /MAP:$(outbase).map \
|
|---|
| 368 | /DLL \
|
|---|
| 369 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 370 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 371 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 372 | @$(outbase).rsp
|
|---|
| 373 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
|---|
| 374 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
|---|
| 375 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
|---|
| 376 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
|---|
| 377 | endef
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 381 | # @param $(target) Normalized main target name.
|
|---|
| 382 | # @param $(out) System module name.
|
|---|
| 383 | # @param $(objs) Object files to link together.
|
|---|
| 384 | # @param $(libs) Libraries to search.
|
|---|
| 385 | # @param $(libpath) Library search paths.
|
|---|
| 386 | # @param $(flags) Flags.
|
|---|
| 387 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 388 | # @param $(deps) Other dependencies.
|
|---|
| 389 | # @param $(othersrc) Unhandled sources.
|
|---|
| 390 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 391 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 392 | #
|
|---|
| 393 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 394 | TOOL_VCC100_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 395 | TOOL_VCC100_LINK_SYSMOD_DEPORD =
|
|---|
| 396 | TOOL_VCC100_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
|
|---|
| 397 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
|---|
| 398 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
|---|
| 399 | TOOL_VCC100_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
|---|
| 400 | define TOOL_VCC100_LINK_SYSMOD_CMDS
|
|---|
| 401 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
|---|
| 402 | $(foreach arg,\
|
|---|
| 403 | $(subst /,\\,$(objs)) \
|
|---|
| 404 | $(subst /,\\,$(libs)) \
|
|---|
| 405 | ,\"$(arg)\")
|
|---|
| 406 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \
|
|---|
| 407 | /OUT:$(out) \
|
|---|
| 408 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
|---|
| 409 | /MAP:$(outbase).map \
|
|---|
| 410 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 411 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 412 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 413 | @$(outbase).rsp
|
|---|
| 414 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
|---|
| 415 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
|---|
| 416 | endef
|
|---|
| 417 |
|
|---|