| 1 | # $Id: VCC70.kmk 1547 2008-04-22 02:02:09Z bird $
 | 
|---|
| 2 | ## @file
 | 
|---|
| 3 | # kBuild Tool Config - Visual C++ 7.0 (aka Visual Studio .NET), targeting x86.
 | 
|---|
| 4 | #
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #
 | 
|---|
| 7 | # Copyright (c) 2004-2008 knut st. osmundsen <bird-kBuild-spam@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_VCC70 := Visual C++ 7.0 (aka Visual Studio .NET), targeting x86.
 | 
|---|
| 35 | 
 | 
|---|
| 36 | # Tool Specific Properties
 | 
|---|
| 37 | ifndef PATH_TOOL_VCC70
 | 
|---|
| 38 |  PATH_TOOL_VCC70 := $(firstword $(wildcard \
 | 
|---|
| 39 |         $(PATH_DEVTOOLS)/win.x86/vcc/v7 \
 | 
|---|
| 40 |         $(PATH_DEVTOOLS)/x86.win32/vcc/v7 \
 | 
|---|
| 41 |         $(PATH_DEVTOOLS)/x86.win32/vcc70) )
 | 
|---|
| 42 |  # if not found, we'll enter 'pathless' mode.
 | 
|---|
| 43 | else
 | 
|---|
| 44 |  # Resolve any fancy stuff once and for all.
 | 
|---|
| 45 |  PATH_TOOL_VCC70 := $(PATH_TOOL_VCC70)
 | 
|---|
| 46 | endif
 | 
|---|
| 47 | ifneq ($(PATH_TOOL_VCC70),)
 | 
|---|
| 48 |  PATH_TOOL_VCC70_BIN ?= $(PATH_TOOL_VCC70)/bin
 | 
|---|
| 49 |  PATH_TOOL_VCC70_LIB ?= $(PATH_TOOL_VCC70)/lib
 | 
|---|
| 50 |  PATH_TOOL_VCC70_INC ?= $(PATH_TOOL_VCC70)/include
 | 
|---|
| 51 |  PATH_TOOL_VCC70_ATLMFC ?= $(PATH_TOOL_VCC70)/atlmfc
 | 
|---|
| 52 |  PATH_TOOL_VCC70_ATLMFC_INC ?= $(PATH_TOOL_VCC70_ATLMFC)/include
 | 
|---|
| 53 |  PATH_TOOL_VCC70_ATLMFC_LIB ?= $(PATH_TOOL_VCC70_ATLMFC)/lib
 | 
|---|
| 54 |  TOOL_VCC70_CC  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70_BIN)/cl.exe
 | 
|---|
| 55 |  TOOL_VCC70_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70_BIN)/cl.exe
 | 
|---|
| 56 |  TOOL_VCC70_AS  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70_BIN)/ml.exe
 | 
|---|
| 57 |  TOOL_VCC70_RC  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70_BIN)/rc.exe
 | 
|---|
| 58 |  TOOL_VCC70_AR  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70_BIN)/lib.exe
 | 
|---|
| 59 |  TOOL_VCC70_LD  ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70_BIN)/link.exe
 | 
|---|
| 60 | else
 | 
|---|
| 61 |  # Pathless, relies on the environment.
 | 
|---|
| 62 |  TOOL_VCC70_CC  ?= $(EXEC_X86_WIN32) cl.exe
 | 
|---|
| 63 |  TOOL_VCC70_CXX ?= $(EXEC_X86_WIN32) cl.exe
 | 
|---|
| 64 |  TOOL_VCC70_AS  ?= $(EXEC_X86_WIN32) ml.exe
 | 
|---|
| 65 |  TOOL_VCC70_RC  ?= $(EXEC_X86_WIN32) rc.exe
 | 
|---|
| 66 |  TOOL_VCC70_AR  ?= $(EXEC_X86_WIN32) lib.exe
 | 
|---|
| 67 |  TOOL_VCC70_LD  ?= $(EXEC_X86_WIN32) link.exe
 | 
|---|
| 68 | endif
 | 
|---|
| 69 | ## Disabled fast DEP_IDB based dependencies.
 | 
|---|
| 70 | #VCC70_OLD_DEPS = 1
 | 
|---|
| 71 | 
 | 
|---|
| 72 | ## Constructs the correct .pdb name (the name is lowercased).
 | 
|---|
| 73 | # @param    $(1)        Base name, no extention.
 | 
|---|
| 74 | # @param    $(2)        The extension.
 | 
|---|
| 75 | TOOL_VCC70_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
 | 
|---|
| 76 | 
 | 
|---|
| 77 | # General Properties used by kBuild
 | 
|---|
| 78 | TOOL_VCC70_COBJSUFF         ?= .obj
 | 
|---|
| 79 | TOOL_VCC70_CFLAGS           ?= -TC -c -nologo
 | 
|---|
| 80 | TOOL_VCC70_CFLAGS.debug     ?= -Od -Zi
 | 
|---|
| 81 | TOOL_VCC70_CFLAGS.release   ?= -O2
 | 
|---|
| 82 | TOOL_VCC70_CFLAGS.profile   ?= -O2
 | 
|---|
| 83 | TOOL_VCC70_CINCS            ?= $(PATH_TOOL_VCC70_INC)
 | 
|---|
| 84 | TOOL_VCC70_CDEFS            ?=
 | 
|---|
| 85 | 
 | 
|---|
| 86 | TOOL_VCC70_CXXOBJSUFF       ?= .obj
 | 
|---|
| 87 | TOOL_VCC70_CXXFLAGS         ?= -TP -c -nologo
 | 
|---|
| 88 | TOOL_VCC70_CXXFLAGS.debug   ?= -Od -Zi
 | 
|---|
| 89 | TOOL_VCC70_CXXFLAGS.release ?= -O2
 | 
|---|
| 90 | TOOL_VCC70_CXXFLAGS.profile ?= -O2
 | 
|---|
| 91 | TOOL_VCC70_CXXINCS          ?= $(PATH_TOOL_VCC70_INC) $(PATH_TOOL_VCC70_ATLMFC_INC)
 | 
|---|
| 92 | TOOL_VCC70_CXXDEFS          ?=
 | 
|---|
| 93 | 
 | 
|---|
| 94 | TOOL_VCC70_ASOBJSUFF        ?= .obj
 | 
|---|
| 95 | 
 | 
|---|
| 96 | TOOL_VCC70_RCOBJSUFF        ?= .res
 | 
|---|
| 97 | TOOL_VCC70_RCINCS           ?= $(PATH_TOOL_VCC70_INC) $(PATH_TOOL_VCC70_ATLMFC_INC)
 | 
|---|
| 98 | 
 | 
|---|
| 99 | TOOL_VCC70_ARFLAGS          ?= -nologo
 | 
|---|
| 100 | TOOL_VCC70_ARLIBSUFF        ?= .lib
 | 
|---|
| 101 | 
 | 
|---|
| 102 | TOOL_VCC70_LDFLAGS          ?= -nologo
 | 
|---|
| 103 | TOOL_VCC70_LDFLAGS.debug    ?= -debug
 | 
|---|
| 104 | TOOL_VCC70_LDFLAGS.release  ?=
 | 
|---|
| 105 | 
 | 
|---|
| 106 | 
 | 
|---|
| 107 | ## Compile C source.
 | 
|---|
| 108 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 109 | # @param    $(source)   Source filename (relative).
 | 
|---|
| 110 | # @param    $(obj)      Object file name. This shall be (re)created by the compilation.
 | 
|---|
| 111 | # @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
 | 
|---|
| 112 | # @param    $(flags)    Flags.
 | 
|---|
| 113 | # @param    $(defs)     Definitions. No -D or something.
 | 
|---|
| 114 | # @param    $(incs)     Includes. No -I or something.
 | 
|---|
| 115 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 116 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 117 | #
 | 
|---|
| 118 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 119 | # @param    $(objsuff)  Object suffix.
 | 
|---|
| 120 | TOOL_VCC70_COMPILE_C_DONT_PURGE_OUTPUT =
 | 
|---|
| 121 | TOOL_VCC70_COMPILE_C_DEPEND =
 | 
|---|
| 122 | TOOL_VCC70_COMPILE_C_DEPORD =
 | 
|---|
| 123 | #ifdef KBUILD_USE_KOBJCACHE
 | 
|---|
| 124 | #TOOL_VCC70_COMPILE_C_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC70_PDB, $(outbase)-obj,idb) $(outbase).i
 | 
|---|
| 125 | #TOOL_VCC70_COMPILE_C_USESES_KOBJCACHE = 1
 | 
|---|
| 126 | #define TOOL_VCC70_COMPILE_C_CMDS
 | 
|---|
| 127 | #       $(QUIET)$(KOBJCACHE) -f $(outbase).koc -r --kObjCache-cpp $(outbase).i \
 | 
|---|
| 128 | #               $(TOOL_VCC70_CC) -E \
 | 
|---|
| 129 | #               $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 130 | #               $(subst /,\\,$(abspath $(source))) \
 | 
|---|
| 131 | #               --kObjCache-cc $(obj) \
 | 
|---|
| 132 | #               $(TOOL_VCC70_CC) -c -TC\
 | 
|---|
| 133 | #               $(flags) \
 | 
|---|
| 134 | #               -Fd$(outbase)-obj.pdb \
 | 
|---|
| 135 | #               -FD\
 | 
|---|
| 136 | #               -Fo$(obj)\
 | 
|---|
| 137 | #               $(subst /,\\,$(outbase).i)
 | 
|---|
| 138 | #       $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC70_PDB,$(outbase)-obj,idb)
 | 
|---|
| 139 | #endef
 | 
|---|
| 140 | #else # !KBUILD_USE_KOBJCACHE
 | 
|---|
| 141 | TOOL_VCC70_COMPILE_C_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj,idb)
 | 
|---|
| 142 | TOOL_VCC70_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC70_PDB, $(outbase)-obj,pdb)
 | 
|---|
| 143 | define TOOL_VCC70_COMPILE_C_CMDS
 | 
|---|
| 144 |         $(QUIET)$(TOOL_VCC70_CC) -c\
 | 
|---|
| 145 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 146 |                 -Fd$(outbase)-obj.pdb \
 | 
|---|
| 147 |                 -FD\
 | 
|---|
| 148 |                 -Fo$(obj)\
 | 
|---|
| 149 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 150 |         $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC70_PDB,$(outbase)-obj,idb)
 | 
|---|
| 151 | endef
 | 
|---|
| 152 | #endif # !KBUILD_USE_KOBJCACHE
 | 
|---|
| 153 | 
 | 
|---|
| 154 | 
 | 
|---|
| 155 | ## Compile C++ source.
 | 
|---|
| 156 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 157 | # @param    $(source)   Source filename (relative).
 | 
|---|
| 158 | # @param    $(obj)      Object file name. This shall be (re)created by the compilation.
 | 
|---|
| 159 | # @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
 | 
|---|
| 160 | # @param    $(flags)    Flags.
 | 
|---|
| 161 | # @param    $(defs)     Definitions. No -D or something.
 | 
|---|
| 162 | # @param    $(incs)     Includes. No -I or something.
 | 
|---|
| 163 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 164 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 165 | #
 | 
|---|
| 166 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 167 | # @param    $(objsuff)  Object suffix.
 | 
|---|
| 168 | TOOL_VCC70_COMPILE_CXX_DONT_PURGE_OUTPUT =
 | 
|---|
| 169 | TOOL_VCC70_COMPILE_CXX_DEPEND =
 | 
|---|
| 170 | TOOL_VCC70_COMPILE_CXX_DEPORD =
 | 
|---|
| 171 | #ifdef KBUILD_USE_KOBJCACHE
 | 
|---|
| 172 | #TOOL_VCC70_COMPILE_CXX_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC70_PDB, $(outbase)-obj,idb) $(outbase).ii
 | 
|---|
| 173 | #TOOL_VCC70_COMPILE_CXX_USES_KOBJCACHE = 1
 | 
|---|
| 174 | #define TOOL_VCC70_COMPILE_CXX_CMDS
 | 
|---|
| 175 | #       $(QUIET)$(KOBJCACHE) -f $(outbase).koc -r --kObjCache-cpp $(outbase).ii \
 | 
|---|
| 176 | #               $(TOOL_VCC70_CC) -E \
 | 
|---|
| 177 | #               $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 178 | #               $(subst /,\\,$(abspath $(source))) \
 | 
|---|
| 179 | #               --kObjCache-cc $(obj) \
 | 
|---|
| 180 | #               $(TOOL_VCC70_CC) -c -TP\
 | 
|---|
| 181 | #               $(flags) \
 | 
|---|
| 182 | #               -Fd$(outbase)-obj.pdb \
 | 
|---|
| 183 | #               -FD\
 | 
|---|
| 184 | #               -Fo$(obj)\
 | 
|---|
| 185 | #               $(subst /,\\,$(outbase).ii)
 | 
|---|
| 186 | #       $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC70_PDB,$(outbase)-obj,idb)
 | 
|---|
| 187 | #endef
 | 
|---|
| 188 | #else # !KBUILD_USE_KOBJCACHE
 | 
|---|
| 189 | TOOL_VCC70_COMPILE_CXX_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj,idb)
 | 
|---|
| 190 | TOOL_VCC70_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC70_PDB, $(outbase)-obj,pdb)
 | 
|---|
| 191 | define TOOL_VCC70_COMPILE_CXX_CMDS
 | 
|---|
| 192 |         $(QUIET)$(TOOL_VCC70_CXX) -c\
 | 
|---|
| 193 |                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 | 
|---|
| 194 |                 -Fd$(outbase)-obj.pdb \
 | 
|---|
| 195 |                 -FD\
 | 
|---|
| 196 |                 -Fo$(obj)\
 | 
|---|
| 197 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 198 |         $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC70_PDB,$(outbase)-obj,idb)
 | 
|---|
| 199 | endef
 | 
|---|
| 200 | #endif # !KBUILD_USE_KOBJCACHE
 | 
|---|
| 201 | 
 | 
|---|
| 202 | 
 | 
|---|
| 203 | ## Compile resource source.
 | 
|---|
| 204 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 205 | # @param    $(source)   Source filename (relative).
 | 
|---|
| 206 | # @param    $(obj)      Object file name. This shall be (re)created by the compilation.
 | 
|---|
| 207 | # @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
 | 
|---|
| 208 | # @param    $(flags)    Flags.
 | 
|---|
| 209 | # @param    $(defs)     Definitions. No -D or something.
 | 
|---|
| 210 | # @param    $(incs)     Includes. No -I or something.
 | 
|---|
| 211 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 212 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 213 | #
 | 
|---|
| 214 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 215 | # @param    $(objsuff)  Object suffix.
 | 
|---|
| 216 | TOOL_VCC70_COMPILE_RC_OUTPUT =
 | 
|---|
| 217 | TOOL_VCC70_COMPILE_RC_DEPEND =
 | 
|---|
| 218 | TOOL_VCC70_COMPILE_RC_DEPORD =
 | 
|---|
| 219 | define TOOL_VCC70_COMPILE_RC_CMDS
 | 
|---|
| 220 |         $(QUIET)$(TOOL_VCC70_RC) \
 | 
|---|
| 221 |                 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
 | 
|---|
| 222 |                 /fo$(obj)\
 | 
|---|
| 223 |                 $(subst /,\\,$(abspath $(source)))
 | 
|---|
| 224 | endef
 | 
|---|
| 225 | 
 | 
|---|
| 226 | 
 | 
|---|
| 227 | ## Link library
 | 
|---|
| 228 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 229 | # @param    $(out)      Library name.
 | 
|---|
| 230 | # @param    $(objs)     Object files to put in the library.
 | 
|---|
| 231 | # @param    $(flags)    Flags.
 | 
|---|
| 232 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 233 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 234 | # @param    $(othersrc) Unhandled sources.
 | 
|---|
| 235 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 236 | #
 | 
|---|
| 237 | TOOL_VCC70_LINK_LIBRARY_DEPEND = $(othersrc)
 | 
|---|
| 238 | TOOL_VCC70_LINK_LIBRARY_DEPORD =
 | 
|---|
| 239 | TOOL_VCC70_LINK_LIBRARY_OUTPUT = $(outbase).rsp
 | 
|---|
| 240 | TOOL_VCC70_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
 | 
|---|
| 241 | define TOOL_VCC70_LINK_LIBRARY_CMDS
 | 
|---|
| 242 |         $(QUIET)$(APPEND) -n $(outbase).rsp \
 | 
|---|
| 243 |                 $(foreach arg,\
 | 
|---|
| 244 |                         $(subst /,\\,$(objs) \
 | 
|---|
| 245 |                         $(filter-out %.def,$(othersrc))) \
 | 
|---|
| 246 |                         $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
 | 
|---|
| 247 |                         ,\"$(arg)\")
 | 
|---|
| 248 |         $(QUIET)$(TOOL_VCC70_AR) $(flags) /OUT:$(out) @$(outbase).rsp
 | 
|---|
| 249 | endef
 | 
|---|
| 250 | 
 | 
|---|
| 251 | 
 | 
|---|
| 252 | ## Link program
 | 
|---|
| 253 | # @param    $(target)       Normalized main target name.
 | 
|---|
| 254 | # @param    $(out)          Program name.
 | 
|---|
| 255 | # @param    $(objs)         Object files to link together.
 | 
|---|
| 256 | # @param    $(libs)         Libraries to search.
 | 
|---|
| 257 | # @param    $(libpath)      Library search paths.
 | 
|---|
| 258 | # @param    $(flags)        Flags.
 | 
|---|
| 259 | # @param    $(dirdep)       Directory creation dependency.
 | 
|---|
| 260 | # @param    $(deps)         Other dependencies.
 | 
|---|
| 261 | # @param    $(othersrc)     Unhandled sources.
 | 
|---|
| 262 | # @param    $(custom_pre)   Custom step invoked before linking.
 | 
|---|
| 263 | # @param    $(custom_post)  Custom step invoked after linking.
 | 
|---|
| 264 | # @param    $(outbase)      Output basename (full). Use this for list files and such.
 | 
|---|
| 265 | #
 | 
|---|
| 266 | TOOL_VCC70_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk
 | 
|---|
| 267 | TOOL_VCC70_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 | 
|---|
| 268 | TOOL_VCC70_LINK_PROGRAM_DEPORD =
 | 
|---|
| 269 | define TOOL_VCC70_LINK_PROGRAM_CMDS
 | 
|---|
| 270 |         $(QUIET)$(TOOL_VCC70_LD) $(flags) \
 | 
|---|
| 271 |                 /OUT:$(out) \
 | 
|---|
| 272 |                 /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
 | 
|---|
| 273 |                 /MAP:$(outbase).map \
 | 
|---|
| 274 |                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
 | 
|---|
| 275 |                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
 | 
|---|
| 276 |                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
 | 
|---|
| 277 |                 $(subst /,\\,$(objs)) \
 | 
|---|
| 278 |                 $(subst /,\\,$(libs))
 | 
|---|
| 279 | endef
 | 
|---|
| 280 | 
 | 
|---|
| 281 | 
 | 
|---|
| 282 | ## Link DLL.
 | 
|---|
| 283 | # @param    $(target)   Normalized main target name.
 | 
|---|
| 284 | # @param    $(out)      DLL name.
 | 
|---|
| 285 | # @param    $(objs)     Object files to link together.
 | 
|---|
| 286 | # @param    $(libs)     Libraries to search.
 | 
|---|
| 287 | # @param    $(libpath)  Library search paths.
 | 
|---|
| 288 | # @param    $(flags)    Flags.
 | 
|---|
| 289 | # @param    $(dirdep)   Directory creation dependency.
 | 
|---|
| 290 | # @param    $(deps)     Other dependencies.
 | 
|---|
| 291 | # @param    $(othersrc)     Unhandled sources.
 | 
|---|
| 292 | # @param    $(custom_pre)   Custom step invoked before linking.
 | 
|---|
| 293 | # @param    $(custom_post)  Custom step invoked after linking.
 | 
|---|
| 294 | #
 | 
|---|
| 295 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 296 | TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
 | 
|---|
| 297 | TOOL_VCC70_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk
 | 
|---|
| 298 | TOOL_VCC70_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 | 
|---|
| 299 | TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
 | 
|---|
| 300 | define TOOL_VCC70_LINK_DLL_CMDS
 | 
|---|
| 301 |         $(QUIET)$(TOOL_VCC70_LD) $(flags) \
 | 
|---|
| 302 |                 /OUT:$(out) \
 | 
|---|
| 303 |                 /IMPLIB:$(outbase).lib \
 | 
|---|
| 304 |                 /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
 | 
|---|
| 305 |                 /MAP:$(outbase).map \
 | 
|---|
| 306 |                 /DLL \
 | 
|---|
| 307 |                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
 | 
|---|
| 308 |                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
 | 
|---|
| 309 |                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
 | 
|---|
| 310 |                 $(subst /,\\,$(objs)) \
 | 
|---|
| 311 |                 $(subst /,\\,$(libs))
 | 
|---|
| 312 | ifeq ($(filter %.exp .def,$(othersrc)),)
 | 
|---|
| 313 |         $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
 | 
|---|
| 314 | endif
 | 
|---|
| 315 | $(eval _DIRS += $(PATH_LIB))
 | 
|---|
| 316 | endef
 | 
|---|
| 317 | 
 | 
|---|
| 318 | 
 | 
|---|
| 319 | ## Link system module (windows aka driver, linux aka kernel module)
 | 
|---|
| 320 | # @param    $(target)       Normalized main target name.
 | 
|---|
| 321 | # @param    $(out)          System module name.
 | 
|---|
| 322 | # @param    $(objs)         Object files to link together.
 | 
|---|
| 323 | # @param    $(libs)         Libraries to search.
 | 
|---|
| 324 | # @param    $(libpath)      Library search paths.
 | 
|---|
| 325 | # @param    $(flags)        Flags.
 | 
|---|
| 326 | # @param    $(dirdep)       Directory creation dependency.
 | 
|---|
| 327 | # @param    $(deps)         Other dependencies.
 | 
|---|
| 328 | # @param    $(othersrc)     Unhandled sources.
 | 
|---|
| 329 | # @param    $(custom_pre)   Custom step invoked before linking.
 | 
|---|
| 330 | # @param    $(custom_post)  Custom step invoked after linking.
 | 
|---|
| 331 | #
 | 
|---|
| 332 | # @param    $(outbase)  Output basename (full). Use this for list files and such.
 | 
|---|
| 333 | TOOL_VCC70_LINK_SYSMOD_OUTPUT = $(outbase).map
 | 
|---|
| 334 | TOOL_VCC70_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk
 | 
|---|
| 335 | TOOL_VCC70_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 | 
|---|
| 336 | TOOL_VCC70_LINK_SYSMOD_DEPORD =
 | 
|---|
| 337 | define TOOL_VCC70_LINK_SYSMOD_CMDS
 | 
|---|
| 338 |         $(QUIET)$(TOOL_VCC70_LD) $(flags) \
 | 
|---|
| 339 |                 /OUT:$(out) \
 | 
|---|
| 340 |                 /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
 | 
|---|
| 341 |                 /MAP:$(outbase).map \
 | 
|---|
| 342 |                 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
 | 
|---|
| 343 |                 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
 | 
|---|
| 344 |                 $(foreach p,$(libpath), /LIBPATH:$(p)) \
 | 
|---|
| 345 |                 $(subst /,\\,$(objs)) \
 | 
|---|
| 346 |                 $(subst /,\\,$(libs))
 | 
|---|
| 347 | endef
 | 
|---|
| 348 | 
 | 
|---|