[434] | 1 | # $Id: VCC141AMD64.kmk 3597 2023-06-16 20:56:17Z bird $
|
---|
| 2 | ## @file
|
---|
[3323] | 3 | # kBuild Tool Config - Visual C++ 14.1 (aka Visual 2017 and MSC v19.10), targeting AMD64.
|
---|
[434] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3323] | 7 | # Copyright (c) 2004-2020 knut st. osmundsen <bird-kBuild-spam-xx@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 |
|
---|
[3323] | 34 | ifndef TOOL_VCC141
|
---|
| 35 | include $(KBUILD_PATH)/tools/VCC141.kmk
|
---|
| 36 | endif
|
---|
[434] | 37 |
|
---|
[3323] | 38 | TOOL_VCC141AMD64 := Visual C++ 14.1 (aka Visual 2017 and MSC v19.1), targeting AMD64
|
---|
| 39 |
|
---|
| 40 | #
|
---|
[667] | 41 | # Tool Specific Properties
|
---|
[3323] | 42 | #
|
---|
| 43 | ifndef PATH_TOOL_VCC141AMD64
|
---|
| 44 | PATH_TOOL_VCC141AMD64 := $(PATH_TOOL_VCC141)
|
---|
[434] | 45 | else
|
---|
[667] | 46 | # Resolve any fancy stuff once and for all.
|
---|
[3323] | 47 | PATH_TOOL_VCC141AMD64 := $(PATH_TOOL_VCC141AMD64)
|
---|
[434] | 48 | endif
|
---|
[3323] | 49 |
|
---|
| 50 | ifndef PATH_TOOL_VCC141AMD64_BIN
|
---|
| 51 | PATH_TOOL_VCC141AMD64_BIN := $(PATH_TOOL_VCC141_HOST_BIN)/x64
|
---|
[667] | 52 | else
|
---|
[3346] | 53 | PATH_TOOL_VCC141AMD64_BIN := $(PATH_TOOL_VCC141AMD64_BIN)
|
---|
[667] | 54 | endif
|
---|
[3323] | 55 | PATH_TOOL_VCC141AMD64_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC141AMD64_BIN))
|
---|
| 56 |
|
---|
[3331] | 57 | # A bunch of DLLs are only in the subdir matching the host one, so we need to add it to the PATH when cross compiling.
|
---|
| 58 | ifndef PATH_TOOL_VCC141AMD64_DLL_BIN
|
---|
| 59 | ifneq ($(PATH_TOOL_VCC141_HOST_DLL_BIN),$(PATH_TOOL_VCC141AMD64_BIN))
|
---|
| 60 | PATH_TOOL_VCC141AMD64_DLL_BIN := $(PATH_TOOL_VCC141_HOST_DLL_BIN)
|
---|
| 61 | endif
|
---|
| 62 | endif
|
---|
| 63 |
|
---|
[3323] | 64 | ifndef PATH_TOOL_VCC141AMD64_LIB
|
---|
| 65 | PATH_TOOL_VCC141AMD64_LIB := $(PATH_TOOL_VCC141_LIB.amd64)
|
---|
| 66 | endif
|
---|
| 67 | ifndef PATH_TOOL_VCC141_ONECORE_LIB
|
---|
| 68 | PATH_TOOL_VCC141_ONECORE_LIB := $(PATH_TOOL_VCC141_ONECORE_LIB.amd64)
|
---|
| 69 | endif
|
---|
| 70 |
|
---|
| 71 | ifndef PATH_TOOL_VCC141AMD64_INC
|
---|
| 72 | PATH_TOOL_VCC141AMD64_INC := $(PATH_TOOL_VCC141_INC)
|
---|
| 73 | endif
|
---|
| 74 |
|
---|
| 75 | ifndef PATH_TOOL_VCC141AMD64_ATLMFC_INC
|
---|
| 76 | PATH_TOOL_VCC141AMD64_ATLMFC_INC := $(PATH_TOOL_VCC141_ATLMFC_INC.amd64)
|
---|
| 77 | endif
|
---|
| 78 | ifndef PATH_TOOL_VCC141AMD64_ATLMFC_LIB
|
---|
| 79 | PATH_TOOL_VCC141AMD64_ATLMFC_LIB := $(PATH_TOOL_VCC141_ATLMFC_LIB.amd64)
|
---|
| 80 | endif
|
---|
| 81 |
|
---|
| 82 | TOOL_VCC141AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/cl.exe
|
---|
| 83 | TOOL_VCC141AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/cl.exe
|
---|
| 84 | TOOL_VCC141AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/ml64.exe
|
---|
| 85 | #TOOL_VCC141AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
| 86 | TOOL_VCC141AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/link.exe /LIB
|
---|
| 87 | TOOL_VCC141AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/link.exe
|
---|
| 88 | TOOL_VCC141AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/dumpbin.exe
|
---|
| 89 | TOOL_VCC141AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/editbin.exe
|
---|
| 90 |
|
---|
[3597] | 91 | TOOL_VCC141AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
|
---|
| 92 | TOOL_VCC141AMD64_MT ?= $(TOOL_VCC141AMD64_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
|
---|
| 93 | TOOL_VCC141AMD64_MT_RETRY ?= $(TOOL_VCC141_MT_RETRY)
|
---|
[3323] | 94 |
|
---|
| 95 | undefine TOOL_VCC141AMD64_USE_KSUBMIT # for now
|
---|
| 96 | ifdef TOOL_VCC141AMD64_USE_KSUBMIT
|
---|
[2870] | 97 | ifeq ($(KBUILD_HOST),win)
|
---|
[3323] | 98 | ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC141AMD64_BIN)),-3),64/)
|
---|
| 99 | TOOL_VCC141AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
[2870] | 100 | else
|
---|
[3323] | 101 | TOOL_VCC141AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
[2870] | 102 | endif
|
---|
[3331] | 103 | ifdef PATH_TOOL_VCC141AMD64_DLL_BIN
|
---|
| 104 | TOOL_VCC141AMD64_KSUBMIT := $(TOOL_VCC141AMD64_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC141AMD64_DLL_BIN));"
|
---|
| 105 | endif
|
---|
| 106 | TOOL_VCC141AMD64_KSUBMIT_DD := $(TOOL_VCC141AMD64_KSUBMIT) --
|
---|
[2847] | 107 | endif
|
---|
| 108 | endif
|
---|
[3331] | 109 | ifdef PATH_TOOL_VCC141AMD64_DLL_BIN
|
---|
| 110 | TOOL_VCC141AMD64_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC141AMD64_DLL_BIN));" --$(SP)
|
---|
| 111 | ifndef TOOL_VCC141AMD64_KSUBMIT_DD
|
---|
| 112 | TOOL_VCC141AMD64_KSUBMIT_DD := $(TOOL_VCC141AMD64_SETUP_ENV)
|
---|
| 113 | endif
|
---|
| 114 | endif
|
---|
[2604] | 115 |
|
---|
[3329] | 116 | # Redist (more stuff in VCC141.kmk).
|
---|
| 117 | PATH_TOOL_VCC141AMD64_REDIST ?= $(PATH_TOOL_VCC141_REDIST)/x64
|
---|
| 118 | PATH_TOOL_VCC141AMD64_REDIST_CRT = $(PATH_TOOL_VCC141AMD64_REDIST)/$(TOOL_VCC141_REDIST_CRT_SUBDIR)
|
---|
| 119 | PATH_TOOL_VCC141AMD64_REDIST_DEBUG ?= $(PATH_TOOL_VCC141_REDIST_DEBUG)/x64
|
---|
[3592] | 120 | PATH_TOOL_VCC141AMD64_REDIST_DEBUG_CRT = $(PATH_TOOL_VCC141AMD64_REDIST_DEBUG)/$(TOOL_VCC141_REDIST_DEBUG_CRT_SUBDIR)
|
---|
[3340] | 121 | TOOL_VCC141AMD64_REDIST_CRT_DLLS = $(TOOL_VCC141_REDIST_CRT_DLLS.amd64)
|
---|
| 122 | TOOL_VCC141AMD64_REDIST_CONCRT_DLLS = $(TOOL_VCC141_REDIST_CONCRT_DLLS.amd64)
|
---|
| 123 | TOOL_VCC141AMD64_REDIST_CPP_DLLS = $(TOOL_VCC141_REDIST_CPP_DLLS.amd64)
|
---|
| 124 | TOOL_VCC141AMD64_REDIST_WINRT_DLLS = $(TOOL_VCC141_REDIST_WINRT_DLLS.amd64)
|
---|
[2604] | 125 |
|
---|
[3340] | 126 |
|
---|
[3323] | 127 | #
|
---|
| 128 | # Properties used by kBuild
|
---|
| 129 | #
|
---|
| 130 | TOOL_VCC141AMD64_COBJSUFF ?= .obj
|
---|
[3325] | 131 | TOOL_VCC141AMD64_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
[3323] | 132 | TOOL_VCC141AMD64_CFLAGS.debug ?=
|
---|
| 133 | TOOL_VCC141AMD64_CFLAGS.dbgopt ?= -O2
|
---|
| 134 | TOOL_VCC141AMD64_CFLAGS.release ?= -O2
|
---|
| 135 | TOOL_VCC141AMD64_CFLAGS.profile ?= -O2
|
---|
| 136 | TOOL_VCC141AMD64_CINCS ?= $(PATH_TOOL_VCC141AMD64_INC)
|
---|
| 137 | TOOL_VCC141AMD64_CDEFS ?=
|
---|
[434] | 138 |
|
---|
[3323] | 139 | TOOL_VCC141AMD64_CXXOBJSUFF ?= .obj
|
---|
[3325] | 140 | TOOL_VCC141AMD64_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
[3323] | 141 | TOOL_VCC141AMD64_CXXFLAGS.debug ?=
|
---|
| 142 | TOOL_VCC141AMD64_CXXFLAGS.dbgopt ?= -O2
|
---|
| 143 | TOOL_VCC141AMD64_CXXFLAGS.release ?= -O2
|
---|
| 144 | TOOL_VCC141AMD64_CXXFLAGS.profile ?= -O2
|
---|
| 145 | TOOL_VCC141AMD64_CXXINCS ?= $(PATH_TOOL_VCC141AMD64_INC) $(PATH_TOOL_VCC141AMD64_ATLMFC_INC)
|
---|
| 146 | TOOL_VCC141AMD64_CXXDEFS ?=
|
---|
[434] | 147 |
|
---|
[3323] | 148 | TOOL_VCC141AMD64_ASOBJSUFF ?= .obj
|
---|
[2954] | 149 |
|
---|
[3323] | 150 | TOOL_VCC141AMD64_RCOBJSUFF ?= .res
|
---|
| 151 | TOOL_VCC141AMD64_RCINCS ?= $(PATH_TOOL_VCC141AMD64_INC) $(PATH_TOOL_VCC141AMD64_ATLMFC_INC)
|
---|
[434] | 152 |
|
---|
[3323] | 153 | TOOL_VCC141AMD64_ARFLAGS ?= -nologo -machine:amd64
|
---|
| 154 | TOOL_VCC141AMD64_ARLIBSUFF ?= .lib
|
---|
[434] | 155 |
|
---|
[3323] | 156 | TOOL_VCC141AMD64_LDFLAGS ?= -nologo -machine:amd64
|
---|
| 157 | TOOL_VCC141AMD64_LDFLAGS.debug ?= -debug
|
---|
| 158 | TOOL_VCC141AMD64_LDFLAGS.dbgopt ?= -debug
|
---|
| 159 | TOOL_VCC141AMD64_LDFLAGS.profile ?= -debug
|
---|
| 160 | TOOL_VCC141AMD64_LDFLAGS.release ?=
|
---|
[434] | 161 |
|
---|
[667] | 162 |
|
---|
| 163 |
|
---|
[434] | 164 | ## Compile C source.
|
---|
| 165 | # @param $(target) Normalized main target name.
|
---|
| 166 | # @param $(source) Source filename (relative).
|
---|
| 167 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 168 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 169 | # @param $(flags) Flags.
|
---|
| 170 | # @param $(defs) Definitions. No -D or something.
|
---|
| 171 | # @param $(incs) Includes. No -I or something.
|
---|
| 172 | # @param $(dirdep) Directory creation dependency.
|
---|
| 173 | # @param $(deps) Other dependencies.
|
---|
| 174 | #
|
---|
| 175 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 176 | # @param $(objsuff) Object suffix.
|
---|
[3323] | 177 | TOOL_VCC141AMD64_COMPILE_C_DEPEND =
|
---|
| 178 | TOOL_VCC141AMD64_COMPILE_C_DEPORD =
|
---|
| 179 | TOOL_VCC141AMD64_COMPILE_C_OUTPUT =
|
---|
| 180 | TOOL_VCC141AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb)
|
---|
| 181 | ifdef TOOL_VCC141AMD64_KSUBMIT
|
---|
| 182 | TOOL_VCC141AMD64_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 183 | define TOOL_VCC141AMD64_COMPILE_C_CMDS
|
---|
| 184 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 185 | -- $(TOOL_VCC141AMD64_CC) -c\
|
---|
| 186 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[434] | 187 | -Fd$(outbase)-obj.pdb \
|
---|
| 188 | -Fo$(obj)\
|
---|
[697] | 189 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 190 | endef
|
---|
| 191 | else
|
---|
[3323] | 192 | define TOOL_VCC141AMD64_COMPILE_C_CMDS
|
---|
[3331] | 193 | $(QUIET)$(TOOL_VCC141AMD64_SETUP_ENV)$(TOOL_VCC141AMD64_CC) -c\
|
---|
[3323] | 194 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2895] | 195 | -Fd$(outbase)-obj.pdb \
|
---|
| 196 | -Fo$(obj)\
|
---|
| 197 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 198 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
| 199 | endef
|
---|
[3323] | 200 | endif # !TOOL_VCC141AMD64_KSUBMIT
|
---|
[434] | 201 |
|
---|
| 202 |
|
---|
| 203 | ## Compile C++ source.
|
---|
| 204 | # @param $(target) Normalized main target name.
|
---|
| 205 | # @param $(source) Source filename (relative).
|
---|
| 206 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 207 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 208 | # @param $(flags) Flags.
|
---|
| 209 | # @param $(defs) Definitions. No -D or something.
|
---|
| 210 | # @param $(incs) Includes. No -I or something.
|
---|
| 211 | # @param $(dirdep) Directory creation dependency.
|
---|
| 212 | # @param $(deps) Other dependencies.
|
---|
| 213 | #
|
---|
| 214 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 215 | # @param $(objsuff) Object suffix.
|
---|
[3323] | 216 | TOOL_VCC141AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
| 217 | TOOL_VCC141AMD64_COMPILE_CXX_DEPORD =
|
---|
| 218 | TOOL_VCC141AMD64_COMPILE_CXX_OUTPUT =
|
---|
| 219 | TOOL_VCC141AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 220 | ,,$(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb))
|
---|
| 221 | ifdef TOOL_VCC141AMD64_KSUBMIT
|
---|
| 222 | TOOL_VCC141AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 223 | define TOOL_VCC141AMD64_COMPILE_CXX_CMDS
|
---|
| 224 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 225 | -- $(TOOL_VCC141AMD64_CXX) -c\
|
---|
| 226 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-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) \
|
---|
[434] | 230 | -Fo$(obj)\
|
---|
[697] | 231 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 232 | endef
|
---|
| 233 | else
|
---|
[3323] | 234 | define TOOL_VCC141AMD64_COMPILE_CXX_CMDS
|
---|
[3331] | 235 | $(QUIET)$(TOOL_VCC141AMD64_SETUP_ENV)$(TOOL_VCC141AMD64_CXX) -c\
|
---|
[3323] | 236 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2956] | 237 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
[3033] | 238 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
[2956] | 239 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[2895] | 240 | -Fo$(obj)\
|
---|
| 241 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 242 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
| 243 | endef
|
---|
[3323] | 244 | endif # !TOOL_VCC141AMD64_KSUBMIT
|
---|
[434] | 245 |
|
---|
[2954] | 246 |
|
---|
| 247 | #
|
---|
| 248 | # Helper tool for creating the precompiled C++ header.
|
---|
| 249 | #
|
---|
| 250 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 251 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 252 | #
|
---|
[3323] | 253 | TOOL_VCC141AMD64-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 254 | TOOL_VCC141AMD64-PCH_EXTENDS := VCC141AMD64
|
---|
| 255 | TOOL_VCC141AMD64-PCH_CXXOBJSUFF := .obj
|
---|
| 256 | TOOL_VCC141AMD64-PCH_CXXINCS = $(TOOL_VCC141AMD64_CXXINCS)
|
---|
| 257 | TOOL_VCC141AMD64-PCH_CXXFLAGS = $(TOOL_VCC141AMD64_CXXFLAGS) -FS
|
---|
| 258 | TOOL_VCC141AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC141AMD64_CXXFLAGS.debug)
|
---|
| 259 | TOOL_VCC141AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC141AMD64_CXXFLAGS.dbgopt)
|
---|
| 260 | TOOL_VCC141AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC141AMD64_CXXFLAGS.release)
|
---|
| 261 | TOOL_VCC141AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC141AMD64_CXXFLAGS.profile)
|
---|
| 262 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 263 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 264 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 265 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 266 | ifdef TOOL_VCC141AMD64_KSUBMIT
|
---|
| 267 | define TOOL_VCC141AMD64-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 268 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3323] | 269 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
| 270 | -- $(TOOL_VCC141AMD64_CXX) -c -Yc\
|
---|
| 271 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 272 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 273 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 274 | -Fo$(obj)\
|
---|
| 275 | -TP \
|
---|
| 276 | $(subst /,\\,$(abspath $(source)))
|
---|
| 277 | endef
|
---|
| 278 | else
|
---|
[3323] | 279 | define TOOL_VCC141AMD64-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 280 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3331] | 281 | $(QUIET)$(TOOL_VCC141AMD64_SETUP_ENV)$(TOOL_VCC141AMD64_CXX) -c -Yc\
|
---|
[3323] | 282 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 283 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 284 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 285 | -Fo$(obj)\
|
---|
| 286 | -TP \
|
---|
| 287 | $(subst /,\\,$(abspath $(source)))
|
---|
| 288 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 289 |
|
---|
| 290 | endef
|
---|
[3323] | 291 | endif # !TOOL_VCC141AMD64_KSUBMIT
|
---|
[2954] | 292 |
|
---|
| 293 |
|
---|
[2611] | 294 | ## @todo configure the assembler template.
|
---|
| 295 |
|
---|
[641] | 296 | ## Compile resource source.
|
---|
| 297 | # @param $(target) Normalized main target name.
|
---|
| 298 | # @param $(source) Source filename (relative).
|
---|
| 299 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 300 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 301 | # @param $(flags) Flags.
|
---|
| 302 | # @param $(defs) Definitions. No -D or something.
|
---|
| 303 | # @param $(incs) Includes. No -I or something.
|
---|
| 304 | # @param $(dirdep) Directory creation dependency.
|
---|
| 305 | # @param $(deps) Other dependencies.
|
---|
| 306 | #
|
---|
| 307 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 308 | # @param $(objsuff) Object suffix.
|
---|
[3323] | 309 | TOOL_VCC141AMD64_COMPILE_RC_DEPEND =
|
---|
| 310 | TOOL_VCC141AMD64_COMPILE_RC_DEPORD =
|
---|
| 311 | TOOL_VCC141AMD64_COMPILE_RC_OUTPUT =
|
---|
| 312 | define TOOL_VCC141AMD64_COMPILE_RC_CMDS
|
---|
| 313 | $(QUIET)$(TOOL_VCC141AMD64_RC) \
|
---|
| 314 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
[641] | 315 | /fo$(obj)\
|
---|
[697] | 316 | $(subst /,\\,$(abspath $(source)))
|
---|
[641] | 317 | endef
|
---|
| 318 |
|
---|
| 319 |
|
---|
[434] | 320 | ## Link library
|
---|
| 321 | # @param $(target) Normalized main target name.
|
---|
| 322 | # @param $(out) Library name.
|
---|
| 323 | # @param $(objs) Object files to put in the library.
|
---|
| 324 | # @param $(flags) Flags.
|
---|
| 325 | # @param $(dirdep) Directory creation dependency.
|
---|
| 326 | # @param $(deps) Other dependencies.
|
---|
| 327 | # @param $(othersrc) Unhandled sources.
|
---|
| 328 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 329 | #
|
---|
[3323] | 330 | TOOL_VCC141AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 331 | TOOL_VCC141AMD64_LINK_LIBRARY_DEPORD =
|
---|
| 332 | TOOL_VCC141AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 333 | TOOL_VCC141AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 334 | define TOOL_VCC141AMD64_LINK_LIBRARY_CMDS
|
---|
[2557] | 335 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 336 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
| 337 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
| 338 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[768] | 339 | endef
|
---|
[434] | 340 |
|
---|
| 341 |
|
---|
| 342 | ## Link program
|
---|
| 343 | # @param $(target) Normalized main target name.
|
---|
| 344 | # @param $(out) Program name.
|
---|
| 345 | # @param $(objs) Object files to link together.
|
---|
| 346 | # @param $(libs) Libraries to search.
|
---|
| 347 | # @param $(libpath) Library search paths.
|
---|
| 348 | # @param $(flags) Flags.
|
---|
| 349 | # @param $(dirdep) Directory creation dependency.
|
---|
| 350 | # @param $(deps) Other dependencies.
|
---|
| 351 | # @param $(othersrc) Unhandled sources.
|
---|
| 352 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 353 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 354 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 355 | #
|
---|
[3323] | 356 | TOOL_VCC141AMD64_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 357 | TOOL_VCC141AMD64_LINK_PROGRAM_DEPORD =
|
---|
| 358 | TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 359 | TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 360 | TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 361 | TOOL_VCC141AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 362 | define TOOL_VCC141AMD64_LINK_PROGRAM_CMDS
|
---|
[2557] | 363 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 364 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
| 365 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_LD) $(flags) \
|
---|
[434] | 366 | /OUT:$(out) \
|
---|
[437] | 367 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 368 | /MAP:$(outbase).map \
|
---|
| 369 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 370 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 371 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 372 | @$(outbase).rsp
|
---|
[3323] | 373 | ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 374 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3323] | 375 | $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 376 | endif
|
---|
[434] | 377 | endef
|
---|
| 378 |
|
---|
| 379 |
|
---|
| 380 | ## Link DLL.
|
---|
| 381 | # @param $(target) Normalized main target name.
|
---|
| 382 | # @param $(out) DLL 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.
|
---|
[3323] | 394 | TOOL_VCC141AMD64_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 395 | TOOL_VCC141AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
| 396 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
| 397 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
| 398 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
| 399 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 400 | TOOL_VCC141AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 401 | define TOOL_VCC141AMD64_LINK_DLL_CMDS
|
---|
[2557] | 402 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 403 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
| 404 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_LD) $(flags) \
|
---|
[434] | 405 | /OUT:$(out) \
|
---|
| 406 | /IMPLIB:$(outbase).lib \
|
---|
[437] | 407 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 408 | /MAP:$(outbase).map \
|
---|
| 409 | /DLL \
|
---|
| 410 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 411 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 412 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 413 | @$(outbase).rsp
|
---|
[3323] | 414 | ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 415 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3323] | 416 | $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 417 | endif
|
---|
[2795] | 418 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
| 419 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
[2487] | 420 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[434] | 421 | endef
|
---|
| 422 |
|
---|
| 423 |
|
---|
| 424 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 425 | # @param $(target) Normalized main target name.
|
---|
| 426 | # @param $(out) System module name.
|
---|
| 427 | # @param $(objs) Object files to link together.
|
---|
| 428 | # @param $(libs) Libraries to search.
|
---|
| 429 | # @param $(libpath) Library search paths.
|
---|
| 430 | # @param $(flags) Flags.
|
---|
| 431 | # @param $(dirdep) Directory creation dependency.
|
---|
| 432 | # @param $(deps) Other dependencies.
|
---|
| 433 | # @param $(othersrc) Unhandled sources.
|
---|
| 434 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 435 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 436 | #
|
---|
| 437 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3323] | 438 | TOOL_VCC141AMD64_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 439 | TOOL_VCC141AMD64_LINK_SYSMOD_DEPORD =
|
---|
| 440 | TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 441 | TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 442 | TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 443 | TOOL_VCC141AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 444 | define TOOL_VCC141AMD64_LINK_SYSMOD_CMDS
|
---|
[2557] | 445 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 446 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
| 447 | $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_LD) $(flags) \
|
---|
[434] | 448 | /OUT:$(out) \
|
---|
[437] | 449 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 450 | /MAP:$(outbase).map \
|
---|
| 451 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 452 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 453 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 454 | @$(outbase).rsp
|
---|
[3323] | 455 | ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 456 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3323] | 457 | $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 458 | endif
|
---|
[434] | 459 | endef
|
---|
| 460 |
|
---|