[819] | 1 | # $Id: VCC141.kmk 3597 2023-06-16 20:56:17Z bird $
|
---|
| 2 | ## @file
|
---|
[3340] | 3 | # kBuild Tool Config - Visual C++ 14.1 (aka Visual 2017 and MSC v19.10), 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 |
|
---|
[3323] | 34 | TOOL_VCC141 := Visual C++ 14.1 (aka Visual 2017 and MSC v19.1), 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 | #
|
---|
| 43 | ifndef PATH_TOOL_VCC141
|
---|
[3334] | 44 | PATH_TOOL_VCC141 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.amd64/vcc/v14.1*/Tools/MSVC/14.1?.*)))
|
---|
[3323] | 45 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
[3334] | 46 | PATH_TOOL_VCC141 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.1*/Tools/MSVC/14.1?.*)))
|
---|
[819] | 47 | endif
|
---|
[3323] | 48 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
| 49 | PATH_TOOL_VCC141 := $(PATH_TOOL_VCC141X86)
|
---|
[857] | 50 | endif
|
---|
[3323] | 51 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
| 52 | PATH_TOOL_VCC141 := $(PATH_TOOL_VCC141)
|
---|
[857] | 53 | endif
|
---|
[3323] | 54 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
[3334] | 55 | PATH_TOOL_VCC141 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.1*/Tools/MSVC/14.1?.*)))
|
---|
[3323] | 56 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
| 57 | PATH_TOOL_VCC141 := $(firstfile $(foreach ver,2017 2019,$(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\
|
---|
| 58 | , $(rsortfiles $(qwildcard ,$(progfilesdir)/Microsoft\ Visual\ Studio/$(ver)/BuildTools/VC/Tools/MSVC/14.1?.*)))))
|
---|
| 59 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
| 60 | $(warning kBuild: PATH_TOOL_VCC141 cannot be determined!)
|
---|
| 61 | PATH_TOOL_VCC141 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v141
|
---|
| 62 | endif
|
---|
| 63 | endif
|
---|
[857] | 64 | endif
|
---|
[819] | 65 | else
|
---|
| 66 | # Resolve any fancy stuff once and for all.
|
---|
[3323] | 67 | PATH_TOOL_VCC141 := $(PATH_TOOL_VCC141)
|
---|
[819] | 68 | endif
|
---|
[3323] | 69 |
|
---|
| 70 | ifndef PATH_TOOL_VCC141_BASE_BIN
|
---|
| 71 | PATH_TOOL_VCC141_BASE_BIN := $(PATH_TOOL_VCC141)/bin
|
---|
| 72 | endif
|
---|
| 73 | ifndef PATH_TOOL_VCC141_HOST_BIN
|
---|
| 74 | PATH_TOOL_VCC141_HOST_BIN := $(PATH_TOOL_VCC141_BASE_BIN)/Host$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
| 75 | endif
|
---|
| 76 | ifndef PATH_TOOL_VCC141_BIN
|
---|
| 77 | PATH_TOOL_VCC141_BIN := $(PATH_TOOL_VCC141_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_TARGET_ARCH))
|
---|
| 78 | endif
|
---|
| 79 | PATH_TOOL_VCC141_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC141_BIN))
|
---|
| 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.
|
---|
| 82 | ifndef PATH_TOOL_VCC141_HOST_DLL_BIN
|
---|
| 83 | PATH_TOOL_VCC141_HOST_DLL_BIN := $(PATH_TOOL_VCC141_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
| 84 | endif
|
---|
| 85 | ifndef PATH_TOOL_VCC141_DLL_BIN
|
---|
| 86 | ifneq ($(PATH_TOOL_VCC141_HOST_DLL_BIN),$(PATH_TOOL_VCC141_BIN))
|
---|
| 87 | PATH_TOOL_VCC141_DLL_BIN := $(PATH_TOOL_VCC141_HOST_DLL_BIN)
|
---|
| 88 | endif
|
---|
| 89 | endif
|
---|
| 90 |
|
---|
[3323] | 91 | PATH_TOOL_VCC141_LIB.amd64 ?= $(PATH_TOOL_VCC141)/lib/x64
|
---|
| 92 | PATH_TOOL_VCC141_LIB.arm32 ?= $(PATH_TOOL_VCC141)/lib/arm
|
---|
| 93 | PATH_TOOL_VCC141_LIB.arm64 ?= $(PATH_TOOL_VCC141)/lib/arm64
|
---|
| 94 | PATH_TOOL_VCC141_LIB.x86 ?= $(PATH_TOOL_VCC141)/lib/x86
|
---|
| 95 |
|
---|
| 96 | PATH_TOOL_VCC141_ONECORE_LIB.amd64 ?= $(PATH_TOOL_VCC141)/lib/onecore/x64
|
---|
| 97 | PATH_TOOL_VCC141_ONECORE_LIB.arm32 ?= $(PATH_TOOL_VCC141)/lib/onecore/arm
|
---|
| 98 | PATH_TOOL_VCC141_ONECORE_LIB.arm64 ?= $(PATH_TOOL_VCC141)/lib/onecore/arm64
|
---|
| 99 | PATH_TOOL_VCC141_ONECORE_LIB.x86 ?= $(PATH_TOOL_VCC141)/lib/onecore/x86
|
---|
| 100 |
|
---|
| 101 | PATH_TOOL_VCC141_INC ?= $(PATH_TOOL_VCC141)/include
|
---|
| 102 |
|
---|
| 103 | PATH_TOOL_VCC141_ATLMFC ?= $(PATH_TOOL_VCC141)/atlmfc
|
---|
| 104 | PATH_TOOL_VCC141_ATLMFC_INC ?= $(PATH_TOOL_VCC141_ATLMFC)/include
|
---|
| 105 | PATH_TOOL_VCC141_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC141_ATLMFC)/lib/x86
|
---|
| 106 | PATH_TOOL_VCC141_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC141_ATLMFC)/lib/x64
|
---|
| 107 |
|
---|
| 108 | TOOL_VCC141_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/cl.exe
|
---|
| 109 | TOOL_VCC141_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/cl.exe
|
---|
[3342] | 110 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
| 111 | TOOL_VCC141_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/ml.exe
|
---|
| 112 | else
|
---|
[3323] | 113 | TOOL_VCC141_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/ml64.exe
|
---|
[3342] | 114 | endif
|
---|
[3323] | 115 | #TOOL_VCC141_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
| 116 | TOOL_VCC141_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/link.exe /LIB
|
---|
| 117 | TOOL_VCC141_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/link.exe
|
---|
| 118 | TOOL_VCC141_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/dumpbin.exe
|
---|
| 119 | TOOL_VCC141_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/editbin.exe
|
---|
| 120 |
|
---|
[3597] | 121 | TOOL_VCC141_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
|
---|
| 122 | TOOL_VCC141_MT ?= $(TOOL_VCC141_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
|
---|
| 123 | TOOL_VCC141_MT_RETRY ?= $(WINCMN_MT_RETRY)
|
---|
[3323] | 124 |
|
---|
| 125 | undefine TOOL_VCC141_USE_KSUBMIT # for now
|
---|
| 126 | ifdef TOOL_VCC141_USE_KSUBMIT
|
---|
| 127 | ifeq ($(KBUILD_HOST),win)
|
---|
| 128 | ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC141_BIN)),-3),64/)
|
---|
| 129 | TOOL_VCC141_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
| 130 | else
|
---|
| 131 | TOOL_VCC141_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
| 132 | endif
|
---|
[3326] | 133 | ifdef PATH_TOOL_VCC141_DLL_BIN
|
---|
| 134 | TOOL_VCC141_KSUBMIT := $(TOOL_VCC141_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC141_DLL_BIN));"
|
---|
| 135 | endif
|
---|
| 136 | TOOL_VCC141_KSUBMIT_DD := $(TOOL_VCC141_KSUBMIT) --
|
---|
[819] | 137 | endif
|
---|
| 138 | endif
|
---|
[3326] | 139 | ifdef PATH_TOOL_VCC141_DLL_BIN
|
---|
| 140 | TOOL_VCC141_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC141_DLL_BIN));" --$(SP)
|
---|
| 141 | ifndef TOOL_VCC141_KSUBMIT_DD
|
---|
| 142 | TOOL_VCC141_KSUBMIT_DD := $(TOOL_VCC141_SETUP_ENV)
|
---|
| 143 | endif
|
---|
| 144 | endif
|
---|
[2604] | 145 |
|
---|
[3326] | 146 |
|
---|
[3323] | 147 | ## Helper for finding rc.exe and mt.exe in the SDK.
|
---|
[3326] | 148 | TOOL_VCC141_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(qfirstfile sh,\
|
---|
[3323] | 149 | $(if-expr defined(PATH_SDK_WINSDK10_BIN) , $(qwildcard ,$(PATH_SDK_WINSDK10_BIN)/$2)) \
|
---|
| 150 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(qwildcard ,$(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
| 151 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(qwildcard ,$(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
| 152 | $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
| 153 | $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
[2604] | 154 | $1))
|
---|
[3323] | 155 | TOOL_VCC141_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC141_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
[2604] | 156 |
|
---|
[819] | 157 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
| 158 | # @param $(1) Base name, no extention.
|
---|
| 159 | # @param $(2) The extension.
|
---|
[3323] | 160 | TOOL_VCC141_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
[819] | 161 |
|
---|
[3329] | 162 | #
|
---|
| 163 | # Try find the redist directory. A little complicated as the build number
|
---|
| 164 | # doesn't necessarily match that of the compiler.
|
---|
| 165 | #
|
---|
| 166 | ifeq ($(tolower $(substr $(qdir u,$(PATH_TOOL_VCC141)), -12)),/tools/msvc/)
|
---|
| 167 | PATH_TOOL_VCC141_REDIST ?= $(firstfile $(qwildcard ,$(substr $(qdir ,$(PATH_TOOL_VCC141)), 1, -12)/Redist/MSVC/14.1*))
|
---|
| 168 | else
|
---|
[3334] | 169 | PATH_TOOL_VCC141_REDIST ?= $(qabspath ,$(firstfile $(qwildcard ,\
|
---|
| 170 | $(PATH_TOOL_VCC141)/Redist \
|
---|
| 171 | $(PATH_TOOL_VCC141)/../Redist \
|
---|
| 172 | $(PATH_TOOL_VCC141)/../../Redist \
|
---|
| 173 | $(PATH_TOOL_VCC141)/../../../Redist \
|
---|
| 174 | $(PATH_TOOL_VCC141)/../../../../Redist)))
|
---|
[3329] | 175 | endif
|
---|
| 176 | PATH_TOOL_VCC141_REDIST_DEBUG ?= $(PATH_TOOL_VCC141_REDIST)/debug_nonredist
|
---|
[2954] | 177 |
|
---|
[3340] | 178 | ## Updates may add more msvcp140_[0-9].dll images as the product matures.
|
---|
| 179 | # This helper locates them (can differ between archs).
|
---|
| 180 | # @param 1 Redist subdirectory.
|
---|
| 181 | # @param 2 The DLL basename (no suffix).
|
---|
| 182 | # @param 3 The VCC architecture name (for constructing the path).
|
---|
| 183 | FN_TOOL_VCC141_FIND_DLLS = $(2).dll \
|
---|
[3342] | 184 | $(sortfiles $(qnotdir ,$(qwildcard ,$(PATH_TOOL_VCC141_REDIST)/$(3)/$(1)/$(2)_?.dll)))
|
---|
[3340] | 185 |
|
---|
[3329] | 186 | TOOL_VCC141_REDIST_CRT_SUBDIR := Microsoft.VC141.CRT
|
---|
| 187 | TOOL_VCC141_REDIST_DEBUG_CRT_SUBDIR := Microsoft.VC141.DebugCRT
|
---|
| 188 |
|
---|
[3342] | 189 | TOOL_VCC141_REDIST_CRT_DLLS.x86 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vcruntime140,x86)
|
---|
| 190 | TOOL_VCC141_REDIST_CRT_DLLS.amd64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vcruntime140,x64)
|
---|
| 191 | TOOL_VCC141_REDIST_CRT_DLLS.arm32 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vcruntime140,arm)
|
---|
| 192 | TOOL_VCC141_REDIST_CRT_DLLS.arm64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vcruntime140,arm64)
|
---|
| 193 | TOOL_VCC141_REDIST_CRT_DLLS = $(TOOL_VCC141_REDIST_CRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 194 |
|
---|
[3342] | 195 | TOOL_VCC141_REDIST_CONCRT_DLLS.x86 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),concrt140,x86)
|
---|
| 196 | TOOL_VCC141_REDIST_CONCRT_DLLS.amd64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),concrt140,x64)
|
---|
| 197 | TOOL_VCC141_REDIST_CONCRT_DLLS.arm32 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),concrt140,arm)
|
---|
| 198 | TOOL_VCC141_REDIST_CONCRT_DLLS.arm64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),concrt140,arm64)
|
---|
| 199 | TOOL_VCC141_REDIST_CONCRT_DLLS = $(TOOL_VCC141_REDIST_CONCRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 200 |
|
---|
[3342] | 201 | TOOL_VCC141_REDIST_CPP_DLLS.x86 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),msvcp140,x86)
|
---|
| 202 | TOOL_VCC141_REDIST_CPP_DLLS.amd64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),msvcp140,x64)
|
---|
| 203 | TOOL_VCC141_REDIST_CPP_DLLS.arm32 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),msvcp140,arm)
|
---|
| 204 | TOOL_VCC141_REDIST_CPP_DLLS.arm64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),msvcp140,arm64)
|
---|
| 205 | TOOL_VCC141_REDIST_CPP_DLLS = $(TOOL_VCC141_REDIST_CPP_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 206 |
|
---|
[3342] | 207 | TOOL_VCC141_REDIST_WINRT_DLLS.x86 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vccorlib140,x86)
|
---|
| 208 | TOOL_VCC141_REDIST_WINRT_DLLS.amd64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vccorlib140,x64)
|
---|
| 209 | TOOL_VCC141_REDIST_WINRT_DLLS.arm32 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vccorlib140,arm)
|
---|
| 210 | TOOL_VCC141_REDIST_WINRT_DLLS.arm64 = $(call FN_TOOL_VCC141_FIND_DLLS,$(TOOL_VCC141_REDIST_CRT_SUBDIR),vccorlib140,arm64)
|
---|
| 211 | TOOL_VCC141_REDIST_WINRT_DLLS = $(TOOL_VCC141_REDIST_WINRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 212 |
|
---|
[3329] | 213 | TOOL_VCC141_REDIST_CXXAMP_SUBDIR := Microsoft.VC141.CXXAMP
|
---|
| 214 | TOOL_VCC141_REDIST_MFC_SUBDIR := Microsoft.VC141.MFC
|
---|
| 215 | TOOL_VCC141_REDIST_MFCLOC_SUBDIR := Microsoft.VC141.MFCLOC
|
---|
| 216 | TOOL_VCC141_REDIST_OPENMP_SUBDIR := Microsoft.VC141.OpenMP
|
---|
| 217 |
|
---|
| 218 |
|
---|
[3323] | 219 | #
|
---|
| 220 | # Properties used by kBuild
|
---|
| 221 | #
|
---|
| 222 | TOOL_VCC141_COBJSUFF ?= .obj
|
---|
[3325] | 223 | TOOL_VCC141_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
[3323] | 224 | TOOL_VCC141_CFLAGS.debug ?=
|
---|
| 225 | TOOL_VCC141_CFLAGS.dbgopt ?= -O2
|
---|
| 226 | TOOL_VCC141_CFLAGS.release ?= -O2
|
---|
| 227 | TOOL_VCC141_CFLAGS.profile ?= -O2
|
---|
| 228 | TOOL_VCC141_CINCS ?= $(PATH_TOOL_VCC141_INC)
|
---|
| 229 | TOOL_VCC141_CDEFS ?=
|
---|
[819] | 230 |
|
---|
[3323] | 231 | TOOL_VCC141_CXXOBJSUFF ?= .obj
|
---|
[3325] | 232 | TOOL_VCC141_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
[3323] | 233 | TOOL_VCC141_CXXFLAGS.debug ?=
|
---|
| 234 | TOOL_VCC141_CXXFLAGS.dbgopt ?= -O2
|
---|
| 235 | TOOL_VCC141_CXXFLAGS.release ?= -O2
|
---|
| 236 | TOOL_VCC141_CXXFLAGS.profile ?= -O2
|
---|
| 237 | TOOL_VCC141_CXXINCS ?= $(PATH_TOOL_VCC141_INC) $(PATH_TOOL_VCC141_ATLMFC_INC)
|
---|
| 238 | TOOL_VCC141_CXXDEFS ?=
|
---|
[819] | 239 |
|
---|
[3323] | 240 | TOOL_VCC141_ASOBJSUFF ?= .obj
|
---|
[819] | 241 |
|
---|
[3323] | 242 | TOOL_VCC141_RCOBJSUFF ?= .res
|
---|
| 243 | TOOL_VCC141_RCINCS ?= $(PATH_TOOL_VCC141_INC) $(PATH_TOOL_VCC141_ATLMFC_INC)
|
---|
[819] | 244 |
|
---|
[3323] | 245 | TOOL_VCC141_ARFLAGS ?= -nologo
|
---|
| 246 | TOOL_VCC141_ARFLAGS.x86 ?= -machine:x86
|
---|
| 247 | TOOL_VCC141_ARFLAGS.amd64 ?= -machine:amd64
|
---|
| 248 | TOOL_VCC141_ARFLAGS.arm32 ?= -machine:arm
|
---|
| 249 | TOOL_VCC141_ARLIBSUFF ?= .lib
|
---|
[819] | 250 |
|
---|
[3323] | 251 | TOOL_VCC141_LDFLAGS ?= -nologo
|
---|
| 252 | TOOL_VCC141_LDFLAGS.x86 ?= -machine:x86
|
---|
| 253 | TOOL_VCC141_LDFLAGS.amd64 ?= -machine:amd64
|
---|
| 254 | TOOL_VCC141_LDFLAGS.arm32 ?= -machine:arm
|
---|
| 255 | TOOL_VCC141_LDFLAGS.debug ?= -debug
|
---|
| 256 | TOOL_VCC141_LDFLAGS.dbgopt ?= -debug
|
---|
| 257 | TOOL_VCC141_LDFLAGS.profile ?= -debug
|
---|
| 258 | TOOL_VCC141_LDFLAGS.release ?=
|
---|
[819] | 259 |
|
---|
| 260 |
|
---|
| 261 |
|
---|
| 262 | ## Compile C source.
|
---|
| 263 | # @param $(target) Normalized main target name.
|
---|
| 264 | # @param $(source) Source filename (relative).
|
---|
| 265 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 266 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 267 | # @param $(flags) Flags.
|
---|
| 268 | # @param $(defs) Definitions. No -D or something.
|
---|
| 269 | # @param $(incs) Includes. No -I or something.
|
---|
| 270 | # @param $(dirdep) Directory creation dependency.
|
---|
| 271 | # @param $(deps) Other dependencies.
|
---|
| 272 | #
|
---|
| 273 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 274 | # @param $(objsuff) Object suffix.
|
---|
[3323] | 275 | TOOL_VCC141_COMPILE_C_DEPEND =
|
---|
| 276 | TOOL_VCC141_COMPILE_C_DEPORD =
|
---|
| 277 | TOOL_VCC141_COMPILE_C_OUTPUT =
|
---|
| 278 | TOOL_VCC141_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb)
|
---|
| 279 | ifdef TOOL_VCC141_KSUBMIT
|
---|
| 280 | TOOL_VCC141_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 281 | define TOOL_VCC141_COMPILE_C_CMDS
|
---|
| 282 | $(QUIET)$(TOOL_VCC141_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 283 | -- $(TOOL_VCC141_CC) -c\
|
---|
| 284 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[819] | 285 | -Fd$(outbase)-obj.pdb \
|
---|
| 286 | -Fo$(obj)\
|
---|
| 287 | $(subst /,\\,$(abspath $(source)))
|
---|
[3323] | 288 | endef
|
---|
| 289 | else
|
---|
| 290 | define TOOL_VCC141_COMPILE_C_CMDS
|
---|
[3326] | 291 | $(QUIET)$(TOOL_VCC141_SETUP_ENV) $(TOOL_VCC141_CC) -c\
|
---|
[3323] | 292 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
| 293 | -Fd$(outbase)-obj.pdb \
|
---|
| 294 | -Fo$(obj)\
|
---|
| 295 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 296 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[3323] | 297 | endef
|
---|
| 298 | endif # !TOOL_VCC141_KSUBMIT
|
---|
[819] | 299 |
|
---|
| 300 |
|
---|
| 301 | ## Compile C++ source.
|
---|
| 302 | # @param $(target) Normalized main target name.
|
---|
| 303 | # @param $(source) Source filename (relative).
|
---|
| 304 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 305 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 306 | # @param $(flags) Flags.
|
---|
| 307 | # @param $(defs) Definitions. No -D or something.
|
---|
| 308 | # @param $(incs) Includes. No -I or something.
|
---|
| 309 | # @param $(dirdep) Directory creation dependency.
|
---|
| 310 | # @param $(deps) Other dependencies.
|
---|
| 311 | #
|
---|
| 312 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 313 | # @param $(objsuff) Object suffix.
|
---|
[3323] | 314 | TOOL_VCC141_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
| 315 | TOOL_VCC141_COMPILE_CXX_DEPORD =
|
---|
| 316 | TOOL_VCC141_COMPILE_CXX_OUTPUT =
|
---|
| 317 | TOOL_VCC141_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 318 | ,,$(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb))
|
---|
| 319 | ifdef TOOL_VCC141_KSUBMIT
|
---|
| 320 | TOOL_VCC141_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 321 | define TOOL_VCC141_COMPILE_CXX_CMDS
|
---|
| 322 | $(QUIET)$(TOOL_VCC141_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 323 | -- $(TOOL_VCC141_CXX) -c\
|
---|
| 324 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2956] | 325 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
[3033] | 326 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
[2956] | 327 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[819] | 328 | -Fo$(obj)\
|
---|
| 329 | $(subst /,\\,$(abspath $(source)))
|
---|
[3323] | 330 | endef
|
---|
| 331 | else
|
---|
| 332 | define TOOL_VCC141_COMPILE_CXX_CMDS
|
---|
[3326] | 333 | $(QUIET)$(TOOL_VCC141_SETUP_ENV) $(TOOL_VCC141_CXX) -c\
|
---|
[3323] | 334 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
| 335 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 336 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
| 337 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
| 338 | -Fo$(obj)\
|
---|
| 339 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 340 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[3323] | 341 | endef
|
---|
| 342 | endif # !TOOL_VCC141_KSUBMIT
|
---|
[819] | 343 |
|
---|
[2954] | 344 |
|
---|
| 345 | #
|
---|
| 346 | # Helper tool for creating the precompiled C++ header.
|
---|
| 347 | #
|
---|
| 348 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 349 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 350 | #
|
---|
[3323] | 351 | TOOL_VCC141-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 352 | TOOL_VCC141-PCH_EXTENDS := VCC141
|
---|
| 353 | TOOL_VCC141-PCH_CXXOBJSUFF := .obj
|
---|
| 354 | TOOL_VCC141-PCH_CXXINCS = $(TOOL_VCC141_CXXINCS)
|
---|
| 355 | TOOL_VCC141-PCH_CXXFLAGS = $(TOOL_VCC141_CXXFLAGS) -FS
|
---|
| 356 | TOOL_VCC141-PCH_CXXFLAGS.debug = $(TOOL_VCC141_CXXFLAGS.debug)
|
---|
| 357 | TOOL_VCC141-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC141_CXXFLAGS.dbgopt)
|
---|
| 358 | TOOL_VCC141-PCH_CXXFLAGS.release = $(TOOL_VCC141_CXXFLAGS.release)
|
---|
| 359 | TOOL_VCC141-PCH_CXXFLAGS.profile = $(TOOL_VCC141_CXXFLAGS.profile)
|
---|
| 360 | TOOL_VCC141-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 361 | TOOL_VCC141-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 362 | TOOL_VCC141-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 363 | TOOL_VCC141-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 364 | ifdef TOOL_VCC141_KSUBMIT
|
---|
| 365 | define TOOL_VCC141-PCH_COMPILE_CXX_CMDS
|
---|
| 366 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 367 | $(QUIET)$(TOOL_VCC141_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
| 368 | -- $(TOOL_VCC141_CXX) -c -Yc\
|
---|
| 369 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 370 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 371 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 372 | -Fo$(obj)\
|
---|
| 373 | -TP \
|
---|
| 374 | $(subst /,\\,$(abspath $(source)))
|
---|
| 375 | endef
|
---|
| 376 | else
|
---|
[3323] | 377 | define TOOL_VCC141-PCH_COMPILE_CXX_CMDS
|
---|
| 378 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3326] | 379 | $(QUIET)$(TOOL_VCC141_SETUP_ENV) $(TOOL_VCC141_CXX) -c -Yc\
|
---|
[3323] | 380 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 381 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 382 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 383 | -Fo$(obj)\
|
---|
| 384 | -TP \
|
---|
| 385 | $(subst /,\\,$(abspath $(source)))
|
---|
| 386 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 387 |
|
---|
| 388 | endef
|
---|
[3323] | 389 | endif # !TOOL_VCC141_KSUBMIT
|
---|
[2954] | 390 |
|
---|
| 391 |
|
---|
[2611] | 392 | ## @todo configure the assembler template.
|
---|
[819] | 393 |
|
---|
| 394 | ## Compile resource source.
|
---|
| 395 | # @param $(target) Normalized main target name.
|
---|
| 396 | # @param $(source) Source filename (relative).
|
---|
| 397 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 398 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 399 | # @param $(flags) Flags.
|
---|
| 400 | # @param $(defs) Definitions. No -D or something.
|
---|
| 401 | # @param $(incs) Includes. No -I or something.
|
---|
| 402 | # @param $(dirdep) Directory creation dependency.
|
---|
| 403 | # @param $(deps) Other dependencies.
|
---|
| 404 | #
|
---|
| 405 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 406 | # @param $(objsuff) Object suffix.
|
---|
[3323] | 407 | TOOL_VCC141_COMPILE_RC_DEPEND =
|
---|
| 408 | TOOL_VCC141_COMPILE_RC_DEPORD =
|
---|
| 409 | TOOL_VCC141_COMPILE_RC_OUTPUT =
|
---|
| 410 | define TOOL_VCC141_COMPILE_RC_CMDS
|
---|
| 411 | $(QUIET)$(TOOL_VCC141_RC) \
|
---|
| 412 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
[819] | 413 | /fo$(obj)\
|
---|
| 414 | $(subst /,\\,$(abspath $(source)))
|
---|
| 415 | endef
|
---|
| 416 |
|
---|
| 417 |
|
---|
| 418 | ## Link library
|
---|
| 419 | # @param $(target) Normalized main target name.
|
---|
| 420 | # @param $(out) Library name.
|
---|
| 421 | # @param $(objs) Object files to put in the library.
|
---|
| 422 | # @param $(flags) Flags.
|
---|
| 423 | # @param $(dirdep) Directory creation dependency.
|
---|
| 424 | # @param $(deps) Other dependencies.
|
---|
| 425 | # @param $(othersrc) Unhandled sources.
|
---|
| 426 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 427 | #
|
---|
[3323] | 428 | TOOL_VCC141_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 429 | TOOL_VCC141_LINK_LIBRARY_DEPORD =
|
---|
| 430 | TOOL_VCC141_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 431 | TOOL_VCC141_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 432 | define TOOL_VCC141_LINK_LIBRARY_CMDS
|
---|
[2557] | 433 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 434 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
| 435 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
| 436 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[819] | 437 | endef
|
---|
| 438 |
|
---|
| 439 |
|
---|
| 440 | ## Link program
|
---|
| 441 | # @param $(target) Normalized main target name.
|
---|
| 442 | # @param $(out) Program name.
|
---|
| 443 | # @param $(objs) Object files to link together.
|
---|
| 444 | # @param $(libs) Libraries to search.
|
---|
| 445 | # @param $(libpath) Library search paths.
|
---|
| 446 | # @param $(flags) Flags.
|
---|
| 447 | # @param $(dirdep) Directory creation dependency.
|
---|
| 448 | # @param $(deps) Other dependencies.
|
---|
| 449 | # @param $(othersrc) Unhandled sources.
|
---|
| 450 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 451 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 452 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 453 | #
|
---|
[3323] | 454 | TOOL_VCC141_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 455 | TOOL_VCC141_LINK_PROGRAM_DEPORD =
|
---|
| 456 | TOOL_VCC141_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 457 | TOOL_VCC141_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 458 | TOOL_VCC141_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 459 | TOOL_VCC141_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 460 | define TOOL_VCC141_LINK_PROGRAM_CMDS
|
---|
[2557] | 461 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 462 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
| 463 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_LD) $(flags) \
|
---|
[819] | 464 | /OUT:$(out) \
|
---|
| 465 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 466 | /MAP:$(outbase).map \
|
---|
| 467 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 468 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 469 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 470 | @$(outbase).rsp
|
---|
[3323] | 471 | ifndef TOOL_VCC141_NO_AUTO_MANIFEST
|
---|
[1295] | 472 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3323] | 473 | $(TOOL_VCC141_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 474 | endif
|
---|
[819] | 475 | endef
|
---|
| 476 |
|
---|
| 477 |
|
---|
| 478 | ## Link DLL.
|
---|
| 479 | # @param $(target) Normalized main target name.
|
---|
| 480 | # @param $(out) DLL name.
|
---|
| 481 | # @param $(objs) Object files to link together.
|
---|
| 482 | # @param $(libs) Libraries to search.
|
---|
| 483 | # @param $(libpath) Library search paths.
|
---|
| 484 | # @param $(flags) Flags.
|
---|
| 485 | # @param $(dirdep) Directory creation dependency.
|
---|
| 486 | # @param $(deps) Other dependencies.
|
---|
| 487 | # @param $(othersrc) Unhandled sources.
|
---|
| 488 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 489 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 490 | #
|
---|
| 491 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3323] | 492 | TOOL_VCC141_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 493 | TOOL_VCC141_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
| 494 | TOOL_VCC141_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
| 495 | TOOL_VCC141_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
| 496 | TOOL_VCC141_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
| 497 | TOOL_VCC141_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 498 | TOOL_VCC141_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 499 | define TOOL_VCC141_LINK_DLL_CMDS
|
---|
[2557] | 500 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 501 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
| 502 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_LD) $(flags) \
|
---|
[819] | 503 | /OUT:$(out) \
|
---|
| 504 | /IMPLIB:$(outbase).lib \
|
---|
| 505 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 506 | /MAP:$(outbase).map \
|
---|
| 507 | /DLL \
|
---|
| 508 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 509 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 510 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 511 | @$(outbase).rsp
|
---|
[3323] | 512 | ifndef TOOL_VCC141_NO_AUTO_MANIFEST
|
---|
[1295] | 513 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3323] | 514 | $(TOOL_VCC141_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 515 | endif
|
---|
[2795] | 516 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
[3323] | 517 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
[2487] | 518 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[819] | 519 | endef
|
---|
| 520 |
|
---|
| 521 |
|
---|
| 522 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 523 | # @param $(target) Normalized main target name.
|
---|
| 524 | # @param $(out) System module name.
|
---|
| 525 | # @param $(objs) Object files to link together.
|
---|
| 526 | # @param $(libs) Libraries to search.
|
---|
| 527 | # @param $(libpath) Library search paths.
|
---|
| 528 | # @param $(flags) Flags.
|
---|
| 529 | # @param $(dirdep) Directory creation dependency.
|
---|
| 530 | # @param $(deps) Other dependencies.
|
---|
| 531 | # @param $(othersrc) Unhandled sources.
|
---|
| 532 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 533 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 534 | #
|
---|
| 535 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3323] | 536 | TOOL_VCC141_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 537 | TOOL_VCC141_LINK_SYSMOD_DEPORD =
|
---|
| 538 | TOOL_VCC141_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 539 | TOOL_VCC141_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 540 | TOOL_VCC141_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 541 | TOOL_VCC141_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 542 | define TOOL_VCC141_LINK_SYSMOD_CMDS
|
---|
[2557] | 543 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 544 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
| 545 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_LD) $(flags) \
|
---|
[819] | 546 | /OUT:$(out) \
|
---|
| 547 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 548 | /MAP:$(outbase).map \
|
---|
| 549 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 550 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 551 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 552 | @$(outbase).rsp
|
---|
[3323] | 553 | ifndef TOOL_VCC141_NO_AUTO_MANIFEST
|
---|
[1295] | 554 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3323] | 555 | $(TOOL_VCC141_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 556 | endif
|
---|
[819] | 557 | endef
|
---|
| 558 |
|
---|