[434] | 1 | # $Id: VCC100AMD64.kmk 3313 2020-03-16 02:31:38Z bird $
|
---|
| 2 | ## @file
|
---|
[2408] | 3 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting AMD64.
|
---|
[434] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[3121] | 7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[434] | 8 | #
|
---|
| 9 | # This file is part of kBuild.
|
---|
| 10 | #
|
---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
| 12 | # it under the terms of the GNU General Public License as published by
|
---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | # (at your option) any later version.
|
---|
| 15 | #
|
---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | # GNU General Public License for more details.
|
---|
| 20 | #
|
---|
| 21 | # You should have received a copy of the GNU General Public License
|
---|
| 22 | # along with kBuild; if not, write to the Free Software
|
---|
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 24 | #
|
---|
| 25 | #
|
---|
[1547] | 26 | # As a special exception you are granted permission to include this file, via
|
---|
[2018] | 27 | # the kmk include directive, as you wish without this in itself causing the
|
---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
[1547] | 29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
| 30 | # program, whatever should not be covered the GPL.
|
---|
| 31 | #
|
---|
| 32 | #
|
---|
[434] | 33 |
|
---|
[2408] | 34 | TOOL_VCC100AMD64 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting AMD64
|
---|
[434] | 35 |
|
---|
[667] | 36 | # Tool Specific Properties
|
---|
[2408] | 37 | ifndef PATH_TOOL_VCC100AMD64
|
---|
[2726] | 38 | PATH_TOOL_VCC100AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
|
---|
[2408] | 39 | ifeq ($(PATH_TOOL_VCC100AMD64),)
|
---|
| 40 | PATH_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100)
|
---|
[667] | 41 | endif
|
---|
[2408] | 42 | ifeq ($(PATH_TOOL_VCC100AMD64),)
|
---|
| 43 | PATH_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100X86)
|
---|
[706] | 44 | endif
|
---|
[2408] | 45 | ifeq ($(PATH_TOOL_VCC100AMD64),)
|
---|
[2726] | 46 | PATH_TOOL_VCC100AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
|
---|
[667] | 47 | endif
|
---|
[2408] | 48 | ifneq ($(PATH_TOOL_VCC100AMD64),)
|
---|
| 49 | PATH_TOOL_VCC100AMD64 := $(lastword $(sort $(PATH_TOOL_VCC100AMD64)))
|
---|
[667] | 50 | else
|
---|
[2408] | 51 | $(warning kBuild: PATH_TOOL_VCC100AMD64 cannot be determined!)
|
---|
[2726] | 52 | PATH_TOOL_VCC100AMD64 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v10
|
---|
[667] | 53 | endif
|
---|
[434] | 54 | else
|
---|
[667] | 55 | # Resolve any fancy stuff once and for all.
|
---|
[2408] | 56 | PATH_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100AMD64)
|
---|
[434] | 57 | endif
|
---|
[1504] | 58 | ifeq ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
|
---|
[2408] | 59 | PATH_TOOL_VCC100AMD64_BIN ?= $(PATH_TOOL_VCC100AMD64)/bin/amd64
|
---|
[667] | 60 | else
|
---|
[2408] | 61 | PATH_TOOL_VCC100AMD64_BIN ?= $(PATH_TOOL_VCC100AMD64)/bin/x86_amd64
|
---|
[667] | 62 | endif
|
---|
[2408] | 63 | PATH_TOOL_VCC100AMD64_LIB ?= $(PATH_TOOL_VCC100AMD64)/lib/amd64
|
---|
| 64 | PATH_TOOL_VCC100AMD64_INC ?= $(PATH_TOOL_VCC100AMD64)/include
|
---|
| 65 | PATH_TOOL_VCC100AMD64_ATLMFC ?= $(PATH_TOOL_VCC100AMD64)/atlmfc
|
---|
| 66 | PATH_TOOL_VCC100AMD64_ATLMFC_INC ?= $(PATH_TOOL_VCC100AMD64_ATLMFC)/include
|
---|
| 67 | PATH_TOOL_VCC100AMD64_ATLMFC_LIB ?= $(PATH_TOOL_VCC100AMD64_ATLMFC)/lib/amd64
|
---|
| 68 | TOOL_VCC100AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/cl.exe
|
---|
| 69 | TOOL_VCC100AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/cl.exe
|
---|
| 70 | TOOL_VCC100AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/ml64.exe
|
---|
[2902] | 71 | #TOOL_VCC100AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/lib.exe - just an exec wrapper for the below
|
---|
| 72 | TOOL_VCC100AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/link.exe /LIB
|
---|
[2408] | 73 | TOOL_VCC100AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/link.exe
|
---|
[2622] | 74 | TOOL_VCC100AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/dumpbin.exe
|
---|
| 75 | TOOL_VCC100AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/editbin.exe
|
---|
[2606] | 76 | TOOL_VCC100AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
|
---|
| 77 | TOOL_VCC100AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
|
---|
[2847] | 78 | ifdef TOOL_VCC100AMD64_USE_KSUBMIT
|
---|
[2870] | 79 | ifeq ($(KBUILD_HOST),win)
|
---|
| 80 | ifneq ($(substr $(PATH_TOOL_VCC100AMD64_BIN),-9),x86_amd64)
|
---|
[2895] | 81 | TOOL_VCC100AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
[3313] | 82 | if $(KBUILD_KMK_REVISION) > 3311
|
---|
| 83 | TOOL_VCC100AMD64_KSUBMIT_SPECIAL_ENV = -s "_MSPDBSRV_ENDPOINT_=kBuild_vcc10_amd64_@@AUTHENTICATION_ID@@_$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),common,@@PROCESS_GROUP@@)"
|
---|
| 84 | endif
|
---|
| 85 | TOOL_VCC100AMD64_KSUBMIT_DD = $(TOOL_VCC100AMD64_KSUBMIT) $(TOOL_VCC100AMD64_KSUBMIT_SPECIAL_ENV) --
|
---|
[2870] | 86 | else
|
---|
[2919] | 87 | # "fatal error C1902: Program database manager mismatch; please check your installation" when mixing with the 32-bit compiler.
|
---|
| 88 | #TOOL_VCC100AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
| 89 | #TOOL_VCC100AMD64_KSUBMIT_DD = $(TOOL_VCC100AMD64_KSUBMIT) --
|
---|
[2870] | 90 | endif
|
---|
[2847] | 91 | endif
|
---|
| 92 | endif
|
---|
[2604] | 93 |
|
---|
| 94 | # The following in duplicated in VCC100.kmk and VCC100X86.kmk.
|
---|
[2606] | 95 | TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
|
---|
| 96 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
| 97 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
| 98 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
| 99 | $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
[2609] | 100 | $1))
|
---|
[2606] | 101 | TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
[2604] | 102 |
|
---|
[735] | 103 | ## Disabled fast DEP_IDB based dependencies.
|
---|
[2408] | 104 | #VCC100AMD64_OLD_DEPS = 1
|
---|
[434] | 105 |
|
---|
| 106 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
| 107 | # @param $(1) Base name, no extention.
|
---|
| 108 | # @param $(2) The extension.
|
---|
[2408] | 109 | TOOL_VCC100AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
[434] | 110 |
|
---|
[2954] | 111 |
|
---|
| 112 | # General Properties used by kBuild
|
---|
[2408] | 113 | TOOL_VCC100AMD64_COBJSUFF ?= .obj
|
---|
[2953] | 114 | TOOL_VCC100AMD64_CFLAGS ?= -TC -nologo -Zi
|
---|
| 115 | TOOL_VCC100AMD64_CFLAGS.debug ?=
|
---|
| 116 | TOOL_VCC100AMD64_CFLAGS.dbgopt ?= -O2
|
---|
[2408] | 117 | TOOL_VCC100AMD64_CFLAGS.release ?= -O2
|
---|
| 118 | TOOL_VCC100AMD64_CFLAGS.profile ?= -O2
|
---|
| 119 | TOOL_VCC100AMD64_CINCS ?= $(PATH_TOOL_VCC100AMD64_INC)
|
---|
| 120 | TOOL_VCC100AMD64_CDEFS ?=
|
---|
[434] | 121 |
|
---|
[2408] | 122 | TOOL_VCC100AMD64_CXXOBJSUFF ?= .obj
|
---|
[2953] | 123 | TOOL_VCC100AMD64_CXXFLAGS ?= -TP -nologo -Zi
|
---|
| 124 | TOOL_VCC100AMD64_CXXFLAGS.debug ?=
|
---|
| 125 | TOOL_VCC100AMD64_CXXFLAGS.dbgopt ?= -O2
|
---|
[2408] | 126 | TOOL_VCC100AMD64_CXXFLAGS.release ?= -O2
|
---|
| 127 | TOOL_VCC100AMD64_CXXFLAGS.profile ?= -O2
|
---|
| 128 | TOOL_VCC100AMD64_CXXINCS ?= $(PATH_TOOL_VCC100AMD64_INC) $(PATH_TOOL_VCC100AMD64_ATLMFC_INC)
|
---|
| 129 | TOOL_VCC100AMD64_CXXDEFS ?=
|
---|
[434] | 130 |
|
---|
[2408] | 131 | TOOL_VCC100AMD64_ASOBJSUFF ?= .obj
|
---|
[434] | 132 |
|
---|
[2408] | 133 | TOOL_VCC100AMD64_RCOBJSUFF ?= .res
|
---|
| 134 | TOOL_VCC100AMD64_RCINCS ?= $(PATH_TOOL_VCC100AMD64_INC) $(PATH_TOOL_VCC100AMD64_ATLMFC_INC)
|
---|
[667] | 135 |
|
---|
[2408] | 136 | TOOL_VCC100AMD64_ARFLAGS ?= -nologo -machine:amd64
|
---|
| 137 | TOOL_VCC100AMD64_ARLIBSUFF ?= .lib
|
---|
[667] | 138 |
|
---|
[2408] | 139 | TOOL_VCC100AMD64_LDFLAGS ?= -nologo -machine:amd64
|
---|
| 140 | TOOL_VCC100AMD64_LDFLAGS.debug ?= -debug
|
---|
[2625] | 141 | TOOL_VCC100AMD64_LDFLAGS.dbgopt ?= -debug
|
---|
| 142 | TOOL_VCC100AMD64_LDFLAGS.profile ?= -debug
|
---|
[2408] | 143 | TOOL_VCC100AMD64_LDFLAGS.release ?=
|
---|
[667] | 144 |
|
---|
| 145 |
|
---|
| 146 |
|
---|
[434] | 147 | ## Compile C source.
|
---|
| 148 | # @param $(target) Normalized main target name.
|
---|
| 149 | # @param $(source) Source filename (relative).
|
---|
| 150 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 151 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 152 | # @param $(flags) Flags.
|
---|
| 153 | # @param $(defs) Definitions. No -D or something.
|
---|
| 154 | # @param $(incs) Includes. No -I or something.
|
---|
| 155 | # @param $(dirdep) Directory creation dependency.
|
---|
| 156 | # @param $(deps) Other dependencies.
|
---|
| 157 | #
|
---|
| 158 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 159 | # @param $(objsuff) Object suffix.
|
---|
[2408] | 160 | TOOL_VCC100AMD64_COMPILE_C_DEPEND =
|
---|
| 161 | TOOL_VCC100AMD64_COMPILE_C_DEPORD =
|
---|
[2951] | 162 | TOOL_VCC100AMD64_COMPILE_C_OUTPUT =
|
---|
| 163 | TOOL_VCC100AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,idb)
|
---|
| 164 | ifdef TOOL_VCC100AMD64_KSUBMIT
|
---|
| 165 | TOOL_VCC100AMD64_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 166 | define TOOL_VCC100AMD64_COMPILE_C_CMDS
|
---|
[3313] | 167 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT) $(TOOL_VCC100AMD64_KSUBMIT_SPECIAL_ENV) \
|
---|
| 168 | -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
[2895] | 169 | -- $(TOOL_VCC100AMD64_CC) -c\
|
---|
[434] | 170 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 171 | -Fd$(outbase)-obj.pdb \
|
---|
| 172 | -Fo$(obj)\
|
---|
[697] | 173 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 174 | endef
|
---|
| 175 | else
|
---|
| 176 | define TOOL_VCC100AMD64_COMPILE_C_CMDS
|
---|
[2895] | 177 | $(QUIET)$(TOOL_VCC100AMD64_CC) -c\
|
---|
| 178 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 179 | -Fd$(outbase)-obj.pdb \
|
---|
| 180 | -Fo$(obj)\
|
---|
| 181 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 182 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
| 183 | endef
|
---|
| 184 | endif # !TOOL_VCC100AMD64_KSUBMIT
|
---|
[434] | 185 |
|
---|
| 186 |
|
---|
| 187 | ## Compile C++ source.
|
---|
| 188 | # @param $(target) Normalized main target name.
|
---|
| 189 | # @param $(source) Source filename (relative).
|
---|
| 190 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 191 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 192 | # @param $(flags) Flags.
|
---|
| 193 | # @param $(defs) Definitions. No -D or something.
|
---|
| 194 | # @param $(incs) Includes. No -I or something.
|
---|
| 195 | # @param $(dirdep) Directory creation dependency.
|
---|
| 196 | # @param $(deps) Other dependencies.
|
---|
| 197 | #
|
---|
| 198 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 199 | # @param $(objsuff) Object suffix.
|
---|
[2954] | 200 | TOOL_VCC100AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
[2408] | 201 | TOOL_VCC100AMD64_COMPILE_CXX_DEPORD =
|
---|
[2951] | 202 | TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT =
|
---|
[2954] | 203 | TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
| 204 | ,,$(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,idb))
|
---|
[2951] | 205 | ifdef TOOL_VCC100AMD64_KSUBMIT
|
---|
| 206 | TOOL_VCC100AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
| 207 | define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
|
---|
[3313] | 208 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT) $(TOOL_VCC100AMD64_KSUBMIT_SPECIAL_ENV) \
|
---|
| 209 | -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj) -- $(TOOL_VCC100AMD64_CXX) -c\
|
---|
[434] | 210 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2956] | 211 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 212 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
|
---|
| 213 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[434] | 214 | -Fo$(obj)\
|
---|
[697] | 215 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 216 | endef
|
---|
| 217 | else
|
---|
| 218 | define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
|
---|
[2895] | 219 | $(QUIET)$(TOOL_VCC100AMD64_CXX) -c\
|
---|
| 220 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2956] | 221 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
| 222 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
|
---|
| 223 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
[2895] | 224 | -Fo$(obj)\
|
---|
| 225 | $(subst /,\\,$(abspath $(source)))
|
---|
[2951] | 226 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
| 227 | endef
|
---|
| 228 | endif # !TOOL_VCC100AMD64_KSUBMIT
|
---|
[434] | 229 |
|
---|
[2954] | 230 |
|
---|
| 231 | #
|
---|
| 232 | # Helper tool for creating the precompiled C++ header.
|
---|
| 233 | #
|
---|
| 234 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
| 235 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
| 236 | #
|
---|
| 237 | TOOL_VCC100AMD64-PCH := Helper for creating precompiled header using CXX handling.
|
---|
| 238 | TOOL_VCC100AMD64-PCH_EXTENDS := VCC100AMD64
|
---|
| 239 | TOOL_VCC100AMD64-PCH_CXXOBJSUFF := .obj
|
---|
| 240 | TOOL_VCC100AMD64-PCH_CXXINCS = $(TOOL_VCC100AMD64_CXXINCS)
|
---|
[2964] | 241 | TOOL_VCC100AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC100AMD64_CXXFLAGS.debug)
|
---|
| 242 | TOOL_VCC100AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC100AMD64_CXXFLAGS.dbgopt)
|
---|
| 243 | TOOL_VCC100AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC100AMD64_CXXFLAGS.release)
|
---|
| 244 | TOOL_VCC100AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC100AMD64_CXXFLAGS.profile)
|
---|
[2954] | 245 | TOOL_VCC100AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
| 246 | TOOL_VCC100AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
| 247 | TOOL_VCC100AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
| 248 | TOOL_VCC100AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
| 249 | ifdef TOOL_VCC100AMD64_KSUBMIT
|
---|
| 250 | define TOOL_VCC100AMD64-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 251 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[3313] | 252 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT) --no-pch-caching $(TOOL_VCC100AMD64_KSUBMIT_SPECIAL_ENV) \
|
---|
| 253 | -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
[2954] | 254 | -- $(TOOL_VCC100AMD64_CXX) -c -Yc\
|
---|
[2960] | 255 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
[2954] | 256 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 257 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 258 | -Fo$(obj)\
|
---|
| 259 | -TP \
|
---|
| 260 | $(subst /,\\,$(abspath $(source)))
|
---|
| 261 | endef
|
---|
| 262 | else
|
---|
| 263 | define TOOL_VCC100AMD64-PCH_COMPILE_CXX_CMDS
|
---|
[2960] | 264 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
[2954] | 265 | $(QUIET)$(TOOL_VCC100AMD64_CXX) -c -Yc\
|
---|
| 266 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
| 267 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
| 268 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
| 269 | -Fo$(obj)\
|
---|
| 270 | -TP \
|
---|
| 271 | $(subst /,\\,$(abspath $(source)))
|
---|
| 272 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
| 273 |
|
---|
| 274 | endef
|
---|
| 275 | endif # !TOOL_VCC100AMD64_KSUBMIT
|
---|
| 276 |
|
---|
| 277 |
|
---|
[2611] | 278 | ## @todo configure the assembler template.
|
---|
| 279 |
|
---|
[641] | 280 | ## Compile resource source.
|
---|
| 281 | # @param $(target) Normalized main target name.
|
---|
| 282 | # @param $(source) Source filename (relative).
|
---|
| 283 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
| 284 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
| 285 | # @param $(flags) Flags.
|
---|
| 286 | # @param $(defs) Definitions. No -D or something.
|
---|
| 287 | # @param $(incs) Includes. No -I or something.
|
---|
| 288 | # @param $(dirdep) Directory creation dependency.
|
---|
| 289 | # @param $(deps) Other dependencies.
|
---|
| 290 | #
|
---|
| 291 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 292 | # @param $(objsuff) Object suffix.
|
---|
[2408] | 293 | TOOL_VCC100AMD64_COMPILE_RC_DEPEND =
|
---|
| 294 | TOOL_VCC100AMD64_COMPILE_RC_DEPORD =
|
---|
| 295 | TOOL_VCC100AMD64_COMPILE_RC_OUTPUT =
|
---|
| 296 | define TOOL_VCC100AMD64_COMPILE_RC_CMDS
|
---|
| 297 | $(QUIET)$(TOOL_VCC100AMD64_RC) \
|
---|
[641] | 298 | $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
|
---|
| 299 | /fo$(obj)\
|
---|
[697] | 300 | $(subst /,\\,$(abspath $(source)))
|
---|
[641] | 301 | endef
|
---|
| 302 |
|
---|
| 303 |
|
---|
[434] | 304 | ## Link library
|
---|
| 305 | # @param $(target) Normalized main target name.
|
---|
| 306 | # @param $(out) Library name.
|
---|
| 307 | # @param $(objs) Object files to put in the library.
|
---|
| 308 | # @param $(flags) Flags.
|
---|
| 309 | # @param $(dirdep) Directory creation dependency.
|
---|
| 310 | # @param $(deps) Other dependencies.
|
---|
| 311 | # @param $(othersrc) Unhandled sources.
|
---|
| 312 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 313 | #
|
---|
[2408] | 314 | TOOL_VCC100AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
| 315 | TOOL_VCC100AMD64_LINK_LIBRARY_DEPORD =
|
---|
| 316 | TOOL_VCC100AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
| 317 | TOOL_VCC100AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
| 318 | define TOOL_VCC100AMD64_LINK_LIBRARY_CMDS
|
---|
[2557] | 319 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
[768] | 320 | $(foreach arg,\
|
---|
| 321 | $(subst /,\\,$(objs) \
|
---|
| 322 | $(filter-out %.def,$(othersrc))) \
|
---|
| 323 | $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
|
---|
| 324 | ,\"$(arg)\")
|
---|
[2902] | 325 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
[768] | 326 | endef
|
---|
[434] | 327 |
|
---|
| 328 |
|
---|
| 329 | ## Link program
|
---|
| 330 | # @param $(target) Normalized main target name.
|
---|
| 331 | # @param $(out) Program name.
|
---|
| 332 | # @param $(objs) Object files to link together.
|
---|
| 333 | # @param $(libs) Libraries to search.
|
---|
| 334 | # @param $(libpath) Library search paths.
|
---|
| 335 | # @param $(flags) Flags.
|
---|
| 336 | # @param $(dirdep) Directory creation dependency.
|
---|
| 337 | # @param $(deps) Other dependencies.
|
---|
| 338 | # @param $(othersrc) Unhandled sources.
|
---|
| 339 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 340 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 341 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 342 | #
|
---|
[2408] | 343 | TOOL_VCC100AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 344 | TOOL_VCC100AMD64_LINK_PROGRAM_DEPORD =
|
---|
[2524] | 345 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
[3303] | 346 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
[2524] | 347 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 348 | TOOL_VCC100AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
[2408] | 349 | define TOOL_VCC100AMD64_LINK_PROGRAM_CMDS
|
---|
[2557] | 350 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 351 | $(foreach arg,\
|
---|
| 352 | $(subst /,\\,$(objs)) \
|
---|
| 353 | $(subst /,\\,$(libs)) \
|
---|
| 354 | ,\"$(arg)\")
|
---|
[2902] | 355 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_LD) $(flags) \
|
---|
[434] | 356 | /OUT:$(out) \
|
---|
[437] | 357 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 358 | /MAP:$(outbase).map \
|
---|
| 359 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 360 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 361 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 362 | @$(outbase).rsp
|
---|
[2735] | 363 | ifndef TOOL_VCC100AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 364 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[2408] | 365 | $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
[2735] | 366 | endif
|
---|
[434] | 367 | endef
|
---|
| 368 |
|
---|
| 369 |
|
---|
| 370 | ## Link DLL.
|
---|
| 371 | # @param $(target) Normalized main target name.
|
---|
| 372 | # @param $(out) DLL name.
|
---|
| 373 | # @param $(objs) Object files to link together.
|
---|
| 374 | # @param $(libs) Libraries to search.
|
---|
| 375 | # @param $(libpath) Library search paths.
|
---|
| 376 | # @param $(flags) Flags.
|
---|
| 377 | # @param $(dirdep) Directory creation dependency.
|
---|
| 378 | # @param $(deps) Other dependencies.
|
---|
| 379 | # @param $(othersrc) Unhandled sources.
|
---|
| 380 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 381 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 382 | #
|
---|
| 383 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[2408] | 384 | TOOL_VCC100AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
[2487] | 385 | TOOL_VCC100AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
[3303] | 386 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
[2795] | 387 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
[3303] | 388 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
[2524] | 389 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 390 | TOOL_VCC100AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
[2408] | 391 | define TOOL_VCC100AMD64_LINK_DLL_CMDS
|
---|
[2557] | 392 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 393 | $(foreach arg,\
|
---|
| 394 | $(subst /,\\,$(objs)) \
|
---|
| 395 | $(subst /,\\,$(libs)) \
|
---|
| 396 | ,\"$(arg)\")
|
---|
[2902] | 397 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_LD) $(flags) \
|
---|
[434] | 398 | /OUT:$(out) \
|
---|
| 399 | /IMPLIB:$(outbase).lib \
|
---|
[437] | 400 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 401 | /MAP:$(outbase).map \
|
---|
| 402 | /DLL \
|
---|
| 403 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 404 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 405 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 406 | @$(outbase).rsp
|
---|
[2735] | 407 | ifndef TOOL_VCC100AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 408 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[2408] | 409 | $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 410 | endif
|
---|
[2795] | 411 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
| 412 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
[2487] | 413 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
[434] | 414 | endef
|
---|
| 415 |
|
---|
| 416 |
|
---|
| 417 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
| 418 | # @param $(target) Normalized main target name.
|
---|
| 419 | # @param $(out) System module name.
|
---|
| 420 | # @param $(objs) Object files to link together.
|
---|
| 421 | # @param $(libs) Libraries to search.
|
---|
| 422 | # @param $(libpath) Library search paths.
|
---|
| 423 | # @param $(flags) Flags.
|
---|
| 424 | # @param $(dirdep) Directory creation dependency.
|
---|
| 425 | # @param $(deps) Other dependencies.
|
---|
| 426 | # @param $(othersrc) Unhandled sources.
|
---|
| 427 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
| 428 | # @param $(custom_post) Custom step invoked after linking.
|
---|
| 429 | #
|
---|
| 430 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
[2408] | 431 | TOOL_VCC100AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
| 432 | TOOL_VCC100AMD64_LINK_SYSMOD_DEPORD =
|
---|
[2524] | 433 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
[3303] | 434 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
[2524] | 435 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
| 436 | TOOL_VCC100AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
[2408] | 437 | define TOOL_VCC100AMD64_LINK_SYSMOD_CMDS
|
---|
[2557] | 438 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
| 439 | $(foreach arg,\
|
---|
| 440 | $(subst /,\\,$(objs)) \
|
---|
| 441 | $(subst /,\\,$(libs)) \
|
---|
| 442 | ,\"$(arg)\")
|
---|
[2902] | 443 | $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_LD) $(flags) \
|
---|
[434] | 444 | /OUT:$(out) \
|
---|
[437] | 445 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
[434] | 446 | /MAP:$(outbase).map \
|
---|
| 447 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
| 448 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
| 449 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
---|
[2557] | 450 | @$(outbase).rsp
|
---|
[2735] | 451 | ifndef TOOL_VCC100AMD64_NO_AUTO_MANIFEST
|
---|
[1295] | 452 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
[2408] | 453 | $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
[2735] | 454 | endif
|
---|
[434] | 455 | endef
|
---|
| 456 |
|
---|