[819] | 1 | # $Id: VCC140.kmk 3597 2023-06-16 20:56:17Z bird $
|
---|
| 2 | ## @file
|
---|
[3343] | 3 | # kBuild Tool Config - Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), 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 |
|
---|
[3343] | 34 | TOOL_VCC140 := Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), 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 | #
|
---|
[3343] | 43 | ifndef PATH_TOOL_VCC140
|
---|
| 44 | PATH_TOOL_VCC140 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.amd64/vcc/v14.0*/)))
|
---|
| 45 | ifeq ($(PATH_TOOL_VCC140),)
|
---|
| 46 | PATH_TOOL_VCC140 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.0*/)))
|
---|
[819] | 47 | endif
|
---|
[3343] | 48 | ifeq ($(PATH_TOOL_VCC140),)
|
---|
| 49 | PATH_TOOL_VCC140 := $(PATH_TOOL_VCC140X86)
|
---|
[857] | 50 | endif
|
---|
[3343] | 51 | ifeq ($(PATH_TOOL_VCC140),)
|
---|
| 52 | PATH_TOOL_VCC140 := $(PATH_TOOL_VCC140)
|
---|
[857] | 53 | endif
|
---|
[3343] | 54 | ifeq ($(PATH_TOOL_VCC140),)
|
---|
| 55 | PATH_TOOL_VCC140 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.0*)))
|
---|
| 56 | ifeq ($(PATH_TOOL_VCC140),)
|
---|
| 57 | ## @todo Not sure it was placed in the 14.0 directory originally, maybe that's just what 2017 and 2019 does?
|
---|
| 58 | PATH_TOOL_VCC140 := $(firstfile $(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\
|
---|
| 59 | , $(rsortfiles $(qwildcard ,$(progfilesdir)/Microsoft\ Visual\ Studio\ 14.0/VC))))
|
---|
| 60 | ifeq ($(PATH_TOOL_VCC140),)
|
---|
| 61 | $(warning kBuild: PATH_TOOL_VCC140 cannot be determined!)
|
---|
| 62 | PATH_TOOL_VCC140 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v140
|
---|
[3323] | 63 | endif
|
---|
| 64 | endif
|
---|
[857] | 65 | endif
|
---|
[819] | 66 | else
|
---|
| 67 | # Resolve any fancy stuff once and for all.
|
---|
[3343] | 68 | PATH_TOOL_VCC140 := $(PATH_TOOL_VCC140)
|
---|
[819] | 69 | endif
|
---|
[3323] | 70 |
|
---|
[3343] | 71 | ifndef PATH_TOOL_VCC140_BASE_BIN
|
---|
| 72 | PATH_TOOL_VCC140_BASE_BIN := $(PATH_TOOL_VCC140)/bin
|
---|
[3323] | 73 | endif
|
---|
[3343] | 74 | ifndef PATH_TOOL_VCC140_HOST_BIN
|
---|
| 75 | ifeq ($(KBUILD_HOST_ARCH),amd64)
|
---|
| 76 | PATH_TOOL_VCC140_HOST_BIN := $(PATH_TOOL_VCC140_BASE_BIN)/amd64
|
---|
| 77 | else if1of ($(KBUILD_HOST_ARCH), arm32 arm64)
|
---|
| 78 | PATH_TOOL_VCC140_HOST_BIN := $(PATH_TOOL_VCC140_BASE_BIN)/arm
|
---|
| 79 | else
|
---|
| 80 | PATH_TOOL_VCC140_HOST_BIN := $(PATH_TOOL_VCC140_BASE_BIN)
|
---|
| 81 | endif
|
---|
[3323] | 82 | endif
|
---|
[3343] | 83 | ifndef PATH_TOOL_VCC140_BIN
|
---|
| 84 | ifeq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
|
---|
| 85 | PATH_TOOL_VCC140_BIN := $(PATH_TOOL_VCC140_HOST_BIN)
|
---|
| 86 | else
|
---|
| 87 | PATH_TOOL_VCC140_BIN := $(PATH_TOOL_VCC140_BIN)/$(KBUILD_HOST_ARCH)_$(KBUILD_TARGET_ARCH)
|
---|
| 88 | endif
|
---|
[3323] | 89 | endif
|
---|
[3343] | 90 | PATH_TOOL_VCC140_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC140_BIN))
|
---|
[3323] | 91 |
|
---|
[3326] | 92 | # 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.
|
---|
[3343] | 93 | ifndef PATH_TOOL_VCC140_HOST_DLL_BIN
|
---|
| 94 | PATH_TOOL_VCC140_HOST_DLL_BIN := $(PATH_TOOL_VCC140_HOST_BIN)
|
---|
[3326] | 95 | endif
|
---|
[3343] | 96 | ifndef PATH_TOOL_VCC140_DLL_BIN
|
---|
| 97 | ifneq ($(PATH_TOOL_VCC140_HOST_DLL_BIN),$(PATH_TOOL_VCC140_BIN))
|
---|
| 98 | PATH_TOOL_VCC140_DLL_BIN := $(PATH_TOOL_VCC140_HOST_DLL_BIN)
|
---|
[3326] | 99 | endif
|
---|
| 100 | endif
|
---|
| 101 |
|
---|
[3343] | 102 | PATH_TOOL_VCC140_LIB.amd64 ?= $(PATH_TOOL_VCC140)/lib/amd64
|
---|
| 103 | PATH_TOOL_VCC140_LIB.arm32 ?= $(PATH_TOOL_VCC140)/lib/arm
|
---|
| 104 | PATH_TOOL_VCC140_LIB.x86 ?= $(PATH_TOOL_VCC140)/lib
|
---|
[3323] | 105 |
|
---|
[3343] | 106 | PATH_TOOL_VCC140_ONECORE_LIB.amd64 ?= $(PATH_TOOL_VCC140)/lib/onecore/amd64
|
---|
| 107 | PATH_TOOL_VCC140_ONECORE_LIB.arm32 ?= $(PATH_TOOL_VCC140)/lib/onecore/arm
|
---|
| 108 | PATH_TOOL_VCC140_ONECORE_LIB.x86 ?= $(PATH_TOOL_VCC140)/lib/onecore
|
---|
[3323] | 109 |
|
---|
[3343] | 110 | PATH_TOOL_VCC140_INC ?= $(PATH_TOOL_VCC140)/include
|
---|
[3323] | 111 |
|
---|
[3343] | 112 | PATH_TOOL_VCC140_ATLMFC ?= $(PATH_TOOL_VCC140)/atlmfc
|
---|
| 113 | PATH_TOOL_VCC140_ATLMFC_INC ?= $(PATH_TOOL_VCC140_ATLMFC)/include
|
---|
| 114 | PATH_TOOL_VCC140_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC140_ATLMFC)/lib
|
---|
| 115 | PATH_TOOL_VCC140_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC140_ATLMFC)/lib/amd64
|
---|
| 116 | PATH_TOOL_VCC140_ATLMFC_LIB.arm32 ?= $(PATH_TOOL_VCC140_ATLMFC)/lib/arm
|
---|
[3323] | 117 |
|
---|
[3343] | 118 | TOOL_VCC140_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/cl.exe
|
---|
| 119 | TOOL_VCC140_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/cl.exe
|
---|
| 120 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
| 121 | TOOL_VCC140_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/ml.exe
|
---|
| 122 | else
|
---|
| 123 | TOOL_VCC140_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/ml64.exe
|
---|
| 124 | endif
|
---|
| 125 | #TOOL_VCC140_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
| 126 | TOOL_VCC140_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/link.exe /LIB
|
---|
| 127 | TOOL_VCC140_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/link.exe
|
---|
| 128 | TOOL_VCC140_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/dumpbin.exe
|
---|
| 129 | TOOL_VCC140_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/editbin.exe
|
---|
[3323] | 130 |
|
---|
[3597] | 131 | TOOL_VCC140_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
|
---|
| 132 | TOOL_VCC140_MT ?= $(TOOL_VCC140_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
|
---|
| 133 | TOOL_VCC140_MT_RETRY ?= $(WINCMN_MT_RETRY)
|
---|
[3323] | 134 |
|
---|
[3343] | 135 | undefine TOOL_VCC140_USE_KSUBMIT # for now
|
---|
| 136 | ifdef TOOL_VCC140_USE_KSUBMIT
|
---|
[3323] | 137 | ifeq ($(KBUILD_HOST),win)
|
---|
[3343] | 138 | ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC140_BIN)),-3),64/)
|
---|
| 139 | TOOL_VCC140_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
[3323] | 140 | else
|
---|
[3343] | 141 | TOOL_VCC140_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
[3323] | 142 | endif
|
---|
[3343] | 143 | ifdef PATH_TOOL_VCC140_DLL_BIN
|
---|
| 144 | TOOL_VCC140_KSUBMIT := $(TOOL_VCC140_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140_DLL_BIN));"
|
---|
[3326] | 145 | endif
|
---|
[3343] | 146 | TOOL_VCC140_KSUBMIT_DD := $(TOOL_VCC140_KSUBMIT) --
|
---|
[819] | 147 | endif
|
---|
| 148 | endif
|
---|
[3343] | 149 | ifdef PATH_TOOL_VCC140_DLL_BIN
|
---|
| 150 | TOOL_VCC140_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140_DLL_BIN));" --$(SP)
|
---|
| 151 | ifndef TOOL_VCC140_KSUBMIT_DD
|
---|
| 152 | TOOL_VCC140_KSUBMIT_DD := $(TOOL_VCC140_SETUP_ENV)
|
---|
[3326] | 153 | endif
|
---|
| 154 | endif
|
---|
[2604] | 155 |
|
---|
[3326] | 156 |
|
---|
[3323] | 157 | ## Helper for finding rc.exe and mt.exe in the SDK.
|
---|
[3343] | 158 | TOOL_VCC140_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(qfirstfile sh,\
|
---|
[3323] | 159 | $(if-expr defined(PATH_SDK_WINSDK10_BIN) , $(qwildcard ,$(PATH_SDK_WINSDK10_BIN)/$2)) \
|
---|
| 160 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(qwildcard ,$(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
| 161 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(qwildcard ,$(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
| 162 | $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
| 163 | $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
[2604] | 164 | $1))
|
---|
[3343] | 165 | TOOL_VCC140_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC140_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
[2604] | 166 |
|
---|
[819] | 167 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
| 168 | # @param $(1) Base name, no extention.
|
---|
| 169 | # @param $(2) The extension.
|
---|
[3343] | 170 | TOOL_VCC140_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
[819] | 171 |
|
---|
[3329] | 172 | #
|
---|
[3343] | 173 | # Try find the redist directory.
|
---|
[3329] | 174 | #
|
---|
[3343] | 175 | ifndef PATH_TOOL_VCC140_REDIST
|
---|
| 176 | PATH_TOOL_VCC140_REDIST := $(PATH_TOOL_VCC140)/redist
|
---|
[3329] | 177 | endif
|
---|
[3343] | 178 | PATH_TOOL_VCC140_REDIST_DEBUG ?= $(PATH_TOOL_VCC140_REDIST)/debug_nonredist
|
---|
[2954] | 179 |
|
---|
[3340] | 180 | ## Updates may add more msvcp140_[0-9].dll images as the product matures.
|
---|
| 181 | # This helper locates them (can differ between archs).
|
---|
| 182 | # @param 1 Redist subdirectory.
|
---|
| 183 | # @param 2 The DLL basename (no suffix).
|
---|
| 184 | # @param 3 The VCC architecture name (for constructing the path).
|
---|
[3343] | 185 | FN_TOOL_VCC140_FIND_DLLS = $(2).dll \
|
---|
| 186 | $(sortfiles $(qnotdir ,$(qwildcard ,$(PATH_TOOL_VCC140_REDIST)/$(3)/$(1)/$(2)_?.dll)))
|
---|
[3340] | 187 |
|
---|
[3343] | 188 | TOOL_VCC140_REDIST_CRT_SUBDIR := Microsoft.VC140.CRT
|
---|
| 189 | TOOL_VCC140_REDIST_DEBUG_CRT_SUBDIR := Microsoft.VC140.DebugCRT
|
---|
[3329] | 190 |
|
---|
[3343] | 191 | TOOL_VCC140_REDIST_CRT_DLLS.x86 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),vcruntime140,x86)
|
---|
| 192 | TOOL_VCC140_REDIST_CRT_DLLS.amd64 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),vcruntime140,x64)
|
---|
| 193 | TOOL_VCC140_REDIST_CRT_DLLS.arm32 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),vcruntime140,arm)
|
---|
| 194 | TOOL_VCC140_REDIST_CRT_DLLS = $(TOOL_VCC140_REDIST_CRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 195 |
|
---|
[3343] | 196 | TOOL_VCC140_REDIST_CONCRT_DLLS.x86 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),concrt140,x86)
|
---|
| 197 | TOOL_VCC140_REDIST_CONCRT_DLLS.amd64 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),concrt140,x64)
|
---|
| 198 | TOOL_VCC140_REDIST_CONCRT_DLLS.arm32 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),concrt140,arm)
|
---|
| 199 | TOOL_VCC140_REDIST_CONCRT_DLLS = $(TOOL_VCC140_REDIST_CONCRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 200 |
|
---|
[3343] | 201 | TOOL_VCC140_REDIST_CPP_DLLS.x86 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),msvcp140,x86)
|
---|
| 202 | TOOL_VCC140_REDIST_CPP_DLLS.amd64 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),msvcp140,x64)
|
---|
| 203 | TOOL_VCC140_REDIST_CPP_DLLS.arm32 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),msvcp140,arm)
|
---|
| 204 | TOOL_VCC140_REDIST_CPP_DLLS = $(TOOL_VCC140_REDIST_CPP_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 205 |
|
---|
[3343] | 206 | TOOL_VCC140_REDIST_WINRT_DLLS.x86 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),vccorlib140,x86)
|
---|
| 207 | TOOL_VCC140_REDIST_WINRT_DLLS.amd64 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),vccorlib140,x64)
|
---|
| 208 | TOOL_VCC140_REDIST_WINRT_DLLS.arm32 = $(call FN_TOOL_VCC140_FIND_DLLS,$(TOOL_VCC140_REDIST_CRT_SUBDIR),vccorlib140,arm)
|
---|
| 209 | TOOL_VCC140_REDIST_WINRT_DLLS = $(TOOL_VCC140_REDIST_WINRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
[3340] | 210 |
|
---|
[3343] | 211 | TOOL_VCC140_REDIST_CXXAMP_SUBDIR := Microsoft.VC140.CXXAMP
|
---|
| 212 | TOOL_VCC140_REDIST_MFC_SUBDIR := Microsoft.VC140.MFC
|
---|
| 213 | TOOL_VCC140_REDIST_MFCLOC_SUBDIR := Microsoft.VC140.MFCLOC
|
---|
| 214 | TOOL_VCC140_REDIST_OPENMP_SUBDIR := Microsoft.VC140.OpenMP
|
---|
[3329] | 215 |
|
---|
| 216 |
|
---|
[3323] | 217 | #
|
---|
| 218 | # Properties used by kBuild
|
---|
| 219 | #
|
---|
[3343] | 220 | TOOL_VCC140_COBJSUFF ?= .obj
|
---|
| 221 | TOOL_VCC140_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
| 222 | TOOL_VCC140_CFLAGS.debug ?=
|
---|
| 223 | TOOL_VCC140_CFLAGS.dbgopt ?= -O2
|
---|
| 224 | TOOL_VCC140_CFLAGS.release ?= -O2
|
---|
| 225 | TOOL_VCC140_CFLAGS.profile ?= -O2
|
---|
| 226 | TOOL_VCC140_CINCS ?= $(PATH_TOOL_VCC140_INC)
|
---|
| 227 | TOOL_VCC140_CDEFS ?=
|
---|
[819] | 228 |
|
---|
[3343] | 229 | TOOL_VCC140_CXXOBJSUFF ?= .obj
|
---|
| 230 | TOOL_VCC140_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
| 231 | TOOL_VCC140_CXXFLAGS.debug ?=
|
---|
| 232 | TOOL_VCC140_CXXFLAGS.dbgopt ?= -O2
|
---|
| 233 | TOOL_VCC140_CXXFLAGS.release ?= -O2
|
---|
| 234 | TOOL_VCC140_CXXFLAGS.profile ?= -O2
|
---|
| 235 | TOOL_VCC140_CXXINCS ?= $(PATH_TOOL_VCC140_INC) $(PATH_TOOL_VCC140_ATLMFC_INC)
|
---|
| 236 | TOOL_VCC140_CXXDEFS ?=
|
---|
[819] | 237 |
|
---|
[3343] | 238 | TOOL_VCC140_ASOBJSUFF ?= .obj
|
---|
[819] | 239 |
|
---|
[3343] | 240 | TOOL_VCC140_RCOBJSUFF ?= .res
|
---|
| 241 | TOOL_VCC140_RCINCS ?= $(PATH_TOOL_VCC140_INC) $(PATH_TOOL_VCC140_ATLMFC_INC)
|
---|
[819] | 242 |
|
---|
[3343] | 243 | TOOL_VCC140_ARFLAGS ?= -nologo
|
---|
| 244 | TOOL_VCC140_ARFLAGS.x86 ?= -machine:x86
|
---|
| 245 | TOOL_VCC140_ARFLAGS.amd64 ?= -machine:amd64
|
---|
| 246 | TOOL_VCC140_ARFLAGS.arm32 ?= -machine:arm
|
---|
| 247 | TOOL_VCC140_ARLIBSUFF ?= .lib
|
---|
[819] | 248 |
|
---|
[3343] | 249 | TOOL_VCC140_LDFLAGS ?= -nologo
|
---|
| 250 | TOOL_VCC140_LDFLAGS.x86 ?= -machine:x86
|
---|
| 251 | TOOL_VCC140_LDFLAGS.amd64 ?= -machine:amd64
|
---|
| 252 | TOOL_VCC140_LDFLAGS.arm32 ?= -machine:arm
|
---|
| 253 | TOOL_VCC140_LDFLAGS.debug ?= -debug
|
---|
| 254 | TOOL_VCC140_LDFLAGS.dbgopt ?= -debug
|
---|
| 255 | TOOL_VCC140_LDFLAGS.profile ?= -debug
|
---|
| 256 | TOOL_VCC140_LDFLAGS.release ?=
|
---|
[819] | 257 |
|
---|
| 258 |
|
---|
| 259 |
|
---|
| 260 | ## Compile C source.
|
---|
| 261 | # @param $(target) Normalized main target name.
|
---|
| 262 | # @param $(source) Source filename (relative).
|
---|
| 263 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 264 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 265 | # @param $(flags) Flags.
|
---|
| 266 | # @param $(defs) Definitions. No -D or something.
|
---|
| 267 | # @param $(incs) Includes. No -I or something.
|
---|
| 268 | # @param $(dirdep) Directory creation dependency.
|
---|
| 269 | # @param $(deps) Other dependencies.
|
---|
| 270 | #
|
---|
| 271 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 272 | # @param $(objsuff) Object suffix.
|
---|
[3343] | 273 | TOOL_VCC140_COMPILE_C_DEPEND =
|
---|
| 274 | TOOL_VCC140_COMPILE_C_DEPORD =
|
---|
| 275 | TOOL_VCC140_COMPILE_C_OUTPUT =
|
---|
| 276 | TOOL_VCC140_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC140_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC140_PDB, $(outbase)-obj,idb)
|
---|
| 277 | ifdef TOOL_VCC140_KSUBMIT
|
---|
| 278 | TOOL_VCC140_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 279 | define TOOL_VCC140_COMPILE_C_CMDS
|
---|
| 280 | $(QUIET)$(TOOL_VCC140_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 281 | -- $(TOOL_VCC140_CC) -c\
|
---|
[3323] | 282 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[819] | 283 | -Fd$(outbase)-obj.pdb \
|
---|
| 284 | -Fo$(obj)\
|
---|
| 285 | $(subst /,\\,$(abspath $(source)))
|
---|
[3323] | 286 | endef
|
---|
| 287 | else
|
---|
[3343] | 288 | define TOOL_VCC140_COMPILE_C_CMDS
|
---|
| 289 | $(QUIET)$(TOOL_VCC140_SETUP_ENV) $(TOOL_VCC140_CC) -c\
|
---|
[3323] | 290 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
| 291 | -Fd$(outbase)-obj.pdb \
|
---|
| 292 | -Fo$(obj)\
|
---|
| 293 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 294 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[3323] | 295 | endef
|
---|
[3343] | 296 | endif # !TOOL_VCC140_KSUBMIT
|
---|
[819] | 297 |
|
---|
| 298 |
|
---|
| 299 | ## Compile C++ source.
|
---|
| 300 | # @param $(target) Normalized main target name.
|
---|
| 301 | # @param $(source) Source filename (relative).
|
---|
| 302 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 303 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 304 | # @param $(flags) Flags.
|
---|
| 305 | # @param $(defs) Definitions. No -D or something.
|
---|
| 306 | # @param $(incs) Includes. No -I or something.
|
---|
| 307 | # @param $(dirdep) Directory creation dependency.
|
---|
| 308 | # @param $(deps) Other dependencies.
|
---|
| 309 | #
|
---|
| 310 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 311 | # @param $(objsuff) Object suffix.
|
---|
[3343] | 312 | TOOL_VCC140_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
| 313 | TOOL_VCC140_COMPILE_CXX_DEPORD =
|
---|
| 314 | TOOL_VCC140_COMPILE_CXX_OUTPUT =
|
---|
| 315 | TOOL_VCC140_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 316 | ,,$(call TOOL_VCC140_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC140_PDB, $(outbase)-obj,idb))
|
---|
| 317 | ifdef TOOL_VCC140_KSUBMIT
|
---|
| 318 | TOOL_VCC140_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 319 | define TOOL_VCC140_COMPILE_CXX_CMDS
|
---|
| 320 | $(QUIET)$(TOOL_VCC140_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
| 321 | -- $(TOOL_VCC140_CXX) -c\
|
---|
[3323] | 322 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2956] | 323 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
[3033] | 324 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
[2956] | 325 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[819] | 326 | -Fo$(obj)\
|
---|
| 327 | $(subst /,\\,$(abspath $(source)))
|
---|
[3323] | 328 | endef
|
---|
| 329 | else
|
---|
[3343] | 330 | define TOOL_VCC140_COMPILE_CXX_CMDS
|
---|
| 331 | $(QUIET)$(TOOL_VCC140_SETUP_ENV) $(TOOL_VCC140_CXX) -c\
|
---|
[3323] | 332 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
| 333 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 334 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
| 335 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
| 336 | -Fo$(obj)\
|
---|
| 337 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 338 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
[3323] | 339 | endef
|
---|
[3343] | 340 | endif # !TOOL_VCC140_KSUBMIT
|
---|
[819] | 341 |
|
---|
[2954] | 342 |
|
---|
| 343 | #
|
---|
| 344 | # Helper tool for creating the precompiled C++ header.
|
---|
| 345 | #
|
---|
| 346 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 347 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 348 | #
|
---|
[3343] | 349 | TOOL_VCC140-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 350 | TOOL_VCC140-PCH_EXTENDS := VCC140
|
---|
| 351 | TOOL_VCC140-PCH_CXXOBJSUFF := .obj
|
---|
| 352 | TOOL_VCC140-PCH_CXXINCS = $(TOOL_VCC140_CXXINCS)
|
---|
| 353 | TOOL_VCC140-PCH_CXXFLAGS = $(TOOL_VCC140_CXXFLAGS) -FS
|
---|
| 354 | TOOL_VCC140-PCH_CXXFLAGS.debug = $(TOOL_VCC140_CXXFLAGS.debug)
|
---|
| 355 | TOOL_VCC140-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC140_CXXFLAGS.dbgopt)
|
---|
| 356 | TOOL_VCC140-PCH_CXXFLAGS.release = $(TOOL_VCC140_CXXFLAGS.release)
|
---|
| 357 | TOOL_VCC140-PCH_CXXFLAGS.profile = $(TOOL_VCC140_CXXFLAGS.profile)
|
---|
| 358 | TOOL_VCC140-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 359 | TOOL_VCC140-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 360 | TOOL_VCC140-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 361 | TOOL_VCC140-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 362 | ifdef TOOL_VCC140_KSUBMIT
|
---|
| 363 | define TOOL_VCC140-PCH_COMPILE_CXX_CMDS
|
---|
[3323] | 364 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3343] | 365 | $(QUIET)$(TOOL_VCC140_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
| 366 | -- $(TOOL_VCC140_CXX) -c -Yc\
|
---|
[3323] | 367 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 368 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 369 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 370 | -Fo$(obj)\
|
---|
| 371 | -TP \
|
---|
| 372 | $(subst /,\\,$(abspath $(source)))
|
---|
| 373 | endef
|
---|
| 374 | else
|
---|
[3343] | 375 | define TOOL_VCC140-PCH_COMPILE_CXX_CMDS
|
---|
[3323] | 376 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3343] | 377 | $(QUIET)$(TOOL_VCC140_SETUP_ENV) $(TOOL_VCC140_CXX) -c -Yc\
|
---|
[3323] | 378 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
[2954] | 379 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 380 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 381 | -Fo$(obj)\
|
---|
| 382 | -TP \
|
---|
| 383 | $(subst /,\\,$(abspath $(source)))
|
---|
| 384 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 385 |
|
---|
| 386 | endef
|
---|
[3343] | 387 | endif # !TOOL_VCC140_KSUBMIT
|
---|
[2954] | 388 |
|
---|
| 389 |
|
---|
[2611] | 390 | ## @todo configure the assembler template.
|
---|
[819] | 391 |
|
---|
| 392 | ## Compile resource source.
|
---|
| 393 | # @param $(target) Normalized main target name.
|
---|
| 394 | # @param $(source) Source filename (relative).
|
---|
| 395 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 396 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 397 | # @param $(flags) Flags.
|
---|
| 398 | # @param $(defs) Definitions. No -D or something.
|
---|
| 399 | # @param $(incs) Includes. No -I or something.
|
---|
| 400 | # @param $(dirdep) Directory creation dependency.
|
---|
| 401 | # @param $(deps) Other dependencies.
|
---|
| 402 | #
|
---|
| 403 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 404 | # @param $(objsuff) Object suffix.
|
---|
[3343] | 405 | TOOL_VCC140_COMPILE_RC_DEPEND =
|
---|
| 406 | TOOL_VCC140_COMPILE_RC_DEPORD =
|
---|
| 407 | TOOL_VCC140_COMPILE_RC_OUTPUT =
|
---|
| 408 | define TOOL_VCC140_COMPILE_RC_CMDS
|
---|
| 409 | $(QUIET)$(TOOL_VCC140_RC) \
|
---|
[3323] | 410 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
[819] | 411 | /fo$(obj)\
|
---|
| 412 | $(subst /,\\,$(abspath $(source)))
|
---|
| 413 | endef
|
---|
| 414 |
|
---|
| 415 |
|
---|
| 416 | ## Link library
|
---|
| 417 | # @param $(target) Normalized main target name.
|
---|
| 418 | # @param $(out) Library name.
|
---|
| 419 | # @param $(objs) Object files to put in the library.
|
---|
| 420 | # @param $(flags) Flags.
|
---|
| 421 | # @param $(dirdep) Directory creation dependency.
|
---|
| 422 | # @param $(deps) Other dependencies.
|
---|
| 423 | # @param $(othersrc) Unhandled sources.
|
---|
| 424 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 425 | #
|
---|
[3343] | 426 | TOOL_VCC140_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 427 | TOOL_VCC140_LINK_LIBRARY_DEPORD =
|
---|
| 428 | TOOL_VCC140_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 429 | TOOL_VCC140_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 430 | define TOOL_VCC140_LINK_LIBRARY_CMDS
|
---|
[2557] | 431 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 432 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
| 433 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
[3343] | 434 | $(QUIET)$(TOOL_VCC140_KSUBMIT_DD) $(TOOL_VCC140_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[819] | 435 | endef
|
---|
| 436 |
|
---|
| 437 |
|
---|
| 438 | ## Link program
|
---|
| 439 | # @param $(target) Normalized main target name.
|
---|
| 440 | # @param $(out) Program name.
|
---|
| 441 | # @param $(objs) Object files to link together.
|
---|
| 442 | # @param $(libs) Libraries to search.
|
---|
| 443 | # @param $(libpath) Library search paths.
|
---|
| 444 | # @param $(flags) Flags.
|
---|
| 445 | # @param $(dirdep) Directory creation dependency.
|
---|
| 446 | # @param $(deps) Other dependencies.
|
---|
| 447 | # @param $(othersrc) Unhandled sources.
|
---|
| 448 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 449 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 450 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 451 | #
|
---|
[3343] | 452 | TOOL_VCC140_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 453 | TOOL_VCC140_LINK_PROGRAM_DEPORD =
|
---|
| 454 | TOOL_VCC140_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 455 | TOOL_VCC140_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 456 | TOOL_VCC140_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 457 | TOOL_VCC140_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 458 | define TOOL_VCC140_LINK_PROGRAM_CMDS
|
---|
[2557] | 459 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 460 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
[3343] | 461 | $(QUIET)$(TOOL_VCC140_KSUBMIT_DD) $(TOOL_VCC140_LD) $(flags) \
|
---|
[819] | 462 | /OUT:$(out) \
|
---|
| 463 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 464 | /MAP:$(outbase).map \
|
---|
| 465 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 466 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 467 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 468 | @$(outbase).rsp
|
---|
[3343] | 469 | ifndef TOOL_VCC140_NO_AUTO_MANIFEST
|
---|
[1295] | 470 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3343] | 471 | $(TOOL_VCC140_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 472 | endif
|
---|
[819] | 473 | endef
|
---|
| 474 |
|
---|
| 475 |
|
---|
| 476 | ## Link DLL.
|
---|
| 477 | # @param $(target) Normalized main target name.
|
---|
| 478 | # @param $(out) DLL name.
|
---|
| 479 | # @param $(objs) Object files to link together.
|
---|
| 480 | # @param $(libs) Libraries to search.
|
---|
| 481 | # @param $(libpath) Library search paths.
|
---|
| 482 | # @param $(flags) Flags.
|
---|
| 483 | # @param $(dirdep) Directory creation dependency.
|
---|
| 484 | # @param $(deps) Other dependencies.
|
---|
| 485 | # @param $(othersrc) Unhandled sources.
|
---|
| 486 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 487 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 488 | #
|
---|
| 489 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3343] | 490 | TOOL_VCC140_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 491 | TOOL_VCC140_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
| 492 | TOOL_VCC140_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
| 493 | TOOL_VCC140_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
| 494 | TOOL_VCC140_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
| 495 | TOOL_VCC140_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 496 | TOOL_VCC140_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 497 | define TOOL_VCC140_LINK_DLL_CMDS
|
---|
[2557] | 498 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 499 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
[3343] | 500 | $(QUIET)$(TOOL_VCC140_KSUBMIT_DD) $(TOOL_VCC140_LD) $(flags) \
|
---|
[819] | 501 | /OUT:$(out) \
|
---|
| 502 | /IMPLIB:$(outbase).lib \
|
---|
| 503 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 504 | /MAP:$(outbase).map \
|
---|
| 505 | /DLL \
|
---|
| 506 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 507 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 508 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 509 | @$(outbase).rsp
|
---|
[3343] | 510 | ifndef TOOL_VCC140_NO_AUTO_MANIFEST
|
---|
[1295] | 511 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3343] | 512 | $(TOOL_VCC140_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 513 | endif
|
---|
[2795] | 514 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
[3323] | 515 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
[2487] | 516 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[819] | 517 | endef
|
---|
| 518 |
|
---|
| 519 |
|
---|
| 520 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 521 | # @param $(target) Normalized main target name.
|
---|
| 522 | # @param $(out) System module name.
|
---|
| 523 | # @param $(objs) Object files to link together.
|
---|
| 524 | # @param $(libs) Libraries to search.
|
---|
| 525 | # @param $(libpath) Library search paths.
|
---|
| 526 | # @param $(flags) Flags.
|
---|
| 527 | # @param $(dirdep) Directory creation dependency.
|
---|
| 528 | # @param $(deps) Other dependencies.
|
---|
| 529 | # @param $(othersrc) Unhandled sources.
|
---|
| 530 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 531 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 532 | #
|
---|
| 533 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[3343] | 534 | TOOL_VCC140_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 535 | TOOL_VCC140_LINK_SYSMOD_DEPORD =
|
---|
| 536 | TOOL_VCC140_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
| 537 | TOOL_VCC140_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
| 538 | TOOL_VCC140_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 539 | TOOL_VCC140_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
| 540 | define TOOL_VCC140_LINK_SYSMOD_CMDS
|
---|
[2557] | 541 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[3323] | 542 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
[3343] | 543 | $(QUIET)$(TOOL_VCC140_KSUBMIT_DD) $(TOOL_VCC140_LD) $(flags) \
|
---|
[819] | 544 | /OUT:$(out) \
|
---|
| 545 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
| 546 | /MAP:$(outbase).map \
|
---|
| 547 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 548 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
[3323] | 549 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
[2557] | 550 | @$(outbase).rsp
|
---|
[3343] | 551 | ifndef TOOL_VCC140_NO_AUTO_MANIFEST
|
---|
[1295] | 552 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[3343] | 553 | $(TOOL_VCC140_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 554 | endif
|
---|
[819] | 555 | endef
|
---|
| 556 |
|
---|