[819] | 1 | # $Id: VCC100.kmk 3303 2020-01-14 15:09:44Z bird $
|
---|
| 2 | ## @file
|
---|
[2408] | 3 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting $(KBUILD_TARGET).
|
---|
[819] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[819] | 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 | #
|
---|
[1547] | 26 | # As a special exception you are granted permission to include this file, via
|
---|
[2018] | 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.
|
---|
[1547] | 29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
| 30 | # program, whatever should not be covered the GPL.
|
---|
| 31 | #
|
---|
| 32 | #
|
---|
[819] | 33 |
|
---|
[2408] | 34 | TOOL_VCC100 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting $(KBUILD_TARGET).
|
---|
[819] | 35 |
|
---|
| 36 | # Tool Specific Properties
|
---|
[2408] | 37 | ifndef PATH_TOOL_VCC100
|
---|
[2726] | 38 | PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS_TRG)/vcc/v10*)
|
---|
[2408] | 39 | ifeq ($(PATH_TOOL_VCC100),)
|
---|
[2726] | 40 | PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
|
---|
[819] | 41 | endif
|
---|
[2408] | 42 | ifeq ($(PATH_TOOL_VCC100),)
|
---|
[2726] | 43 | PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v10*)
|
---|
[857] | 44 | endif
|
---|
[2408] | 45 | ifeq ($(PATH_TOOL_VCC100),)
|
---|
[2726] | 46 | PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v10*)
|
---|
[857] | 47 | endif
|
---|
[2408] | 48 | ifeq ($(PATH_TOOL_VCC100),)
|
---|
| 49 | PATH_TOOL_VCC100 := $(lastword $(sort $(PATH_TOOL_VCC100)))
|
---|
[857] | 50 | endif
|
---|
[819] | 51 | # if not found, we'll enter 'pathless' mode.
|
---|
| 52 | else
|
---|
| 53 | # Resolve any fancy stuff once and for all.
|
---|
[2408] | 54 | PATH_TOOL_VCC100 := $(PATH_TOOL_VCC100)
|
---|
[819] | 55 | endif
|
---|
[2408] | 56 | ifneq ($(PATH_TOOL_VCC100),)
|
---|
[1504] | 57 | ifeq ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
|
---|
[2408] | 58 | PATH_TOOL_VCC100_BIN.amd64 ?= $(PATH_TOOL_VCC100)/bin/amd64
|
---|
[819] | 59 | else
|
---|
[2408] | 60 | PATH_TOOL_VCC100_BIN.amd64 ?= $(PATH_TOOL_VCC100)/bin/x86_amd64
|
---|
[819] | 61 | endif
|
---|
[2408] | 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
|
---|
[2622] | 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
|
---|
[819] | 80 | else
|
---|
| 81 | # Pathless, relies on the environment.
|
---|
[2408] | 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
|
---|
[2622] | 87 | TOOL_VCC100_DUMPBIN ?= $(EXEC_X86_WIN32) dumpbin.exe
|
---|
| 88 | TOOL_VCC100_EDITBIN ?= $(EXEC_X86_WIN32) editbin.exe
|
---|
[819] | 89 | endif
|
---|
[2606] | 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)
|
---|
[2604] | 92 |
|
---|
| 93 | # The following in duplicated in VCC100.kmk and VCC100X86.kmk.
|
---|
[2606] | 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)) \
|
---|
[2604] | 99 | $1))
|
---|
[2606] | 100 | TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
[2604] | 101 |
|
---|
[819] | 102 | ## Disabled fast DEP_IDB based dependencies.
|
---|
[2408] | 103 | #VCC100_OLD_DEPS = 1
|
---|
[819] | 104 |
|
---|
| 105 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
| 106 | # @param $(1) Base name, no extention.
|
---|
| 107 | # @param $(2) The extension.
|
---|
[2408] | 108 | TOOL_VCC100_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
[819] | 109 |
|
---|
[2954] | 110 |
|
---|
| 111 | # General Properties used by kBuild
|
---|
[2408] | 112 | TOOL_VCC100_COBJSUFF ?= .obj
|
---|
[2953] | 113 | TOOL_VCC100_CFLAGS ?= -TC -nologo -Zi
|
---|
| 114 | TOOL_VCC100_CFLAGS.debug ?=
|
---|
| 115 | TOOL_VCC100_CFLAGS.dbgopt ?= -O2
|
---|
[2408] | 116 | TOOL_VCC100_CFLAGS.release ?= -O2
|
---|
| 117 | TOOL_VCC100_CFLAGS.profile ?= -O2
|
---|
| 118 | TOOL_VCC100_CINCS ?= $(PATH_TOOL_VCC100_INC)
|
---|
| 119 | TOOL_VCC100_CDEFS ?=
|
---|
[819] | 120 |
|
---|
[2408] | 121 | TOOL_VCC100_CXXOBJSUFF ?= .obj
|
---|
[2953] | 122 | TOOL_VCC100_CXXFLAGS ?= -TP -nologo -Zi
|
---|
| 123 | TOOL_VCC100_CXXFLAGS.debug ?=
|
---|
| 124 | TOOL_VCC100_CXXFLAGS.dbgopt ?= -O2
|
---|
[2408] | 125 | TOOL_VCC100_CXXFLAGS.release ?= -O2
|
---|
| 126 | TOOL_VCC100_CXXFLAGS.profile ?= -O2
|
---|
| 127 | TOOL_VCC100_CXXINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
|
---|
| 128 | TOOL_VCC100_CXXDEFS ?=
|
---|
[819] | 129 |
|
---|
[2408] | 130 | TOOL_VCC100_ASOBJSUFF ?= .obj
|
---|
[819] | 131 |
|
---|
[2408] | 132 | TOOL_VCC100_RCOBJSUFF ?= .res
|
---|
| 133 | TOOL_VCC100_RCINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
|
---|
[819] | 134 |
|
---|
[2408] | 135 | TOOL_VCC100_ARFLAGS.amd64 ?= -machine:amd64
|
---|
| 136 | TOOL_VCC100_ARFLAGS.x86 ?= -machine:x86
|
---|
| 137 | TOOL_VCC100_ARFLAGS ?= -nologo
|
---|
| 138 | TOOL_VCC100_ARLIBSUFF ?= .lib
|
---|
[819] | 139 |
|
---|
[2408] | 140 | TOOL_VCC100_LDFLAGS.amd64 ?= -machine:amd64
|
---|
| 141 | TOOL_VCC100_LDFLAGS.x86 ?= -machine:x86
|
---|
| 142 | TOOL_VCC100_LDFLAGS ?= -nologo
|
---|
| 143 | TOOL_VCC100_LDFLAGS.debug ?= -debug
|
---|
[2625] | 144 | TOOL_VCC100_LDFLAGS.dbgopt ?= -debug
|
---|
| 145 | TOOL_VCC100_LDFLAGS.profile ?= -debug
|
---|
[2408] | 146 | TOOL_VCC100_LDFLAGS.release ?=
|
---|
| 147 | TOOL_VCC100_LIBPATH.amd64 ?= $(PATH_TOOL_VCC100_LIB.amd64) $(PATH_TOOL_VCC100_ATLMFC_LIB.amd64)
|
---|
| 148 | TOOL_VCC100_LIBPATH.x86 ?= $(PATH_TOOL_VCC100_LIB.x86) $(PATH_TOOL_VCC100_ATLMFC_LIB.x86)
|
---|
[819] | 149 |
|
---|
| 150 |
|
---|
| 151 |
|
---|
| 152 | ## Compile C source.
|
---|
| 153 | # @param $(target) Normalized main target name.
|
---|
| 154 | # @param $(source) Source filename (relative).
|
---|
| 155 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 156 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 157 | # @param $(flags) Flags.
|
---|
| 158 | # @param $(defs) Definitions. No -D or something.
|
---|
| 159 | # @param $(incs) Includes. No -I or something.
|
---|
| 160 | # @param $(dirdep) Directory creation dependency.
|
---|
| 161 | # @param $(deps) Other dependencies.
|
---|
| 162 | #
|
---|
| 163 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 164 | # @param $(objsuff) Object suffix.
|
---|
[2408] | 165 | TOOL_VCC100_COMPILE_C_DEPEND =
|
---|
| 166 | TOOL_VCC100_COMPILE_C_DEPORD =
|
---|
[2951] | 167 | TOOL_VCC100_COMPILE_C_OUTPUT =
|
---|
| 168 | TOOL_VCC100_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100_PDB, $(outbase)-obj,idb)
|
---|
[2408] | 169 | define TOOL_VCC100_COMPILE_C_CMDS
|
---|
| 170 | $(QUIET)$(TOOL_VCC100_CC) -c\
|
---|
[819] | 171 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 172 | -Fd$(outbase)-obj.pdb \
|
---|
| 173 | -Fo$(obj)\
|
---|
| 174 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 175 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[819] | 176 | endef
|
---|
| 177 |
|
---|
| 178 |
|
---|
| 179 | ## Compile C++ source.
|
---|
| 180 | # @param $(target) Normalized main target name.
|
---|
| 181 | # @param $(source) Source filename (relative).
|
---|
| 182 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 183 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 184 | # @param $(flags) Flags.
|
---|
| 185 | # @param $(defs) Definitions. No -D or something.
|
---|
| 186 | # @param $(incs) Includes. No -I or something.
|
---|
| 187 | # @param $(dirdep) Directory creation dependency.
|
---|
| 188 | # @param $(deps) Other dependencies.
|
---|
| 189 | #
|
---|
| 190 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 191 | # @param $(objsuff) Object suffix.
|
---|
[2954] | 192 | TOOL_VCC100_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
[2408] | 193 | TOOL_VCC100_COMPILE_CXX_DEPORD =
|
---|
[2951] | 194 | TOOL_VCC100_COMPILE_CXX_OUTPUT =
|
---|
[2954] | 195 | TOOL_VCC100_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 196 | ,,$(call TOOL_VCC100_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100_PDB, $(outbase)-obj,idb))
|
---|
[2408] | 197 | define TOOL_VCC100_COMPILE_CXX_CMDS
|
---|
| 198 | $(QUIET)$(TOOL_VCC100_CXX) -c\
|
---|
[819] | 199 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2956] | 200 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 201 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
|
---|
| 202 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[819] | 203 | -Fo$(obj)\
|
---|
| 204 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 205 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[819] | 206 | endef
|
---|
| 207 |
|
---|
[2954] | 208 |
|
---|
| 209 | #
|
---|
| 210 | # Helper tool for creating the precompiled C++ header.
|
---|
| 211 | #
|
---|
| 212 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 213 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 214 | #
|
---|
| 215 | TOOL_VCC100-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 216 | TOOL_VCC100-PCH_EXTENDS := VCC100
|
---|
| 217 | TOOL_VCC100-PCH_CXXOBJSUFF := .obj
|
---|
| 218 | TOOL_VCC100-PCH_CXXINCS = $(TOOL_VCC100_CXXINCS)
|
---|
[2964] | 219 | TOOL_VCC100-PCH_CXXFLAGS.debug = $(TOOL_VCC100_CXXFLAGS.debug)
|
---|
| 220 | TOOL_VCC100-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC100_CXXFLAGS.dbgopt)
|
---|
| 221 | TOOL_VCC100-PCH_CXXFLAGS.release = $(TOOL_VCC100_CXXFLAGS.release)
|
---|
| 222 | TOOL_VCC100-PCH_CXXFLAGS.profile = $(TOOL_VCC100_CXXFLAGS.profile)
|
---|
[2954] | 223 | TOOL_VCC100-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 224 | TOOL_VCC100-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 225 | TOOL_VCC100-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 226 | TOOL_VCC100-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 227 | ifdef TOOL_VCC100_KSUBMIT
|
---|
| 228 | define TOOL_VCC100-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 229 | $(QUIET)$(TOOL_VCC100_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
[2954] | 230 | -- $(TOOL_VCC100_CXX) -c -Yc\
|
---|
[2960] | 231 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2954] | 232 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 233 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 234 | -Fo$(obj)\
|
---|
| 235 | -TP \
|
---|
| 236 | $(subst /,\\,$(abspath $(source)))
|
---|
| 237 | endef
|
---|
| 238 | else
|
---|
| 239 | define TOOL_VCC100-PCH_COMPILE_CXX_CMDS
|
---|
| 240 | $(QUIET)$(TOOL_VCC100_CXX) -c -Yc\
|
---|
| 241 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 242 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 243 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 244 | -Fo$(obj)\
|
---|
| 245 | -TP \
|
---|
| 246 | $(subst /,\\,$(abspath $(source)))
|
---|
| 247 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 248 |
|
---|
| 249 | endef
|
---|
| 250 | endif # !TOOL_VCC100_KSUBMIT
|
---|
| 251 |
|
---|
| 252 |
|
---|
[2611] | 253 | ## @todo configure the assembler template.
|
---|
[819] | 254 |
|
---|
| 255 | ## Compile resource source.
|
---|
| 256 | # @param $(target) Normalized main target name.
|
---|
| 257 | # @param $(source) Source filename (relative).
|
---|
| 258 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 259 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 260 | # @param $(flags) Flags.
|
---|
| 261 | # @param $(defs) Definitions. No -D or something.
|
---|
| 262 | # @param $(incs) Includes. No -I or something.
|
---|
| 263 | # @param $(dirdep) Directory creation dependency.
|
---|
| 264 | # @param $(deps) Other dependencies.
|
---|
| 265 | #
|
---|
| 266 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 267 | # @param $(objsuff) Object suffix.
|
---|
[2408] | 268 | TOOL_VCC100_COMPILE_RC_OUTPUT =
|
---|
| 269 | TOOL_VCC100_COMPILE_RC_DEPEND =
|
---|
| 270 | TOOL_VCC100_COMPILE_RC_DEPORD =
|
---|
| 271 | define TOOL_VCC100_COMPILE_RC_CMDS
|
---|
| 272 | $(QUIET)$(TOOL_VCC100_RC) \
|
---|
[819] | 273 | $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
|
---|
| 274 | /fo$(obj)\
|
---|
| 275 | $(subst /,\\,$(abspath $(source)))
|
---|
| 276 | endef
|
---|
| 277 |
|
---|
| 278 |
|
---|
| 279 | ## Link library
|
---|
| 280 | # @param $(target) Normalized main target name.
|
---|
| 281 | # @param $(out) Library name.
|
---|
| 282 | # @param $(objs) Object files to put in the library.
|
---|
| 283 | # @param $(flags) Flags.
|
---|
| 284 | # @param $(dirdep) Directory creation dependency.
|
---|
| 285 | # @param $(deps) Other dependencies.
|
---|
| 286 | # @param $(othersrc) Unhandled sources.
|
---|
| 287 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 288 | #
|
---|
[2408] | 289 | TOOL_VCC100_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 290 | TOOL_VCC100_LINK_LIBRARY_DEPORD =
|
---|
| 291 | TOOL_VCC100_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 292 | TOOL_VCC100_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 293 | define TOOL_VCC100_LINK_LIBRARY_CMDS
|
---|
[2557] | 294 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[819] | 295 | $(foreach arg,\
|
---|
| 296 | $(subst /,\\,$(objs) \
|
---|
| 297 | $(filter-out %.def,$(othersrc))) \
|
---|
| 298 | $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
|
---|
| 299 | ,\"$(arg)\")
|
---|
[2408] | 300 | $(QUIET)$(TOOL_VCC100_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[819] | 301 | endef
|
---|
| 302 |
|
---|
| 303 |
|
---|
| 304 | ## Link program
|
---|
| 305 | # @param $(target) Normalized main target name.
|
---|
| 306 | # @param $(out) Program name.
|
---|
| 307 | # @param $(objs) Object files to link together.
|
---|
| 308 | # @param $(libs) Libraries to search.
|
---|
| 309 | # @param $(libpath) Library search paths.
|
---|
| 310 | # @param $(flags) Flags.
|
---|
| 311 | # @param $(dirdep) Directory creation dependency.
|
---|
| 312 | # @param $(deps) Other dependencies.
|
---|
| 313 | # @param $(othersrc) Unhandled sources.
|
---|
| 314 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 315 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 316 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 317 | #
|
---|
[2408] | 318 | TOOL_VCC100_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 319 | TOOL_VCC100_LINK_PROGRAM_DEPORD =
|
---|
[2677] | 320 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
[3303] | 321 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
[2524] | 322 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 323 | TOOL_VCC100_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
[2408] | 324 | define TOOL_VCC100_LINK_PROGRAM_CMDS
|
---|
[2557] | 325 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 326 | $(foreach arg,\
|
---|
| 327 | $(subst /,\\,$(objs)) \
|
---|
| 328 | $(subst /,\\,$(libs)) \
|
---|
| 329 | ,\"$(arg)\")
|
---|
[2408] | 330 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \
|
---|
[819] | 331 | /OUT:$(out) \
|
---|
| 332 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 333 | /MAP:$(outbase).map \
|
---|
| 334 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 335 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 336 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 337 | @$(outbase).rsp
|
---|
[2735] | 338 | ifndef TOOL_VCC100_NO_AUTO_MANIFEST
|
---|
[1295] | 339 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[2408] | 340 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 341 | endif
|
---|
[819] | 342 | endef
|
---|
| 343 |
|
---|
| 344 |
|
---|
| 345 | ## Link DLL.
|
---|
| 346 | # @param $(target) Normalized main target name.
|
---|
| 347 | # @param $(out) DLL name.
|
---|
| 348 | # @param $(objs) Object files to link together.
|
---|
| 349 | # @param $(libs) Libraries to search.
|
---|
| 350 | # @param $(libpath) Library search paths.
|
---|
| 351 | # @param $(flags) Flags.
|
---|
| 352 | # @param $(dirdep) Directory creation dependency.
|
---|
| 353 | # @param $(deps) Other dependencies.
|
---|
| 354 | # @param $(othersrc) Unhandled sources.
|
---|
| 355 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 356 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 357 | #
|
---|
| 358 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[2408] | 359 | TOOL_VCC100_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
[2487] | 360 | TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
[3303] | 361 | TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
[2795] | 362 | TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
[3303] | 363 | TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
[2524] | 364 | TOOL_VCC100_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 365 | TOOL_VCC100_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
[2408] | 366 | define TOOL_VCC100_LINK_DLL_CMDS
|
---|
[2557] | 367 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 368 | $(foreach arg,\
|
---|
| 369 | $(subst /,\\,$(objs)) \
|
---|
| 370 | $(subst /,\\,$(libs)) \
|
---|
| 371 | ,\"$(arg)\")
|
---|
[2408] | 372 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \
|
---|
[819] | 373 | /OUT:$(out) \
|
---|
| 374 | /IMPLIB:$(outbase).lib \
|
---|
| 375 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 376 | /MAP:$(outbase).map \
|
---|
| 377 | /DLL \
|
---|
| 378 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 379 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 380 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 381 | @$(outbase).rsp
|
---|
[2735] | 382 | ifndef TOOL_VCC100_NO_AUTO_MANIFEST
|
---|
[1295] | 383 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[2408] | 384 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 385 | endif
|
---|
[2795] | 386 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
[2487] | 387 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
| 388 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[819] | 389 | endef
|
---|
| 390 |
|
---|
| 391 |
|
---|
| 392 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 393 | # @param $(target) Normalized main target name.
|
---|
| 394 | # @param $(out) System module name.
|
---|
| 395 | # @param $(objs) Object files to link together.
|
---|
| 396 | # @param $(libs) Libraries to search.
|
---|
| 397 | # @param $(libpath) Library search paths.
|
---|
| 398 | # @param $(flags) Flags.
|
---|
| 399 | # @param $(dirdep) Directory creation dependency.
|
---|
| 400 | # @param $(deps) Other dependencies.
|
---|
| 401 | # @param $(othersrc) Unhandled sources.
|
---|
| 402 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 403 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 404 | #
|
---|
| 405 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[2408] | 406 | TOOL_VCC100_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 407 | TOOL_VCC100_LINK_SYSMOD_DEPORD =
|
---|
[2524] | 408 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
[3303] | 409 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
[2524] | 410 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 411 | TOOL_VCC100_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
[2408] | 412 | define TOOL_VCC100_LINK_SYSMOD_CMDS
|
---|
[2557] | 413 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 414 | $(foreach arg,\
|
---|
| 415 | $(subst /,\\,$(objs)) \
|
---|
| 416 | $(subst /,\\,$(libs)) \
|
---|
| 417 | ,\"$(arg)\")
|
---|
[2408] | 418 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \
|
---|
[819] | 419 | /OUT:$(out) \
|
---|
| 420 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 421 | /MAP:$(outbase).map \
|
---|
| 422 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 423 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 424 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 425 | @$(outbase).rsp
|
---|
[2735] | 426 | ifndef TOOL_VCC100_NO_AUTO_MANIFEST
|
---|
[1295] | 427 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[2408] | 428 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 429 | endif
|
---|
[819] | 430 | endef
|
---|
| 431 |
|
---|