[819] | 1 | # $Id: VCC142.kmk 3597 2023-06-16 20:56:17Z bird $
|
---|
| 2 | ## @file
|
---|
[3339] | 3 | # kBuild Tool Config - Visual C++ 14.2 (aka Visual 2019 and MSC v19.20), default target.
|
---|
[819] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3323] | 7 | # Copyright (c) 2004-2020 knut st. osmundsen <bird-kBuild-spam-xx@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 |
|
---|
[3339] | 34 | TOOL_VCC142 := Visual C++ 14.2 (aka Visual 2019 and MSC v19.20), targeting $(KBUILD_TARGET).
|
---|
[819] | 35 |
|
---|
[3323] | 36 | ifndef INCLUDED_WIN_COMMON_KMK
|
---|
| 37 | include $(KBUILD_PATH)/win-common.kmk
|
---|
| 38 | endif
|
---|
| 39 |
|
---|
| 40 | #
|
---|
[819] | 41 | # Tool Specific Properties
|
---|
[3323] | 42 | #
|
---|
[3339] | 43 | ifndef PATH_TOOL_VCC142
|
---|
[3553] | 44 | PATH_TOOL_VCC142 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.amd64/vcc/v14.2*/Tools/MSVC/14.2?.*)))
|
---|
[3339] | 45 | ifeq ($(PATH_TOOL_VCC142),)
|
---|
[3553] | 46 | PATH_TOOL_VCC142 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.2*/Tools/MSVC/14.2?.*)))
|
---|
[819] | 47 | endif
|
---|
[3339] | 48 | ifeq ($(PATH_TOOL_VCC142),)
|
---|
| 49 | PATH_TOOL_VCC142 := $(PATH_TOOL_VCC142X86)
|
---|
[857] | 50 | endif
|
---|
[3339] | 51 | ifeq ($(PATH_TOOL_VCC142),)
|
---|
| 52 | PATH_TOOL_VCC142 := $(PATH_TOOL_VCC142)
|
---|
[857] | 53 | endif
|
---|
[3339] | 54 | ifeq ($(PATH_TOOL_VCC142),)
|
---|
[3553] | 55 | PATH_TOOL_VCC142 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.2*/Tools/MSVC/14.2?.*)))
|
---|
[3339] | 56 | ifeq ($(PATH_TOOL_VCC142),)
|
---|
| 57 | PATH_TOOL_VCC142 := $(firstfile $(foreach ver,2019,$(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\
|
---|
[3553] | 58 | , $(rversortfiles $(qwildcard ,$(progfilesdir)/Microsoft\ Visual\ Studio/$(ver)/BuildTools/VC/Tools/MSVC/14.2?.*)))))
|
---|
[3339] | 59 | ifeq ($(PATH_TOOL_VCC142),)
|
---|
| 60 | $(warning kBuild: PATH_TOOL_VCC142 cannot be determined!)
|
---|
| 61 | PATH_TOOL_VCC142 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v142
|
---|
[3323] | 62 | endif
|
---|
| 63 | endif
|
---|
[857] | 64 | endif
|
---|
[819] | 65 | else
|
---|
| 66 | # Resolve any fancy stuff once and for all.
|
---|
[3339] | 67 | PATH_TOOL_VCC142 := $(PATH_TOOL_VCC142)
|
---|
[819] | 68 | endif
|
---|
[3323] | 69 |
|
---|
[3339] | 70 | ifndef PATH_TOOL_VCC142_BASE_BIN
|
---|
| 71 | PATH_TOOL_VCC142_BASE_BIN := $(PATH_TOOL_VCC142)/bin
|
---|
[3323] | 72 | endif
|
---|
[3339] | 73 | ifndef PATH_TOOL_VCC142_HOST_BIN
|
---|
| 74 | PATH_TOOL_VCC142_HOST_BIN := $(PATH_TOOL_VCC142_BASE_BIN)/Host$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
[3323] | 75 | endif
|
---|
[3339] | 76 | ifndef PATH_TOOL_VCC142_BIN
|
---|
| 77 | PATH_TOOL_VCC142_BIN := $(PATH_TOOL_VCC142_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_TARGET_ARCH))
|
---|
[3323] | 78 | endif
|
---|
[3339] | 79 | PATH_TOOL_VCC142_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC142_BIN))
|
---|
[3323] | 80 |
|
---|
[3326] | 81 | # 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.
|
---|
[3339] | 82 | ifndef PATH_TOOL_VCC142_HOST_DLL_BIN
|
---|
| 83 | PATH_TOOL_VCC142_HOST_DLL_BIN := $(PATH_TOOL_VCC142_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
[3326] | 84 | endif
|
---|
[3339] | 85 | ifndef PATH_TOOL_VCC142_DLL_BIN
|
---|
| 86 | ifneq ($(PATH_TOOL_VCC142_HOST_DLL_BIN),$(PATH_TOOL_VCC142_BIN))
|
---|
| 87 | PATH_TOOL_VCC142_DLL_BIN := $(PATH_TOOL_VCC142_HOST_DLL_BIN)
|
---|
[3326] | 88 | endif
|
---|
| 89 | endif
|
---|
| 90 |
|
---|
[3339] | 91 | PATH_TOOL_VCC142_LIB.amd64 ?= $(PATH_TOOL_VCC142)/lib/x64
|
---|
| 92 | PATH_TOOL_VCC142_LIB.arm32 ?= $(PATH_TOOL_VCC142)/lib/arm
|
---|
| 93 | PATH_TOOL_VCC142_LIB.arm64 ?= $(PATH_TOOL_VCC142)/lib/arm64
|
---|
| 94 | PATH_TOOL_VCC142_LIB.x86 ?= $(PATH_TOOL_VCC142)/lib/x86
|
---|
[3323] | 95 |
|
---|
[3339] | 96 | PATH_TOOL_VCC142_ONECORE_LIB.amd64 ?= $(PATH_TOOL_VCC142)/lib/onecore/x64
|
---|
| 97 | PATH_TOOL_VCC142_ONECORE_LIB.arm32 ?= $(PATH_TOOL_VCC142)/lib/onecore/arm
|
---|
| 98 | PATH_TOOL_VCC142_ONECORE_LIB.arm64 ?= $(PATH_TOOL_VCC142)/lib/onecore/arm64
|
---|
| 99 | PATH_TOOL_VCC142_ONECORE_LIB.x86 ?= $(PATH_TOOL_VCC142)/lib/onecore/x86
|
---|
[3323] | 100 |
|
---|
[3339] | 101 | PATH_TOOL_VCC142_INC ?= $(PATH_TOOL_VCC142)/include
|
---|
[3323] | 102 |
|
---|
[3339] | 103 | PATH_TOOL_VCC142_ATLMFC ?= $(PATH_TOOL_VCC142)/atlmfc
|
---|
| 104 | PATH_TOOL_VCC142_ATLMFC_INC ?= $(PATH_TOOL_VCC142_ATLMFC)/include
|
---|
| 105 | PATH_TOOL_VCC142_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC142_ATLMFC)/lib/x86
|
---|
| 106 | PATH_TOOL_VCC142_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC142_ATLMFC)/lib/x64
|
---|
[3323] | 107 |
|
---|
[3339] | 108 | TOOL_VCC142_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/cl.exe
|
---|
| 109 | TOOL_VCC142_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/cl.exe
|
---|
[3342] | 110 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
| 111 | TOOL_VCC142_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/ml.exe
|
---|
| 112 | else
|
---|
[3339] | 113 | TOOL_VCC142_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/ml64.exe
|
---|
[3342] | 114 | endif
|
---|
[3339] | 115 | #TOOL_VCC142_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
| 116 | TOOL_VCC142_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/link.exe /LIB
|
---|
| 117 | TOOL_VCC142_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/link.exe
|
---|
| 118 | TOOL_VCC142_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/dumpbin.exe
|
---|
| 119 | TOOL_VCC142_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/editbin.exe
|
---|
[3323] | 120 |
|
---|
[3597] | 121 | TOOL_VCC142_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
|
---|
| 122 | TOOL_VCC142_MT ?= $(TOOL_VCC142_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
|
---|
| 123 | TOOL_VCC142_MT_RETRY ?= $(WINCMN_MT_RETRY)
|
---|
[3323] | 124 |
|
---|
[3339] | 125 | ifdef TOOL_VCC142_USE_KSUBMIT
|
---|
[3323] | 126 | ifeq ($(KBUILD_HOST),win)
|
---|
[3370] | 127 | ifeq ($(findstring /HostX86/,$(PATH_TOOL_VCC142AMD64_BIN)),/HostX86/)
|
---|
| 128 | TOOL_VCC142_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
| 129 | else
|
---|
[3339] | 130 | TOOL_VCC142_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
[3323] | 131 | endif
|
---|
[3339] | 132 | ifdef PATH_TOOL_VCC142_DLL_BIN
|
---|
| 133 | TOOL_VCC142_KSUBMIT := $(TOOL_VCC142_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC142_DLL_BIN));"
|
---|
[3326] | 134 | endif
|
---|
[3339] | 135 | TOOL_VCC142_KSUBMIT_DD := $(TOOL_VCC142_KSUBMIT) --
|
---|
[819] | 136 | endif
|
---|
| 137 | endif
|
---|
[3339] | 138 | ifdef PATH_TOOL_VCC142_DLL_BIN
|
---|
| 139 | TOOL_VCC142_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC142_DLL_BIN));" --$(SP)
|
---|
| 140 | ifndef TOOL_VCC142_KSUBMIT_DD
|
---|
| 141 | TOOL_VCC142_KSUBMIT_DD := $(TOOL_VCC142_SETUP_ENV)
|
---|
[3326] | 142 | endif
|
---|
| 143 | endif
|
---|
[2604] | 144 |
|
---|
[3326] | 145 |
|
---|
[3323] | 146 | ## Helper for finding rc.exe and mt.exe in the SDK.
|
---|
[3339] | 147 | TOOL_VCC142_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(qfirstfile sh,\
|
---|
[3323] | 148 | $(if-expr defined(PATH_SDK_WINSDK10_BIN) , $(qwildcard ,$(PATH_SDK_WINSDK10_BIN)/$2)) \
|
---|
| 149 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(qwildcard ,$(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
| 150 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(qwildcard ,$(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
[3553] | 151 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
| 152 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
[2604] | 153 | $1))
|
---|
[3339] | 154 | TOOL_VCC142_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC142_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
[2604] | 155 |
|
---|
[819] | 156 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
| 157 | # @param $(1) Base name, no extention.
|
---|
| 158 | # @param $(2) The extension.
|
---|
[3339] | 159 | TOOL_VCC142_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
[819] | 160 |
|
---|
[3329] | 161 | #
|
---|
| 162 | # Try find the redist directory. A little complicated as the build number
|
---|
| 163 | # doesn't necessarily match that of the compiler.
|
---|
| 164 | #
|
---|
[3339] | 165 | ifeq ($(tolower $(substr $(qdir u,$(PATH_TOOL_VCC142)), -12)),/tools/msvc/)
|
---|
| 166 | PATH_TOOL_VCC142_REDIST ?= $(firstfile $(qwildcard ,$(substr $(qdir ,$(PATH_TOOL_VCC142)), 1, -12)/Redist/MSVC/14.2*))
|
---|
[3329] | 167 | else
|
---|
[3339] | 168 | PATH_TOOL_VCC142_REDIST ?= $(qabspath ,$(firstfile $(qwildcard ,\
|
---|
| 169 | $(PATH_TOOL_VCC142)/Redist \
|
---|
| 170 | $(PATH_TOOL_VCC142)/../Redist \
|
---|
| 171 | $(PATH_TOOL_VCC142)/../../Redist \
|
---|
| 172 | $(PATH_TOOL_VCC142)/../../../Redist \
|
---|
| 173 | $(PATH_TOOL_VCC142)/../../../../Redist)))
|
---|
[3329] | 174 | endif
|
---|
[3339] | 175 | PATH_TOOL_VCC142_REDIST_DEBUG ?= $(PATH_TOOL_VCC142_REDIST)/debug_nonredist
|
---|
[2954] | 176 |
|
---|
[3339] | 177 | ## Updates may add more msvcp140_[0-9].dll images as the product matures.
|
---|
| 178 | # This helper locates them (can differ between archs).
|
---|
| 179 | # @param 1 Redist subdirectory.
|
---|
| 180 | # @param 2 The DLL basename (no suffix).
|
---|
| 181 | # @param 3 The VCC architecture name (for constructing the path).
|
---|
| 182 | FN_TOOL_VCC142_FIND_DLLS = $(2).dll \
|
---|
[3553] | 183 | $(versortfiles $(qnotdir ,$(qwildcard ,$(PATH_TOOL_VCC142_REDIST)/$(3)/$(1)/$(2)_?.dll)))
|
---|
[3329] | 184 |
|
---|
[3339] | 185 | TOOL_VCC142_REDIST_CRT_SUBDIR := Microsoft.VC142.CRT
|
---|
| 186 | TOOL_VCC142_REDIST_DEBUG_CRT_SUBDIR := Microsoft.VC142.DebugCRT
|
---|
[3329] | 187 |
|
---|
[3339] | 188 | TOOL_VCC142_REDIST_CRT_DLLS.x86 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vcruntime140,x86)
|
---|
| 189 | TOOL_VCC142_REDIST_CRT_DLLS.amd64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vcruntime140,x64)
|
---|
| 190 | TOOL_VCC142_REDIST_CRT_DLLS.arm32 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vcruntime140,arm)
|
---|
| 191 | TOOL_VCC142_REDIST_CRT_DLLS.arm64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vcruntime140,arm64)
|
---|
| 192 | TOOL_VCC142_REDIST_CRT_DLLS = $(TOOL_VCC142_REDIST_CRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3329] | 193 |
|
---|
[3339] | 194 | TOOL_VCC142_REDIST_CONCRT_DLLS.x86 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),concrt140,x86)
|
---|
| 195 | TOOL_VCC142_REDIST_CONCRT_DLLS.amd64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),concrt140,x64)
|
---|
| 196 | TOOL_VCC142_REDIST_CONCRT_DLLS.arm32 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),concrt140,arm)
|
---|
| 197 | TOOL_VCC142_REDIST_CONCRT_DLLS.arm64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),concrt140,arm64)
|
---|
| 198 | TOOL_VCC142_REDIST_CONCRT_DLLS = $(TOOL_VCC142_REDIST_CONCRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
| 199 |
|
---|
| 200 | TOOL_VCC142_REDIST_CPP_DLLS.x86 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),msvcp140,x86)
|
---|
| 201 | TOOL_VCC142_REDIST_CPP_DLLS.amd64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),msvcp140,x64)
|
---|
| 202 | TOOL_VCC142_REDIST_CPP_DLLS.arm32 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),msvcp140,arm)
|
---|
| 203 | TOOL_VCC142_REDIST_CPP_DLLS.arm64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),msvcp140,arm64)
|
---|
| 204 | TOOL_VCC142_REDIST_CPP_DLLS = $(TOOL_VCC142_REDIST_CPP_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
| 205 |
|
---|
| 206 | TOOL_VCC142_REDIST_WINRT_DLLS.x86 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vccorlib140,x86)
|
---|
| 207 | TOOL_VCC142_REDIST_WINRT_DLLS.amd64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vccorlib140,x64)
|
---|
| 208 | TOOL_VCC142_REDIST_WINRT_DLLS.arm32 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vccorlib140,arm)
|
---|
| 209 | TOOL_VCC142_REDIST_WINRT_DLLS.arm64 = $(call FN_TOOL_VCC142_FIND_DLLS,$(TOOL_VCC142_REDIST_CRT_SUBDIR),vccorlib140,arm64)
|
---|
| 210 | TOOL_VCC142_REDIST_WINRT_DLLS = $(TOOL_VCC142_REDIST_WINRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
| 211 |
|
---|
| 212 | TOOL_VCC142_REDIST_CXXAMP_SUBDIR := Microsoft.VC142.CXXAMP
|
---|
| 213 | TOOL_VCC142_REDIST_MFC_SUBDIR := Microsoft.VC142.MFC
|
---|
| 214 | TOOL_VCC142_REDIST_MFCLOC_SUBDIR := Microsoft.VC142.MFCLOC
|
---|
| 215 | TOOL_VCC142_REDIST_OPENMP_SUBDIR := Microsoft.VC142.OpenMP
|
---|
| 216 |
|
---|
| 217 |
|
---|
[3323] | 218 | #
|
---|
| 219 | # Properties used by kBuild
|
---|
| 220 | #
|
---|
[3339] | 221 | TOOL_VCC142_COBJSUFF ?= .obj
|
---|
| 222 | TOOL_VCC142_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
| 223 | TOOL_VCC142_CFLAGS.debug ?=
|
---|
| 224 | TOOL_VCC142_CFLAGS.dbgopt ?= -O2
|
---|
| 225 | TOOL_VCC142_CFLAGS.release ?= -O2
|
---|
| 226 | TOOL_VCC142_CFLAGS.profile ?= -O2
|
---|
| 227 | TOOL_VCC142_CINCS ?= $(PATH_TOOL_VCC142_INC)
|
---|
| 228 | TOOL_VCC142_CDEFS ?=
|
---|
[819] | 229 |
|
---|
[3339] | 230 | TOOL_VCC142_CXXOBJSUFF ?= .obj
|
---|
| 231 | TOOL_VCC142_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
| 232 | TOOL_VCC142_CXXFLAGS.debug ?=
|
---|
| 233 | TOOL_VCC142_CXXFLAGS.dbgopt ?= -O2
|
---|
| 234 | TOOL_VCC142_CXXFLAGS.release ?= -O2
|
---|
| 235 | TOOL_VCC142_CXXFLAGS.profile ?= -O2
|
---|
| 236 | TOOL_VCC142_CXXINCS ?= $(PATH_TOOL_VCC142_INC) $(PATH_TOOL_VCC142_ATLMFC_INC)
|
---|
| 237 | TOOL_VCC142_CXXDEFS ?=
|
---|
[819] | 238 |
|
---|
[3339] | 239 | TOOL_VCC142_ASOBJSUFF ?= .obj
|
---|
[819] | 240 |
|
---|
[3339] | 241 | TOOL_VCC142_RCOBJSUFF ?= .res
|
---|
| 242 | TOOL_VCC142_RCINCS ?= $(PATH_TOOL_VCC142_INC) $(PATH_TOOL_VCC142_ATLMFC_INC)
|
---|
[819] | 243 |
|
---|
[3339] | 244 | TOOL_VCC142_ARFLAGS ?= -nologo
|
---|
| 245 | TOOL_VCC142_ARFLAGS.x86 ?= -machine:x86
|
---|
| 246 | TOOL_VCC142_ARFLAGS.amd64 ?= -machine:amd64
|
---|
| 247 | TOOL_VCC142_ARFLAGS.arm32 ?= -machine:arm
|
---|
| 248 | TOOL_VCC142_ARLIBSUFF ?= .lib
|
---|
[819] | 249 |
|
---|
[3339] | 250 | TOOL_VCC142_LDFLAGS ?= -nologo
|
---|
| 251 | TOOL_VCC142_LDFLAGS.x86 ?= -machine:x86
|
---|
| 252 | TOOL_VCC142_LDFLAGS.amd64 ?= -machine:amd64
|
---|
| 253 | TOOL_VCC142_LDFLAGS.arm32 ?= -machine:arm
|
---|
| 254 | TOOL_VCC142_LDFLAGS.debug ?= -debug
|
---|
| 255 | TOOL_VCC142_LDFLAGS.dbgopt ?= -debug
|
---|
| 256 | TOOL_VCC142_LDFLAGS.profile ?= -debug
|
---|
| 257 | TOOL_VCC142_LDFLAGS.release ?=
|
---|
[819] | 258 |
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 | ## Compile C source.
|
---|
| 262 | # @param $(target) Normalized main target name.
|
---|
| 263 | # @param $(source) Source filename (relative).
|
---|
| 264 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 265 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 266 | # @param $(flags) Flags.
|
---|
| 267 | # @param $(defs) Definitions. No -D or something.
|
---|
| 268 | # @param $(incs) Includes. No -I or something.
|
---|
| 269 | # @param $(dirdep) Directory creation dependency.
|
---|
| 270 | # @param $(deps) Other dependencies.
|
---|
| 271 | #
|
---|
| 272 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 273 | # @param $(objsuff) Object suffix.
|
---|
[3370] | 274 | # @note The -d1scalableinclude- option disables include directory caching as the cache goes
|
---|
| 275 | # stale in kWorker. Besides, kWorker does it's own caching, so it is not necessary.
|
---|
[3339] | 276 | TOOL_VCC142_COMPILE_C_DEPEND =
|
---|
| 277 | TOOL_VCC142_COMPILE_C_DEPORD =
|
---|
| 278 | TOOL_VCC142_COMPILE_C_OUTPUT =
|
---|
| 279 | TOOL_VCC142_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC142_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC142_PDB, $(outbase)-obj,idb)
|
---|
| 280 | ifdef TOOL_VCC142_KSUBMIT
|
---|
| 281 | TOOL_VCC142_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 282 | define TOOL_VCC142_COMPILE_C_CMDS
|
---|
| 283 | $(QUIET)$(TOOL_VCC142_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
[3370] | 284 | -- $(TOOL_VCC142_CC) -c -d1scalableinclude-\
|
---|
[3323] | 285 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[819] | 286 | -Fd$(outbase)-obj.pdb \
|
---|
| 287 | -Fo$(obj)\
|
---|
| 288 | $(subst /,\\,$(abspath $(source)))
|
---|
[3323] | 289 | endef
|
---|
| 290 | else
|
---|
[3339] | 291 | define TOOL_VCC142_COMPILE_C_CMDS
|
---|
[3370] | 292 | $(QUIET)$(TOOL_VCC142_SETUP_ENV)$(TOOL_VCC142_CC) -c\
|
---|
[3323] | 293 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
| 294 | -Fd$(outbase)-obj.pdb \
|
---|
| 295 | -Fo$(obj)\
|
---|
| 296 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 297 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[3323] | 298 | endef
|
---|
[3339] | 299 | endif # !TOOL_VCC142_KSUBMIT
|
---|
[819] | 300 |
|
---|
| 301 |
|
---|
| 302 | ## Compile C++ source.
|
---|
| 303 | # @param $(target) Normalized main target name.
|
---|
| 304 | # @param $(source) Source filename (relative).
|
---|
| 305 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 306 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 307 | # @param $(flags) Flags.
|
---|
| 308 | # @param $(defs) Definitions. No -D or something.
|
---|
| 309 | # @param $(incs) Includes. No -I or something.
|
---|
| 310 | # @param $(dirdep) Directory creation dependency.
|
---|
| 311 | # @param $(deps) Other dependencies.
|
---|
| 312 | #
|
---|
| 313 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 314 | # @param $(objsuff) Object suffix.
|
---|
[3370] | 315 | # @note The -d1scalableinclude- option disables include directory caching as the cache goes
|
---|
| 316 | # stale in kWorker. Besides, kWorker does it's own caching, so it is not necessary.
|
---|
| 317 | # ('-d1' means it's passed to c1.dll/c1xx.dll and 'scalableinclude-' is the actual option.)
|
---|
[3339] | 318 | TOOL_VCC142_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
| 319 | TOOL_VCC142_COMPILE_CXX_DEPORD =
|
---|
| 320 | TOOL_VCC142_COMPILE_CXX_OUTPUT =
|
---|
| 321 | TOOL_VCC142_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 322 | ,,$(call TOOL_VCC142_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC142_PDB, $(outbase)-obj,idb))
|
---|
| 323 | ifdef TOOL_VCC142_KSUBMIT
|
---|
| 324 | TOOL_VCC142_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 325 | define TOOL_VCC142_COMPILE_CXX_CMDS
|
---|
| 326 | $(QUIET)$(TOOL_VCC142_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
[3370] | 327 | -- $(TOOL_VCC142_CXX) -c -d1scalableinclude-\
|
---|
[3323] | 328 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2956] | 329 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
[3033] | 330 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
[2956] | 331 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[819] | 332 | -Fo$(obj)\
|
---|
| 333 | $(subst /,\\,$(abspath $(source)))
|
---|
[3323] | 334 | endef
|
---|
| 335 | else
|
---|
[3339] | 336 | define TOOL_VCC142_COMPILE_CXX_CMDS
|
---|
[3370] | 337 | $(QUIET)$(TOOL_VCC142_SETUP_ENV)$(TOOL_VCC142_CXX) -c\
|
---|
[3323] | 338 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
| 339 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 340 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
| 341 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
| 342 | -Fo$(obj)\
|
---|
| 343 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 344 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[3323] | 345 | endef
|
---|
[3339] | 346 | endif # !TOOL_VCC142_KSUBMIT
|
---|
[819] | 347 |
|
---|
[2954] | 348 |
|
---|
| 349 | #
|
---|
| 350 | # Helper tool for creating the precompiled C++ header.
|
---|
| 351 | #
|
---|
| 352 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 353 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 354 | #
|
---|
[3339] | 355 | TOOL_VCC142-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 356 | TOOL_VCC142-PCH_EXTENDS := VCC142
|
---|
| 357 | TOOL_VCC142-PCH_CXXOBJSUFF := .obj
|
---|
| 358 | TOOL_VCC142-PCH_CXXINCS = $(TOOL_VCC142_CXXINCS)
|
---|
| 359 | TOOL_VCC142-PCH_CXXFLAGS = $(TOOL_VCC142_CXXFLAGS) -FS
|
---|
| 360 | TOOL_VCC142-PCH_CXXFLAGS.debug = $(TOOL_VCC142_CXXFLAGS.debug)
|
---|
| 361 | TOOL_VCC142-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC142_CXXFLAGS.dbgopt)
|
---|
| 362 | TOOL_VCC142-PCH_CXXFLAGS.release = $(TOOL_VCC142_CXXFLAGS.release)
|
---|
| 363 | TOOL_VCC142-PCH_CXXFLAGS.profile = $(TOOL_VCC142_CXXFLAGS.profile)
|
---|
| 364 | TOOL_VCC142-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 365 | TOOL_VCC142-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 366 | TOOL_VCC142-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 367 | TOOL_VCC142-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 368 | ifdef TOOL_VCC142_KSUBMIT
|
---|
| 369 | define TOOL_VCC142-PCH_COMPILE_CXX_CMDS
|
---|
[3323] | 370 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3339] | 371 | $(QUIET)$(TOOL_VCC142_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
[3370] | 372 | -- $(TOOL_VCC142_CXX) -c -Yc -d1scalableinclude-\
|
---|
[3323] | 373 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 374 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 375 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 376 | -Fo$(obj)\
|
---|
| 377 | -TP \
|
---|
| 378 | $(subst /,\\,$(abspath $(source)))
|
---|
| 379 | endef
|
---|
| 380 | else
|
---|
[3339] | 381 | define TOOL_VCC142-PCH_COMPILE_CXX_CMDS
|
---|
[3323] | 382 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3370] | 383 | $(QUIET)$(TOOL_VCC142_SETUP_ENV)$(TOOL_VCC142_CXX) -c -Yc\
|
---|
[3323] | 384 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 385 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 386 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 387 | -Fo$(obj)\
|
---|
| 388 | -TP \
|
---|
| 389 | $(subst /,\\,$(abspath $(source)))
|
---|
| 390 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 391 |
|
---|
| 392 | endef
|
---|
[3339] | 393 | endif # !TOOL_VCC142_KSUBMIT
|
---|
[2954] | 394 |
|
---|
| 395 |
|
---|
[2611] | 396 | ## @todo configure the assembler template.
|
---|
[819] | 397 |
|
---|
| 398 | ## Compile resource source.
|
---|
| 399 | # @param $(target) Normalized main target name.
|
---|
| 400 | # @param $(source) Source filename (relative).
|
---|
| 401 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 402 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 403 | # @param $(flags) Flags.
|
---|
| 404 | # @param $(defs) Definitions. No -D or something.
|
---|
| 405 | # @param $(incs) Includes. No -I or something.
|
---|
| 406 | # @param $(dirdep) Directory creation dependency.
|
---|
| 407 | # @param $(deps) Other dependencies.
|
---|
| 408 | #
|
---|
| 409 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 410 | # @param $(objsuff) Object suffix.
|
---|
[3339] | 411 | TOOL_VCC142_COMPILE_RC_DEPEND =
|
---|
| 412 | TOOL_VCC142_COMPILE_RC_DEPORD =
|
---|
| 413 | TOOL_VCC142_COMPILE_RC_OUTPUT =
|
---|
| 414 | define TOOL_VCC142_COMPILE_RC_CMDS
|
---|
| 415 | $(QUIET)$(TOOL_VCC142_RC) \
|
---|
[3323] | 416 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
[819] | 417 | /fo$(obj)\
|
---|
| 418 | $(subst /,\\,$(abspath $(source)))
|
---|
| 419 | endef
|
---|
| 420 |
|
---|
| 421 |
|
---|
| 422 | ## Link library
|
---|
| 423 | # @param $(target) Normalized main target name.
|
---|
| 424 | # @param $(out) Library name.
|
---|
| 425 | # @param $(objs) Object files to put in the library.
|
---|
| 426 | # @param $(flags) Flags.
|
---|
| 427 | # @param $(dirdep) Directory creation dependency.
|
---|
| 428 | # @param $(deps) Other dependencies.
|
---|
| 429 | # @param $(othersrc) Unhandled sources.
|
---|
| 430 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 431 | #
|
---|
[3339] | 432 | TOOL_VCC142_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 433 | TOOL_VCC142_LINK_LIBRARY_DEPORD =
|
---|
| 434 | TOOL_VCC142_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 435 | TOOL_VCC142_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 436 | define TOOL_VCC142_LINK_LIBRARY_CMDS
|
---|
[2557] | 437 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 438 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
| 439 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
[3339] | 440 | $(QUIET)$(TOOL_VCC142_KSUBMIT_DD) $(TOOL_VCC142_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[819] | 441 | endef
|
---|
| 442 |
|
---|
| 443 |
|
---|
| 444 | ## Link program
|
---|
| 445 | # @param $(target) Normalized main target name.
|
---|
| 446 | # @param $(out) Program name.
|
---|
| 447 | # @param $(objs) Object files to link together.
|
---|
| 448 | # @param $(libs) Libraries to search.
|
---|
| 449 | # @param $(libpath) Library search paths.
|
---|
| 450 | # @param $(flags) Flags.
|
---|
| 451 | # @param $(dirdep) Directory creation dependency.
|
---|
| 452 | # @param $(deps) Other dependencies.
|
---|
| 453 | # @param $(othersrc) Unhandled sources.
|
---|
| 454 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 455 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 456 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 457 | #
|
---|
[3339] | 458 | TOOL_VCC142_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 459 | TOOL_VCC142_LINK_PROGRAM_DEPORD =
|
---|
| 460 | TOOL_VCC142_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 461 | TOOL_VCC142_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 462 | TOOL_VCC142_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 463 | TOOL_VCC142_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 464 | define TOOL_VCC142_LINK_PROGRAM_CMDS
|
---|
[2557] | 465 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 466 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
[3339] | 467 | $(QUIET)$(TOOL_VCC142_KSUBMIT_DD) $(TOOL_VCC142_LD) $(flags) \
|
---|
[819] | 468 | /OUT:$(out) \
|
---|
| 469 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 470 | /MAP:$(outbase).map \
|
---|
| 471 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 472 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 473 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 474 | @$(outbase).rsp
|
---|
[3339] | 475 | ifndef TOOL_VCC142_NO_AUTO_MANIFEST
|
---|
[1295] | 476 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3339] | 477 | $(TOOL_VCC142_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 478 | endif
|
---|
[819] | 479 | endef
|
---|
| 480 |
|
---|
| 481 |
|
---|
| 482 | ## Link DLL.
|
---|
| 483 | # @param $(target) Normalized main target name.
|
---|
| 484 | # @param $(out) DLL name.
|
---|
| 485 | # @param $(objs) Object files to link together.
|
---|
| 486 | # @param $(libs) Libraries to search.
|
---|
| 487 | # @param $(libpath) Library search paths.
|
---|
| 488 | # @param $(flags) Flags.
|
---|
| 489 | # @param $(dirdep) Directory creation dependency.
|
---|
| 490 | # @param $(deps) Other dependencies.
|
---|
| 491 | # @param $(othersrc) Unhandled sources.
|
---|
| 492 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 493 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 494 | #
|
---|
| 495 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3339] | 496 | TOOL_VCC142_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 497 | TOOL_VCC142_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
| 498 | TOOL_VCC142_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
| 499 | TOOL_VCC142_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
| 500 | TOOL_VCC142_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
| 501 | TOOL_VCC142_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 502 | TOOL_VCC142_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 503 | define TOOL_VCC142_LINK_DLL_CMDS
|
---|
[2557] | 504 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 505 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
[3339] | 506 | $(QUIET)$(TOOL_VCC142_KSUBMIT_DD) $(TOOL_VCC142_LD) $(flags) \
|
---|
[819] | 507 | /OUT:$(out) \
|
---|
| 508 | /IMPLIB:$(outbase).lib \
|
---|
| 509 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 510 | /MAP:$(outbase).map \
|
---|
| 511 | /DLL \
|
---|
| 512 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 513 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 514 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 515 | @$(outbase).rsp
|
---|
[3339] | 516 | ifndef TOOL_VCC142_NO_AUTO_MANIFEST
|
---|
[1295] | 517 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3339] | 518 | $(TOOL_VCC142_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 519 | endif
|
---|
[2795] | 520 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
[3323] | 521 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
[2487] | 522 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[819] | 523 | endef
|
---|
| 524 |
|
---|
| 525 |
|
---|
| 526 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 527 | # @param $(target) Normalized main target name.
|
---|
| 528 | # @param $(out) System module name.
|
---|
| 529 | # @param $(objs) Object files to link together.
|
---|
| 530 | # @param $(libs) Libraries to search.
|
---|
| 531 | # @param $(libpath) Library search paths.
|
---|
| 532 | # @param $(flags) Flags.
|
---|
| 533 | # @param $(dirdep) Directory creation dependency.
|
---|
| 534 | # @param $(deps) Other dependencies.
|
---|
| 535 | # @param $(othersrc) Unhandled sources.
|
---|
| 536 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 537 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 538 | #
|
---|
| 539 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3339] | 540 | TOOL_VCC142_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 541 | TOOL_VCC142_LINK_SYSMOD_DEPORD =
|
---|
| 542 | TOOL_VCC142_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 543 | TOOL_VCC142_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 544 | TOOL_VCC142_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 545 | TOOL_VCC142_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 546 | define TOOL_VCC142_LINK_SYSMOD_CMDS
|
---|
[2557] | 547 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 548 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
[3339] | 549 | $(QUIET)$(TOOL_VCC142_KSUBMIT_DD) $(TOOL_VCC142_LD) $(flags) \
|
---|
[819] | 550 | /OUT:$(out) \
|
---|
| 551 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 552 | /MAP:$(outbase).map \
|
---|
| 553 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 554 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 555 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 556 | @$(outbase).rsp
|
---|
[3339] | 557 | ifndef TOOL_VCC142_NO_AUTO_MANIFEST
|
---|
[1295] | 558 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3339] | 559 | $(TOOL_VCC142_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 560 | endif
|
---|
[819] | 561 | endef
|
---|
| 562 |
|
---|