| 1 | # $Id: VCC100X86.kmk 2964 2016-09-23 11:08:04Z bird $
 | 
|---|
| 2 | ## @file
 | 
|---|
| 3 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
 | 
|---|
| 4 | #
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #
 | 
|---|
| 7 | # Copyright (c) 2004-2016 knut st. osmundsen <bird-kBuild-spam-xiv@anduin.net>
 | 
|---|
| 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 | #
 | 
|---|
| 26 | # As a special exception you are granted permission to include this file, via
 | 
|---|
| 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.
 | 
|---|
| 29 | # This exception does not however invalidate any other reasons why the makefile,
 | 
|---|
| 30 | # program, whatever should not be covered the GPL.
 | 
|---|
| 31 | #
 | 
|---|
| 32 | #
 | 
|---|
| 33 | 
 | 
|---|
| 34 | TOOL_VCC100X86 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
 | 
|---|
| 35 | 
 | 
|---|
| 36 | # Tool Specific Properties
 | 
|---|
| 37 | ifndef PATH_TOOL_VCC100X86
 | 
|---|
| 38 |  PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
 | 
|---|
| 39 |  ifeq ($(PATH_TOOL_VCC100X86),)
 | 
|---|
| 40 |   PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100)
 | 
|---|
| 41 |  endif
 | 
|---|
| 42 |  ifeq ($(PATH_TOOL_VCC100X86),)
 | 
|---|
| 43 |   PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100AMD64)
 | 
|---|
| 44 |  endif
 | 
|---|
| 45 |  ifeq ($(PATH_TOOL_VCC100X86),)
 | 
|---|
| 46 |   PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v10*)
 | 
|---|
| 47 |  endif
 | 
|---|
| 48 |  ifeq ($(PATH_TOOL_VCC100X86),)
 | 
|---|
| 49 |   PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v10*)
 | 
|---|
| 50 |  endif
 | 
|---|
| 51 |  ifneq ($(PATH_TOOL_VCC100X86),)
 | 
|---|
| 52 |   PATH_TOOL_VCC100X86 := $(lastword $(sort $(PATH_TOOL_VCC100X86)))
 | 
|---|
| 53 |  else
 | 
|---|
| 54 |   $(warning kBuild: PATH_TOOL_VCC100X86 cannot be determined!)
 | 
|---|
| 55 |   PATH_TOOL_VCC100X86 := $(KBUILD_DEVTOOLS)/x86.win/vcc/v10
 | 
|---|
| 56 |  endif
 | 
|---|
| 57 | else
 | 
|---|
| 58 |  # Resolve any fancy stuff once and for all.
 | 
|---|
| 59 |  PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100X86)
 | 
|---|
| 60 | endif
 | 
|---|
| 61 | PATH_TOOL_VCC100X86_BIN    ?= $(PATH_TOOL_VCC100X86)/bin
 | 
|---|
| 62 | PATH_TOOL_VCC100X86_LIB    ?= $(PATH_TOOL_VCC100X86)/lib
 | 
|---|
| 63 | PATH_TOOL_VCC100X86_INC    ?= $(PATH_TOOL_VCC100X86)/include
 | 
|---|
| 64 | PATH_TOOL_VCC100X86_ATLMFC ?= $(PATH_TOOL_VCC100X86)/atlmfc
 | 
|---|
| 65 | PATH_TOOL_VCC100X86_ATLMFC_INC ?= $(PATH_TOOL_VCC100X86_ATLMFC)/include
 | 
|---|
| 66 | PATH_TOOL_VCC100X86_ATLMFC_LIB ?= $(PATH_TOOL_VCC100X86_ATLMFC)/lib
 | 
|---|
| 67 | TOOL_VCC100X86_CC  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
 | 
|---|
| 68 | TOOL_VCC100X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
 | 
|---|
| 69 | TOOL_VCC100X86_AS  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/ml.exe
 | 
|---|
| 70 | #TOOL_VCC100X86_AR  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/lib.exe - just an exec wrapper for the below
 | 
|---|
| 71 | TOOL_VCC100X86_AR  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe /LIB
 | 
|---|
| 72 | TOOL_VCC100X86_LD  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe
 | 
|---|
| 73 | TOOL_VCC100X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/dumpbin.exe
 | 
|---|
| 74 | TOOL_VCC100X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/editbin.exe
 | 
|---|
| 75 | TOOL_VCC100X86_RC  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
 | 
|---|
| 76 | TOOL_VCC100X86_MT  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
 | 
|---|
| 77 | ifdef TOOL_VCC100X86_USE_KSUBMIT
 | 
|---|
| 78 |  ifeq ($(KBUILD_HOST),win)
 | 
|---|
| 79 |   TOOL_VCC100X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
 | 
|---|
| 80 |   TOOL_VCC100X86_KSUBMIT_DD = $(TOOL_VCC100X86_KSUBMIT) --
 | 
|---|
| 81 |  endif
 | 
|---|
| 82 | endif
 | 
|---|
| 83 | 
 | 
|---|
| 84 | # The following in duplicated in VCC100.kmk and VCC100X86.kmk.
 | 
|---|
| 85 | TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword  \
 | 
|---|
| 86 |        $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
 | 
|---|
| 87 |        $(if-expr defined(PATH_SDK_WINPSDK_BIN)  , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
 | 
|---|
| 88 |         $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
 | 
|---|
| 89 |         $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
 | 
|---|
| 90 |         $1))
 | 
|---|
| 91 | TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
 | 
|---|
| 92 | 
 | 
|---|
| 93 | ## Disabled fast DEP_IDB based dependencies.
 | 
|---|
| 94 | #VCC100X86_OLD_DEPS = 1
 | 
|---|
| 95 | 
 | 
|---|
| 96 | ## Constructs the correct .pdb name (the name is lowercased).
 | 
|---|
| 97 | # @param    $(1)        Base name, no extention.
 | 
|---|
| 98 | # @param    $(2)        The extension.
 | 
|---|
| 99 | TOOL_VCC100X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
 | 
|---|
| 100 | 
 | 
|---|
| 101 | 
 | 
|---|
| 102 | # General Properties used by kBuild
 | 
|---|
| 103 | TOOL_VCC100X86_COBJSUFF         ?= .obj
 | 
|---|
| 104 | TOOL_VCC100X86_CFLAGS           ?= -TC -nologo -Zi
 | 
|---|
| 105 | TOOL_VCC100X86_CFLAGS.debug     ?=
 | 
|---|
| 106 | TOOL_VCC100X86_CFLAGS.dbgopt    ?= -O2
 | 
|---|
| 107 | TOOL_VCC100X86_CFLAGS.release   ?= -O2
 | 
|---|
| 108 | TOOL_VCC100X86_CFLAGS.profile   ?= -O2
 | 
|---|
| 109 | TOOL_VCC100X86_CINCS            ?= $(PATH_TOOL_VCC100X86_INC)
 | 
|---|
| 110 | TOOL_VCC100X86_CDEFS            ?=
 | 
|---|
| 111 | 
 | 
|---|
| 112 | TOOL_VCC100X86_CXXOBJSUFF       ?= .obj
 | 
|---|
| 113 | TOOL_VCC100X86_CXXFLAGS         ?= -TP -nologo -Zi
 | 
|---|
| 114 | TOOL_VCC100X86_CXXFLAGS.debug   ?=
 | 
|---|
| 115 | TOOL_VCC100X86_CXXFLAGS.dbgopt  ?= -O2
 | 
|---|
| 116 | TOOL_VCC100X86_CXXFLAGS.release ?= -O2
 | 
|---|
| 117 | TOOL_VCC100X86_CXXFLAGS.profile ?= -O2
 | 
|---|
| 118 | TOOL_VCC100X86_CXXINCS          ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
 | 
|---|
| 119 | TOOL_VCC100X86_CXXDEFS          ?=
 | 
|---|
| 120 | 
 | 
|---|
| 121 | TOOL_VCC100X86_ASOBJSUFF        ?= .obj
 | 
|---|
| 122 | 
 | 
|---|
| 123 | TOOL_VCC100X86_RCOBJSUFF        ?= .res
 | 
|---|
| 124 | TOOL_VCC100X86_RCINCS           ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
 | 
|---|
| 125 | 
 | 
|---|
| 126 | TOOL_VCC100X86_ARFLAGS          ?= -nologo
 | 
|---|
| 127 | TOOL_VCC100X86_ARLIBSUFF        ?= .lib
 | 
|---|
| 128 | 
 | 
|---|
| 129 | TOOL_VCC100X86_LDFLAGS          ?= -nologo -machine:x86
 | 
|---|
| 130 | TOOL_VCC100X86_LDFLAGS.debug    ?= -debug
 | 
|---|
| 131 | TOOL_VCC100X86_LDFLAGS.dbgopt   ?= -debug
 | 
|---|
| 132 | TOOL_VCC100X86_LDFLAGS.profile  ?= -debug
 | 
|---|
| 133 | TOOL_VCC100X86_LDFLAGS.release  ?=
 | 
|---|
| 134 | 
 | 
|---|
| 135 | 
 | 
|---|
| 136 | 
 | 
|---|
| 137 | ## Compile C source.
 | 
|---|
| 138 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 139 | # @param    $(source)   Source filename (relative).
 | 
|---|
| 140 | # @param    $(obj)      Object file name. This shall be (re)created by the compilation.
 | 
|---|
| 141 | # @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
 | 
|---|
| 142 | # @param    $(flags)    Flags.
 | 
|---|
| 143 | # @param    $(defs)     Definitions. No -D or something.
 | 
|---|
| 144 | # @param    $(incs)     Includes. No -I or something.
 | 
|---|
| 145 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 146 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 147 | #
 | 
|---|
| 148 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 149 | # @param    $(objsuff)  Object suffix.
 | 
|---|
| 150 | TOOL_VCC100X86_COMPILE_C_DEPEND =
 | 
|---|
| 151 | TOOL_VCC100X86_COMPILE_C_DEPORD =
 | 
|---|
| 152 | TOOL_VCC100X86_COMPILE_C_OUTPUT =
 | 
|---|
| 153 | TOOL_VCC100X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb)
 | 
|---|
| 154 | ifdef TOOL_VCC100X86_KSUBMIT
 | 
|---|
| 155 |  TOOL_VCC100X86_COMPILE_C_DONT_PURGE_OUTPUT = 1 # speed
 | 
|---|
| 156 |  define TOOL_VCC100X86_COMPILE_C_CMDS
 | 
|---|
| 157 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
 | 
|---|
| 158 |                 -- $(TOOL_VCC100X86_CC) -c\
 | 
|---|
| 159 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 160 |                 -Fd$(outbase)-obj.pdb \
 | 
|---|
| 161 |                 -Fo$(obj)\
 | 
|---|
| 162 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 163 |  endef
 | 
|---|
| 164 | else
 | 
|---|
| 165 |  define TOOL_VCC100X86_COMPILE_C_CMDS
 | 
|---|
| 166 |         $(QUIET)$(TOOL_VCC100X86_CC) -c\
 | 
|---|
| 167 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 168 |                 -Fd$(outbase)-obj.pdb \
 | 
|---|
| 169 |                 -Fo$(obj)\
 | 
|---|
| 170 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 171 |         $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
 | 
|---|
| 172 |  endef
 | 
|---|
| 173 | endif # !TOOL_VCC100X86_KSUBMIT
 | 
|---|
| 174 | 
 | 
|---|
| 175 | 
 | 
|---|
| 176 | ## Compile C++ source.
 | 
|---|
| 177 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 178 | # @param    $(source)   Source filename (relative).
 | 
|---|
| 179 | # @param    $(obj)      Object file name. This shall be (re)created by the compilation.
 | 
|---|
| 180 | # @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
 | 
|---|
| 181 | # @param    $(flags)    Flags.
 | 
|---|
| 182 | # @param    $(defs)     Definitions. No -D or something.
 | 
|---|
| 183 | # @param    $(incs)     Includes. No -I or something.
 | 
|---|
| 184 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 185 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 186 | #
 | 
|---|
| 187 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 188 | # @param    $(objsuff)  Object suffix.
 | 
|---|
| 189 | TOOL_VCC100X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
 | 
|---|
| 190 | TOOL_VCC100X86_COMPILE_CXX_DEPORD =
 | 
|---|
| 191 | TOOL_VCC100X86_COMPILE_CXX_OUTPUT =
 | 
|---|
| 192 | TOOL_VCC100X86_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
 | 
|---|
| 193 |         ,,$(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb))
 | 
|---|
| 194 | ifdef TOOL_VCC100X86_KSUBMIT
 | 
|---|
| 195 |  TOOL_VCC100X86_COMPILE_CXX_DONT_PURGE_OUTPUT = 1 # speed
 | 
|---|
| 196 |  define TOOL_VCC100X86_COMPILE_CXX_CMDS
 | 
|---|
| 197 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
 | 
|---|
| 198 |                 -- $(TOOL_VCC100X86_CXX) -c\
 | 
|---|
| 199 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 200 |                 $(if-expr defined($(target)_PCH_HDR)\
 | 
|---|
| 201 |                 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
 | 
|---|
| 202 |                 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
 | 
|---|
| 203 |                 -Fo$(obj)\
 | 
|---|
| 204 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 205 |  endef
 | 
|---|
| 206 | else
 | 
|---|
| 207 |  define TOOL_VCC100X86_COMPILE_CXX_CMDS
 | 
|---|
| 208 |         $(QUIET)$(TOOL_VCC100X86_CXX) -c\
 | 
|---|
| 209 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 210 |                 $(if-expr defined($(target)_PCH_HDR)\
 | 
|---|
| 211 |                 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
 | 
|---|
| 212 |                 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
 | 
|---|
| 213 |                 -Fo$(obj)\
 | 
|---|
| 214 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 215 |         $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
 | 
|---|
| 216 |  endef
 | 
|---|
| 217 | endif # !TOOL_VCC100X86_KSUBMIT
 | 
|---|
| 218 | 
 | 
|---|
| 219 | 
 | 
|---|
| 220 | #
 | 
|---|
| 221 | # Helper tool for creating the precompiled C++ header.
 | 
|---|
| 222 | #
 | 
|---|
| 223 | # It only have the C++ compile bits and it's purpose is to skip bits
 | 
|---|
| 224 | # related _1_VCC_PCH_FILE and add -Yc.
 | 
|---|
| 225 | #
 | 
|---|
| 226 | TOOL_VCC100X86-PCH                         := Helper for creating precompiled header using CXX handling.
 | 
|---|
| 227 | TOOL_VCC100X86-PCH_EXTENDS                 := VCC100X86
 | 
|---|
| 228 | TOOL_VCC100X86-PCH_CXXOBJSUFF              := .obj
 | 
|---|
| 229 | TOOL_VCC100X86-PCH_CXXINCS                  = $(TOOL_VCC100X86_CXXINCS)
 | 
|---|
| 230 | TOOL_VCC100X86-PCH_CXXFLAGS.debug           = $(TOOL_VCC100X86_CXXFLAGS.debug)
 | 
|---|
| 231 | TOOL_VCC100X86-PCH_CXXFLAGS.dbgopt          = $(TOOL_VCC100X86_CXXFLAGS.dbgopt)
 | 
|---|
| 232 | TOOL_VCC100X86-PCH_CXXFLAGS.release         = $(TOOL_VCC100X86_CXXFLAGS.release)
 | 
|---|
| 233 | TOOL_VCC100X86-PCH_CXXFLAGS.profile         = $(TOOL_VCC100X86_CXXFLAGS.profile)
 | 
|---|
| 234 | TOOL_VCC100X86-PCH_COMPILE_CXX_DEPEND       = $(NO_SUCH_VARIABLE)
 | 
|---|
| 235 | TOOL_VCC100X86-PCH_COMPILE_CXX_DEPORD       = $(NO_SUCH_VARIABLE)
 | 
|---|
| 236 | TOOL_VCC100X86-PCH_COMPILE_CXX_OUTPUT       = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
 | 
|---|
| 237 | TOOL_VCC100X86-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
 | 
|---|
| 238 | ifdef TOOL_VCC100X86_KSUBMIT
 | 
|---|
| 239 |  define TOOL_VCC100X86-PCH_COMPILE_CXX_CMDS
 | 
|---|
| 240 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
 | 
|---|
| 241 |                 -- $(TOOL_VCC100X86_CXX) -c -Yc\
 | 
|---|
| 242 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 243 |                -Fp$($(target)_1_VCC_PCH_FILE) \
 | 
|---|
| 244 |                 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
 | 
|---|
| 245 |                 -Fo$(obj)\
 | 
|---|
| 246 |                -TP \
 | 
|---|
| 247 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 248 |  endef
 | 
|---|
| 249 | else
 | 
|---|
| 250 |  define TOOL_VCC100X86-PCH_COMPILE_CXX_CMDS
 | 
|---|
| 251 |         $(QUIET)$(TOOL_VCC100X86_CXX) -c -Yc\
 | 
|---|
| 252 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 253 |                -Fp$($(target)_1_VCC_PCH_FILE) \
 | 
|---|
| 254 |                 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
 | 
|---|
| 255 |                 -Fo$(obj)\
 | 
|---|
| 256 |                -TP \
 | 
|---|
| 257 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 258 |         $(QUIET)$(DEP_OBJ) -f -s -q  -e .pch -o $(dep) -t $(obj) $(obj)
 | 
|---|
| 259 | 
 | 
|---|
| 260 |  endef
 | 
|---|
| 261 | endif # !TOOL_VCC100X86_KSUBMIT
 | 
|---|
| 262 | 
 | 
|---|
| 263 | 
 | 
|---|
| 264 | ## @todo configure the assembler template.
 | 
|---|
| 265 | 
 | 
|---|
| 266 | ## Compile resource source.
 | 
|---|
| 267 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 268 | # @param    $(source)   Source filename (relative).
 | 
|---|
| 269 | # @param    $(obj)      Object file name. This shall be (re)created by the compilation.
 | 
|---|
| 270 | # @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
 | 
|---|
| 271 | # @param    $(flags)    Flags.
 | 
|---|
| 272 | # @param    $(defs)     Definitions. No -D or something.
 | 
|---|
| 273 | # @param    $(incs)     Includes. No -I or something.
 | 
|---|
| 274 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 275 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 276 | #
 | 
|---|
| 277 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 278 | # @param    $(objsuff)  Object suffix.
 | 
|---|
| 279 | TOOL_VCC100X86_COMPILE_RC_DEPEND =
 | 
|---|
| 280 | TOOL_VCC100X86_COMPILE_RC_DEPORD =
 | 
|---|
| 281 | TOOL_VCC100X86_COMPILE_RC_OUTPUT =
 | 
|---|
| 282 | define TOOL_VCC100X86_COMPILE_RC_CMDS
 | 
|---|
| 283 |         $(QUIET)$(TOOL_VCC100X86_RC) \
 | 
|---|
| 284 |                 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
 | 
|---|
| 285 |                 /fo$(obj)\
 | 
|---|
| 286 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 287 | endef
 | 
|---|
| 288 | 
 | 
|---|
| 289 | 
 | 
|---|
| 290 | ## Link library
 | 
|---|
| 291 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 292 | # @param    $(out)      Library name.
 | 
|---|
| 293 | # @param    $(objs)     Object files to put in the library.
 | 
|---|
| 294 | # @param    $(flags)    Flags.
 | 
|---|
| 295 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 296 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 297 | # @param    $(othersrc) Unhandled sources.
 | 
|---|
| 298 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 299 | #
 | 
|---|
| 300 | TOOL_VCC100X86_LINK_LIBRARY_DEPEND = $(othersrc)
 | 
|---|
| 301 | TOOL_VCC100X86_LINK_LIBRARY_DEPORD =
 | 
|---|
| 302 | TOOL_VCC100X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
 | 
|---|
| 303 | TOOL_VCC100X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
 | 
|---|
| 304 | define TOOL_VCC100X86_LINK_LIBRARY_CMDS
 | 
|---|
| 305 |         $(QUIET)$(APPEND) -tn $(outbase).rsp \
 | 
|---|
| 306 |                 $(foreach arg,\
 | 
|---|
| 307 |                         $(subst /,\\,$(objs) \
 | 
|---|
| 308 |                         $(filter-out %.def,$(othersrc))) \
 | 
|---|
| 309 |                         $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
 | 
|---|
| 310 |                         ,\"$(arg)\")
 | 
|---|
| 311 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
 | 
|---|
| 312 | endef
 | 
|---|
| 313 | 
 | 
|---|
| 314 | 
 | 
|---|
| 315 | ## Link program
 | 
|---|
| 316 | # @param    $(target)       Normalized main target name.
 | 
|---|
| 317 | # @param    $(out)          Program name.
 | 
|---|
| 318 | # @param    $(objs)         Object files to link together.
 | 
|---|
| 319 | # @param    $(libs)         Libraries to search.
 | 
|---|
| 320 | # @param    $(libpath)      Library search paths.
 | 
|---|
| 321 | # @param    $(flags)        Flags.
 | 
|---|
| 322 | # @param    $(dirdep)       Directory creation dependency.
 | 
|---|
| 323 | # @param    $(deps)         Other dependencies.
 | 
|---|
| 324 | # @param    $(othersrc)     Unhandled sources.
 | 
|---|
| 325 | # @param    $(custom_pre)   Custom step invoked before linking.
 | 
|---|
| 326 | # @param    $(custom_post)  Custom step invoked after linking.
 | 
|---|
| 327 | # @param    $(outbase)      Output basename (full). Use this for list files and such.
 | 
|---|
| 328 | #
 | 
|---|
| 329 | TOOL_VCC100X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 | 
|---|
| 330 | TOOL_VCC100X86_LINK_PROGRAM_DEPORD =
 | 
|---|
| 331 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
 | 
|---|
| 332 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
 | 
|---|
| 333 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
 | 
|---|
| 334 | TOOL_VCC100X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
 | 
|---|
| 335 | define TOOL_VCC100X86_LINK_PROGRAM_CMDS
 | 
|---|
| 336 |         $(QUIET)$(APPEND) -tn $(outbase).rsp \
 | 
|---|
| 337 |                 $(foreach arg,\
 | 
|---|
| 338 |                     $(subst /,\\,$(objs)) \
 | 
|---|
| 339 |                     $(subst /,\\,$(libs)) \
 | 
|---|
| 340 |                         ,\"$(arg)\")
 | 
|---|
| 341 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
 | 
|---|
| 342 |                 /OUT:$(out) \
 | 
|---|
| 343 |                 /MAPINFO:EXPORTS /INCREMENTAL:NO \
 | 
|---|
| 344 |                 /MAP:$(outbase).map \
 | 
|---|
| 345 |                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
 | 
|---|
| 346 |                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
 | 
|---|
| 347 |                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
 | 
|---|
| 348 |                 @$(outbase).rsp
 | 
|---|
| 349 | ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
 | 
|---|
| 350 |         $(QUIET)$(TEST) -f $(out).manifest -- \
 | 
|---|
| 351 |                 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
 | 
|---|
| 352 | endif
 | 
|---|
| 353 | endef
 | 
|---|
| 354 | 
 | 
|---|
| 355 | 
 | 
|---|
| 356 | ## Link DLL.
 | 
|---|
| 357 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 358 | # @param    $(out)      DLL name.
 | 
|---|
| 359 | # @param    $(objs)     Object files to link together.
 | 
|---|
| 360 | # @param    $(libs)     Libraries to search.
 | 
|---|
| 361 | # @param    $(libpath)  Library search paths.
 | 
|---|
| 362 | # @param    $(flags)    Flags.
 | 
|---|
| 363 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 364 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 365 | # @param    $(othersrc)     Unhandled sources.
 | 
|---|
| 366 | # @param    $(custom_pre)   Custom step invoked before linking.
 | 
|---|
| 367 | # @param    $(custom_post)  Custom step invoked after linking.
 | 
|---|
| 368 | #
 | 
|---|
| 369 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 370 | TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 | 
|---|
| 371 | TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 | 
|---|
| 372 | TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
 | 
|---|
| 373 | TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 | 
|---|
| 374 | TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib
 | 
|---|
| 375 | TOOL_VCC100X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
 | 
|---|
| 376 | TOOL_VCC100X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
 | 
|---|
| 377 | define TOOL_VCC100X86_LINK_DLL_CMDS
 | 
|---|
| 378 |         $(QUIET)$(APPEND) -tn $(outbase).rsp \
 | 
|---|
| 379 |                 $(foreach arg,\
 | 
|---|
| 380 |                     $(subst /,\\,$(objs)) \
 | 
|---|
| 381 |                     $(subst /,\\,$(libs)) \
 | 
|---|
| 382 |                         ,\"$(arg)\")
 | 
|---|
| 383 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
 | 
|---|
| 384 |                 /OUT:$(out) \
 | 
|---|
| 385 |                 /IMPLIB:$(outbase).lib \
 | 
|---|
| 386 |                 /MAPINFO:EXPORTS /INCREMENTAL:NO \
 | 
|---|
| 387 |                 /MAP:$(outbase).map \
 | 
|---|
| 388 |                 /DLL \
 | 
|---|
| 389 |                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
 | 
|---|
| 390 |                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
 | 
|---|
| 391 |                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
 | 
|---|
| 392 |                 @$(outbase).rsp
 | 
|---|
| 393 | ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
 | 
|---|
| 394 |         $(QUIET)$(TEST) -f $(out).manifest -- \
 | 
|---|
| 395 |                 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
 | 
|---|
| 396 | endif
 | 
|---|
| 397 |         $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
 | 
|---|
| 398 |         $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
 | 
|---|
| 399 | $(eval _DIRS += $(PATH_STAGE_LIB))
 | 
|---|
| 400 | endef
 | 
|---|
| 401 | 
 | 
|---|
| 402 | 
 | 
|---|
| 403 | ## Link system module (windows aka driver, linux aka kernel module)
 | 
|---|
| 404 | # @param    $(target)       Normalized main target name.
 | 
|---|
| 405 | # @param    $(out)          System module name.
 | 
|---|
| 406 | # @param    $(objs)         Object files to link together.
 | 
|---|
| 407 | # @param    $(libs)         Libraries to search.
 | 
|---|
| 408 | # @param    $(libpath)      Library search paths.
 | 
|---|
| 409 | # @param    $(flags)        Flags.
 | 
|---|
| 410 | # @param    $(dirdep)       Directory creation dependency.
 | 
|---|
| 411 | # @param    $(deps)         Other dependencies.
 | 
|---|
| 412 | # @param    $(othersrc)     Unhandled sources.
 | 
|---|
| 413 | # @param    $(custom_pre)   Custom step invoked before linking.
 | 
|---|
| 414 | # @param    $(custom_post)  Custom step invoked after linking.
 | 
|---|
| 415 | #
 | 
|---|
| 416 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 417 | TOOL_VCC100X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 | 
|---|
| 418 | TOOL_VCC100X86_LINK_SYSMOD_DEPORD =
 | 
|---|
| 419 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
 | 
|---|
| 420 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
 | 
|---|
| 421 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
 | 
|---|
| 422 | TOOL_VCC100X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
 | 
|---|
| 423 | define TOOL_VCC100X86_LINK_SYSMOD_CMDS
 | 
|---|
| 424 |         $(QUIET)$(APPEND) -tn $(outbase).rsp \
 | 
|---|
| 425 |                 $(foreach arg,\
 | 
|---|
| 426 |                     $(subst /,\\,$(objs)) \
 | 
|---|
| 427 |                     $(subst /,\\,$(libs)) \
 | 
|---|
| 428 |                         ,\"$(arg)\")
 | 
|---|
| 429 |         $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
 | 
|---|
| 430 |                 /OUT:$(out) \
 | 
|---|
| 431 |                 /MAPINFO:EXPORTS /INCREMENTAL:NO \
 | 
|---|
| 432 |                 /MAP:$(outbase).map \
 | 
|---|
| 433 |                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
 | 
|---|
| 434 |                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
 | 
|---|
| 435 |                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
 | 
|---|
| 436 |                 @$(outbase).rsp
 | 
|---|
| 437 | ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
 | 
|---|
| 438 |         $(QUIET)$(TEST) -f $(out).manifest -- \
 | 
|---|
| 439 |                 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
 | 
|---|
| 440 | endif
 | 
|---|
| 441 | endef
 | 
|---|
| 442 | 
 | 
|---|