[434] | 1 | # $Id: VCC120AMD64.kmk 3303 2020-01-14 15:09:44Z bird $
|
---|
| 2 | ## @file
|
---|
[3033] | 3 | # kBuild Tool Config - Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting AMD64.
|
---|
[434] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[434] | 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 | #
|
---|
[434] | 33 |
|
---|
[3033] | 34 | TOOL_VCC120AMD64 := Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting AMD64
|
---|
[434] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[3033] | 37 | ifndef PATH_TOOL_VCC120AMD64
|
---|
| 38 | PATH_TOOL_VCC120AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v12*)
|
---|
| 39 | ifeq ($(PATH_TOOL_VCC120AMD64),)
|
---|
| 40 | PATH_TOOL_VCC120AMD64 := $(PATH_TOOL_VCC120)
|
---|
[667] | 41 | endif
|
---|
[3033] | 42 | ifeq ($(PATH_TOOL_VCC120AMD64),)
|
---|
| 43 | PATH_TOOL_VCC120AMD64 := $(PATH_TOOL_VCC120X86)
|
---|
[706] | 44 | endif
|
---|
[3033] | 45 | ifeq ($(PATH_TOOL_VCC120AMD64),)
|
---|
| 46 | PATH_TOOL_VCC120AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v12*)
|
---|
[667] | 47 | endif
|
---|
[3033] | 48 | ifneq ($(PATH_TOOL_VCC120AMD64),)
|
---|
| 49 | PATH_TOOL_VCC120AMD64 := $(lastword $(sort $(PATH_TOOL_VCC120AMD64)))
|
---|
[667] | 50 | else
|
---|
[3033] | 51 | $(warning kBuild: PATH_TOOL_VCC120AMD64 cannot be determined!)
|
---|
| 52 | PATH_TOOL_VCC120AMD64 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v12
|
---|
[667] | 53 | endif
|
---|
[434] | 54 | else
|
---|
[667] | 55 | # Resolve any fancy stuff once and for all.
|
---|
[3033] | 56 | PATH_TOOL_VCC120AMD64 := $(PATH_TOOL_VCC120AMD64)
|
---|
[434] | 57 | endif
|
---|
[3037] | 58 | if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.amd64" && exists("$(PATH_TOOL_VCC120AMD64)/bin/amd64") # Missing in express edition.
|
---|
[3033] | 59 | PATH_TOOL_VCC120AMD64_BIN ?= $(PATH_TOOL_VCC120AMD64)/bin/amd64
|
---|
[3044] | 60 | #$(error works now: $(PATH_TOOL_VCC120AMD64)/bin/amd64)
|
---|
[667] | 61 | else
|
---|
[3044] | 62 | #$(error no joy: $(PATH_TOOL_VCC120AMD64)/bin/amd64)
|
---|
[3036] | 63 | PATH_TOOL_VCC120AMD64_BIN_DLL ?= $(PATH_TOOL_VCC120AMD64)/bin
|
---|
[3033] | 64 | PATH_TOOL_VCC120AMD64_BIN ?= $(PATH_TOOL_VCC120AMD64)/bin/x86_amd64
|
---|
[667] | 65 | endif
|
---|
[3033] | 66 | PATH_TOOL_VCC120AMD64_LIB ?= $(PATH_TOOL_VCC120AMD64)/lib/amd64
|
---|
| 67 | PATH_TOOL_VCC120AMD64_INC ?= $(PATH_TOOL_VCC120AMD64)/include
|
---|
| 68 | PATH_TOOL_VCC120AMD64_ATLMFC ?= $(PATH_TOOL_VCC120AMD64)/atlmfc
|
---|
| 69 | PATH_TOOL_VCC120AMD64_ATLMFC_INC ?= $(PATH_TOOL_VCC120AMD64_ATLMFC)/include
|
---|
| 70 | PATH_TOOL_VCC120AMD64_ATLMFC_LIB ?= $(PATH_TOOL_VCC120AMD64_ATLMFC)/lib/amd64
|
---|
| 71 | TOOL_VCC120AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/cl.exe
|
---|
| 72 | TOOL_VCC120AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/cl.exe
|
---|
| 73 | TOOL_VCC120AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/ml64.exe
|
---|
| 74 | #TOOL_VCC120AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/lib.exe - just an exec wrapper for the below
|
---|
| 75 | TOOL_VCC120AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/link.exe /LIB
|
---|
| 76 | TOOL_VCC120AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/link.exe
|
---|
| 77 | TOOL_VCC120AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/dumpbin.exe
|
---|
| 78 | TOOL_VCC120AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/editbin.exe
|
---|
| 79 | TOOL_VCC120AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC120_RC_CACHED)
|
---|
| 80 | TOOL_VCC120AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC120_MT_CACHED)
|
---|
| 81 | ifdef TOOL_VCC120AMD64_USE_KSUBMIT
|
---|
[2870] | 82 | ifeq ($(KBUILD_HOST),win)
|
---|
[3033] | 83 | ifneq ($(substr $(PATH_TOOL_VCC120AMD64_BIN),-9),x86_amd64)
|
---|
| 84 | TOOL_VCC120AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
[3044] | 85 | ifdef PATH_TOOL_VCC120AMD64_BIN_DLL
|
---|
| 86 | TOOL_VCC120AMD64_KSUBMIT += --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)'
|
---|
| 87 | endif
|
---|
[3033] | 88 | TOOL_VCC120AMD64_KSUBMIT_DD = $(TOOL_VCC120AMD64_KSUBMIT) --
|
---|
[2870] | 89 | else
|
---|
[2919] | 90 | # "fatal error C1902: Program database manager mismatch; please check your installation" when mixing with the 32-bit compiler.
|
---|
[3033] | 91 | #TOOL_VCC120AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
| 92 | #TOOL_VCC120AMD64_KSUBMIT_DD = $(TOOL_VCC120AMD64_KSUBMIT) --
|
---|
[2870] | 93 | endif
|
---|
[2847] | 94 | endif
|
---|
[3036] | 95 | else ifdef PATH_TOOL_VCC120AMD64_BIN_DLL
|
---|
[3044] | 96 | TOOL_VCC120AMD64_KSUBMIT_DD = $(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' --
|
---|
[2847] | 97 | endif
|
---|
[2604] | 98 |
|
---|
[3033] | 99 | # The following in duplicated in VCC120.kmk and VCC120X86.kmk.
|
---|
| 100 | TOOL_VCC120_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
|
---|
[2606] | 101 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
| 102 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
| 103 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
| 104 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
[2609] | 105 | $1))
|
---|
[3033] | 106 | TOOL_VCC120_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC120_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
[2604] | 107 |
|
---|
[735] | 108 | ## Disabled fast DEP_IDB based dependencies.
|
---|
[3033] | 109 | #VCC120AMD64_OLD_DEPS = 1
|
---|
[434] | 110 |
|
---|
| 111 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
| 112 | # @param $(1) Base name, no extention.
|
---|
| 113 | # @param $(2) The extension.
|
---|
[3033] | 114 | TOOL_VCC120AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
[434] | 115 |
|
---|
[2954] | 116 |
|
---|
| 117 | # General Properties used by kBuild
|
---|
[3033] | 118 | TOOL_VCC120AMD64_COBJSUFF ?= .obj
|
---|
| 119 | TOOL_VCC120AMD64_CFLAGS ?= -TC -nologo -Zi
|
---|
| 120 | TOOL_VCC120AMD64_CFLAGS.debug ?=
|
---|
| 121 | TOOL_VCC120AMD64_CFLAGS.dbgopt ?= -O2
|
---|
| 122 | TOOL_VCC120AMD64_CFLAGS.release ?= -O2
|
---|
| 123 | TOOL_VCC120AMD64_CFLAGS.profile ?= -O2
|
---|
| 124 | TOOL_VCC120AMD64_CINCS ?= $(PATH_TOOL_VCC120AMD64_INC)
|
---|
| 125 | TOOL_VCC120AMD64_CDEFS ?=
|
---|
[434] | 126 |
|
---|
[3033] | 127 | TOOL_VCC120AMD64_CXXOBJSUFF ?= .obj
|
---|
| 128 | TOOL_VCC120AMD64_CXXFLAGS ?= -TP -nologo -Zi
|
---|
| 129 | TOOL_VCC120AMD64_CXXFLAGS.debug ?=
|
---|
| 130 | TOOL_VCC120AMD64_CXXFLAGS.dbgopt ?= -O2
|
---|
| 131 | TOOL_VCC120AMD64_CXXFLAGS.release ?= -O2
|
---|
| 132 | TOOL_VCC120AMD64_CXXFLAGS.profile ?= -O2
|
---|
| 133 | TOOL_VCC120AMD64_CXXINCS ?= $(PATH_TOOL_VCC120AMD64_INC) $(PATH_TOOL_VCC120AMD64_ATLMFC_INC)
|
---|
| 134 | TOOL_VCC120AMD64_CXXDEFS ?=
|
---|
[434] | 135 |
|
---|
[3033] | 136 | TOOL_VCC120AMD64_ASOBJSUFF ?= .obj
|
---|
[434] | 137 |
|
---|
[3033] | 138 | TOOL_VCC120AMD64_RCOBJSUFF ?= .res
|
---|
| 139 | TOOL_VCC120AMD64_RCINCS ?= $(PATH_TOOL_VCC120AMD64_INC) $(PATH_TOOL_VCC120AMD64_ATLMFC_INC)
|
---|
[667] | 140 |
|
---|
[3033] | 141 | TOOL_VCC120AMD64_ARFLAGS ?= -nologo -machine:amd64
|
---|
| 142 | TOOL_VCC120AMD64_ARLIBSUFF ?= .lib
|
---|
[667] | 143 |
|
---|
[3033] | 144 | TOOL_VCC120AMD64_LDFLAGS ?= -nologo -machine:amd64
|
---|
| 145 | TOOL_VCC120AMD64_LDFLAGS.debug ?= -debug
|
---|
| 146 | TOOL_VCC120AMD64_LDFLAGS.dbgopt ?= -debug
|
---|
| 147 | TOOL_VCC120AMD64_LDFLAGS.profile ?= -debug
|
---|
| 148 | TOOL_VCC120AMD64_LDFLAGS.release ?=
|
---|
[667] | 149 |
|
---|
| 150 |
|
---|
| 151 |
|
---|
[434] | 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.
|
---|
[3033] | 165 | TOOL_VCC120AMD64_COMPILE_C_DEPEND =
|
---|
| 166 | TOOL_VCC120AMD64_COMPILE_C_DEPORD =
|
---|
| 167 | TOOL_VCC120AMD64_COMPILE_C_OUTPUT =
|
---|
| 168 | TOOL_VCC120AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,idb)
|
---|
| 169 | ifdef TOOL_VCC120AMD64_KSUBMIT
|
---|
| 170 | TOOL_VCC120AMD64_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 171 | define TOOL_VCC120AMD64_COMPILE_C_CMDS
|
---|
| 172 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 173 | -- $(TOOL_VCC120AMD64_CC) -c\
|
---|
[434] | 174 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 175 | -Fd$(outbase)-obj.pdb \
|
---|
| 176 | -Fo$(obj)\
|
---|
[697] | 177 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 178 | endef
|
---|
| 179 | else
|
---|
[3033] | 180 | define TOOL_VCC120AMD64_COMPILE_C_CMDS
|
---|
[3036] | 181 | $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
|
---|
[3044] | 182 | ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CC) -c\
|
---|
[2895] | 183 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 184 | -Fd$(outbase)-obj.pdb \
|
---|
| 185 | -Fo$(obj)\
|
---|
| 186 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 187 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
| 188 | endef
|
---|
[3033] | 189 | endif # !TOOL_VCC120AMD64_KSUBMIT
|
---|
[434] | 190 |
|
---|
| 191 |
|
---|
| 192 | ## Compile C++ source.
|
---|
| 193 | # @param $(target) Normalized main target name.
|
---|
| 194 | # @param $(source) Source filename (relative).
|
---|
| 195 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 196 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 197 | # @param $(flags) Flags.
|
---|
| 198 | # @param $(defs) Definitions. No -D or something.
|
---|
| 199 | # @param $(incs) Includes. No -I or something.
|
---|
| 200 | # @param $(dirdep) Directory creation dependency.
|
---|
| 201 | # @param $(deps) Other dependencies.
|
---|
| 202 | #
|
---|
| 203 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 204 | # @param $(objsuff) Object suffix.
|
---|
[3033] | 205 | TOOL_VCC120AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
| 206 | TOOL_VCC120AMD64_COMPILE_CXX_DEPORD =
|
---|
| 207 | TOOL_VCC120AMD64_COMPILE_CXX_OUTPUT =
|
---|
| 208 | TOOL_VCC120AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 209 | ,,$(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,idb))
|
---|
| 210 | ifdef TOOL_VCC120AMD64_KSUBMIT
|
---|
| 211 | TOOL_VCC120AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 212 | define TOOL_VCC120AMD64_COMPILE_CXX_CMDS
|
---|
| 213 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 214 | -- $(TOOL_VCC120AMD64_CXX) -c\
|
---|
[434] | 215 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2956] | 216 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
[3033] | 217 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
[2956] | 218 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[434] | 219 | -Fo$(obj)\
|
---|
[697] | 220 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 221 | endef
|
---|
| 222 | else
|
---|
[3033] | 223 | define TOOL_VCC120AMD64_COMPILE_CXX_CMDS
|
---|
[3036] | 224 | $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
|
---|
[3044] | 225 | ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CXX) -c\
|
---|
[2895] | 226 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2956] | 227 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
[3033] | 228 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
[2956] | 229 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[2895] | 230 | -Fo$(obj)\
|
---|
| 231 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 232 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
| 233 | endef
|
---|
[3033] | 234 | endif # !TOOL_VCC120AMD64_KSUBMIT
|
---|
[434] | 235 |
|
---|
[2954] | 236 |
|
---|
| 237 | #
|
---|
| 238 | # Helper tool for creating the precompiled C++ header.
|
---|
| 239 | #
|
---|
| 240 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 241 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 242 | #
|
---|
[3033] | 243 | TOOL_VCC120AMD64-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 244 | TOOL_VCC120AMD64-PCH_EXTENDS := VCC120AMD64
|
---|
| 245 | TOOL_VCC120AMD64-PCH_CXXOBJSUFF := .obj
|
---|
| 246 | TOOL_VCC120AMD64-PCH_CXXINCS = $(TOOL_VCC120AMD64_CXXINCS)
|
---|
| 247 | TOOL_VCC120AMD64-PCH_CXXFLAGS = $(TOOL_VCC120AMD64_CXXFLAGS) -FS
|
---|
| 248 | TOOL_VCC120AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC120AMD64_CXXFLAGS.debug)
|
---|
| 249 | TOOL_VCC120AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC120AMD64_CXXFLAGS.dbgopt)
|
---|
| 250 | TOOL_VCC120AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC120AMD64_CXXFLAGS.release)
|
---|
| 251 | TOOL_VCC120AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC120AMD64_CXXFLAGS.profile)
|
---|
| 252 | TOOL_VCC120AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 253 | TOOL_VCC120AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 254 | TOOL_VCC120AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 255 | TOOL_VCC120AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 256 | ifdef TOOL_VCC120AMD64_KSUBMIT
|
---|
| 257 | define TOOL_VCC120AMD64-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 258 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3033] | 259 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
| 260 | -- $(TOOL_VCC120AMD64_CXX) -c -Yc\
|
---|
[2960] | 261 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2954] | 262 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 263 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 264 | -Fo$(obj)\
|
---|
| 265 | -TP \
|
---|
| 266 | $(subst /,\\,$(abspath $(source)))
|
---|
| 267 | endef
|
---|
| 268 | else
|
---|
[3033] | 269 | define TOOL_VCC120AMD64-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 270 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3036] | 271 | $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
|
---|
[3044] | 272 | ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CXX) -c -Yc\
|
---|
[2954] | 273 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 274 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 275 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 276 | -Fo$(obj)\
|
---|
| 277 | -TP \
|
---|
| 278 | $(subst /,\\,$(abspath $(source)))
|
---|
| 279 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 280 |
|
---|
| 281 | endef
|
---|
[3033] | 282 | endif # !TOOL_VCC120AMD64_KSUBMIT
|
---|
[2954] | 283 |
|
---|
| 284 |
|
---|
[2611] | 285 | ## @todo configure the assembler template.
|
---|
| 286 |
|
---|
[641] | 287 | ## Compile resource source.
|
---|
| 288 | # @param $(target) Normalized main target name.
|
---|
| 289 | # @param $(source) Source filename (relative).
|
---|
| 290 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 291 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 292 | # @param $(flags) Flags.
|
---|
| 293 | # @param $(defs) Definitions. No -D or something.
|
---|
| 294 | # @param $(incs) Includes. No -I or something.
|
---|
| 295 | # @param $(dirdep) Directory creation dependency.
|
---|
| 296 | # @param $(deps) Other dependencies.
|
---|
| 297 | #
|
---|
| 298 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 299 | # @param $(objsuff) Object suffix.
|
---|
[3033] | 300 | TOOL_VCC120AMD64_COMPILE_RC_DEPEND =
|
---|
| 301 | TOOL_VCC120AMD64_COMPILE_RC_DEPORD =
|
---|
| 302 | TOOL_VCC120AMD64_COMPILE_RC_OUTPUT =
|
---|
[3036] | 303 | ## @todo Fix kmk_redirect so we can use it for setting PATH without spawning a shell or two
|
---|
[3033] | 304 | define TOOL_VCC120AMD64_COMPILE_RC_CMDS
|
---|
[3036] | 305 | $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
|
---|
[3044] | 306 | ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_RC) \
|
---|
[641] | 307 | $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
|
---|
| 308 | /fo$(obj)\
|
---|
[697] | 309 | $(subst /,\\,$(abspath $(source)))
|
---|
[641] | 310 | endef
|
---|
| 311 |
|
---|
| 312 |
|
---|
[434] | 313 | ## Link library
|
---|
| 314 | # @param $(target) Normalized main target name.
|
---|
| 315 | # @param $(out) Library name.
|
---|
| 316 | # @param $(objs) Object files to put in the library.
|
---|
| 317 | # @param $(flags) Flags.
|
---|
| 318 | # @param $(dirdep) Directory creation dependency.
|
---|
| 319 | # @param $(deps) Other dependencies.
|
---|
| 320 | # @param $(othersrc) Unhandled sources.
|
---|
| 321 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 322 | #
|
---|
[3033] | 323 | TOOL_VCC120AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 324 | TOOL_VCC120AMD64_LINK_LIBRARY_DEPORD =
|
---|
| 325 | TOOL_VCC120AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 326 | TOOL_VCC120AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 327 | define TOOL_VCC120AMD64_LINK_LIBRARY_CMDS
|
---|
[2557] | 328 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[768] | 329 | $(foreach arg,\
|
---|
| 330 | $(subst /,\\,$(objs) \
|
---|
| 331 | $(filter-out %.def,$(othersrc))) \
|
---|
| 332 | $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
|
---|
| 333 | ,\"$(arg)\")
|
---|
[3033] | 334 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[768] | 335 | endef
|
---|
[434] | 336 |
|
---|
| 337 |
|
---|
| 338 | ## Link program
|
---|
| 339 | # @param $(target) Normalized main target name.
|
---|
| 340 | # @param $(out) Program name.
|
---|
| 341 | # @param $(objs) Object files to link together.
|
---|
| 342 | # @param $(libs) Libraries to search.
|
---|
| 343 | # @param $(libpath) Library search paths.
|
---|
| 344 | # @param $(flags) Flags.
|
---|
| 345 | # @param $(dirdep) Directory creation dependency.
|
---|
| 346 | # @param $(deps) Other dependencies.
|
---|
| 347 | # @param $(othersrc) Unhandled sources.
|
---|
| 348 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 349 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 350 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 351 | #
|
---|
[3033] | 352 | TOOL_VCC120AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 353 | TOOL_VCC120AMD64_LINK_PROGRAM_DEPORD =
|
---|
[3303] | 354 | TOOL_VCC120AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
[3033] | 355 | TOOL_VCC120AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 356 | TOOL_VCC120AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 357 | TOOL_VCC120AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 358 | define TOOL_VCC120AMD64_LINK_PROGRAM_CMDS
|
---|
[2557] | 359 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 360 | $(foreach arg,\
|
---|
| 361 | $(subst /,\\,$(objs)) \
|
---|
| 362 | $(subst /,\\,$(libs)) \
|
---|
| 363 | ,\"$(arg)\")
|
---|
[3033] | 364 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_LD) $(flags) \
|
---|
[434] | 365 | /OUT:$(out) \
|
---|
[437] | 366 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 367 | /MAP:$(outbase).map \
|
---|
| 368 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 369 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 370 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 371 | @$(outbase).rsp
|
---|
[3033] | 372 | ifndef TOOL_VCC120AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 373 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3033] | 374 | $(TOOL_VCC120AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 375 | endif
|
---|
[434] | 376 | endef
|
---|
| 377 |
|
---|
| 378 |
|
---|
| 379 | ## Link DLL.
|
---|
| 380 | # @param $(target) Normalized main target name.
|
---|
| 381 | # @param $(out) DLL name.
|
---|
| 382 | # @param $(objs) Object files to link together.
|
---|
| 383 | # @param $(libs) Libraries to search.
|
---|
| 384 | # @param $(libpath) Library search paths.
|
---|
| 385 | # @param $(flags) Flags.
|
---|
| 386 | # @param $(dirdep) Directory creation dependency.
|
---|
| 387 | # @param $(deps) Other dependencies.
|
---|
| 388 | # @param $(othersrc) Unhandled sources.
|
---|
| 389 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 390 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 391 | #
|
---|
| 392 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3033] | 393 | TOOL_VCC120AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 394 | TOOL_VCC120AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
[3303] | 395 | TOOL_VCC120AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
[3033] | 396 | TOOL_VCC120AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
[3303] | 397 | TOOL_VCC120AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
[3033] | 398 | TOOL_VCC120AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 399 | TOOL_VCC120AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 400 | define TOOL_VCC120AMD64_LINK_DLL_CMDS
|
---|
[2557] | 401 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 402 | $(foreach arg,\
|
---|
| 403 | $(subst /,\\,$(objs)) \
|
---|
| 404 | $(subst /,\\,$(libs)) \
|
---|
| 405 | ,\"$(arg)\")
|
---|
[3033] | 406 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_LD) $(flags) \
|
---|
[434] | 407 | /OUT:$(out) \
|
---|
| 408 | /IMPLIB:$(outbase).lib \
|
---|
[437] | 409 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 410 | /MAP:$(outbase).map \
|
---|
| 411 | /DLL \
|
---|
| 412 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 413 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 414 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 415 | @$(outbase).rsp
|
---|
[3033] | 416 | ifndef TOOL_VCC120AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 417 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3033] | 418 | $(TOOL_VCC120AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 419 | endif
|
---|
[2795] | 420 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
| 421 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
[2487] | 422 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[434] | 423 | endef
|
---|
| 424 |
|
---|
| 425 |
|
---|
| 426 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 427 | # @param $(target) Normalized main target name.
|
---|
| 428 | # @param $(out) System module name.
|
---|
| 429 | # @param $(objs) Object files to link together.
|
---|
| 430 | # @param $(libs) Libraries to search.
|
---|
| 431 | # @param $(libpath) Library search paths.
|
---|
| 432 | # @param $(flags) Flags.
|
---|
| 433 | # @param $(dirdep) Directory creation dependency.
|
---|
| 434 | # @param $(deps) Other dependencies.
|
---|
| 435 | # @param $(othersrc) Unhandled sources.
|
---|
| 436 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 437 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 438 | #
|
---|
| 439 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3033] | 440 | TOOL_VCC120AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 441 | TOOL_VCC120AMD64_LINK_SYSMOD_DEPORD =
|
---|
| 442 | TOOL_VCC120AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
[3303] | 443 | TOOL_VCC120AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
[3033] | 444 | TOOL_VCC120AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 445 | TOOL_VCC120AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 446 | define TOOL_VCC120AMD64_LINK_SYSMOD_CMDS
|
---|
[2557] | 447 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 448 | $(foreach arg,\
|
---|
| 449 | $(subst /,\\,$(objs)) \
|
---|
| 450 | $(subst /,\\,$(libs)) \
|
---|
| 451 | ,\"$(arg)\")
|
---|
[3033] | 452 | $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_LD) $(flags) \
|
---|
[434] | 453 | /OUT:$(out) \
|
---|
[437] | 454 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 455 | /MAP:$(outbase).map \
|
---|
| 456 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 457 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 458 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 459 | @$(outbase).rsp
|
---|
[3033] | 460 | ifndef TOOL_VCC120AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 461 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3033] | 462 | $(TOOL_VCC120AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 463 | endif
|
---|
[434] | 464 | endef
|
---|
| 465 |
|
---|