| 1 | # $Id: VCC70.kmk 448 2006-06-12 02:25:23Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | #
|
|---|
| 4 | # kBuild Tool Config - Visual C++ 7.0 (aka Visual .NET)
|
|---|
| 5 | #
|
|---|
| 6 | # Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net>
|
|---|
| 7 | #
|
|---|
| 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 |
|
|---|
| 27 |
|
|---|
| 28 | TOOL_VCC70 := Visual C++ 7.0
|
|---|
| 29 | ifndef PATH_TOOL_VCC70
|
|---|
| 30 | PATH_TOOL_VCC70 := $(wildcard $(PATH_DEV)/x86.win32/vcc/v7)
|
|---|
| 31 | ifeq ($(PATH_TOOL_VCC70),)
|
|---|
| 32 | PATH_TOOL_VCC70 := $(PATH_DEV)/x86.win32/vcc70
|
|---|
| 33 | endif
|
|---|
| 34 | endif
|
|---|
| 35 | PATH_TOOL_VCC70_LIB ?= $(PATH_TOOL_VCC70)/lib
|
|---|
| 36 |
|
|---|
| 37 | TOOL_VCC70_CC := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
|
|---|
| 38 | TOOL_VCC70_COBJSUFF := .obj
|
|---|
| 39 | TOOL_VCC70_CFLAGS := -TC -c -nologo
|
|---|
| 40 | TOOL_VCC70_CFLAGS.debug := -Od -Zi
|
|---|
| 41 | TOOL_VCC70_CFLAGS.release := -O2
|
|---|
| 42 | TOOL_VCC70_CFLAGS.profile := -O2
|
|---|
| 43 | TOOL_VCC70_CINCS := $(PATH_TOOL_VCC70)/include
|
|---|
| 44 | TOOL_VCC70_CDEFS :=
|
|---|
| 45 |
|
|---|
| 46 | TOOL_VCC70_CXX := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
|
|---|
| 47 | TOOL_VCC70_CXXOBJSUFF := .obj
|
|---|
| 48 | TOOL_VCC70_CXXFLAGS := -TP -c -nologo
|
|---|
| 49 | TOOL_VCC70_CXXFLAGS.debug := -Od -Zi
|
|---|
| 50 | TOOL_VCC70_CXXFLAGS.release := -O2
|
|---|
| 51 | TOOL_VCC70_CXXFLAGS.profile := -O2
|
|---|
| 52 | TOOL_VCC70_CXXINCS := $(PATH_TOOL_VCC70)/include
|
|---|
| 53 | TOOL_VCC70_CXXDEFS :=
|
|---|
| 54 |
|
|---|
| 55 | TOOL_VCC70_AS := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/ml.exe
|
|---|
| 56 | TOOL_VCC70_ASOBJSUFF := .obj
|
|---|
| 57 |
|
|---|
| 58 | TOOL_VCC70_AR := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/lib.exe
|
|---|
| 59 | TOOL_VCC70_ARFLAGS := -nologo
|
|---|
| 60 | TOOL_VCC70_ARLIBSUFF := .lib
|
|---|
| 61 |
|
|---|
| 62 | TOOL_VCC70_LD := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/link.exe
|
|---|
| 63 | TOOL_VCC70_LDFLAGS := -nologo
|
|---|
| 64 | TOOL_VCC70_LDFLAGS.debug := -debug
|
|---|
| 65 | TOOL_VCC70_LDFLAGS.release :=
|
|---|
| 66 |
|
|---|
| 67 | ## Constructs the correct .pdb name (the name is lowercased).
|
|---|
| 68 | # @param $(1) Base name, no extention.
|
|---|
| 69 | # @param $(2) The extension.
|
|---|
| 70 | ifeq ($(filter tolower,$(KMK_FEATURES)),tolower)
|
|---|
| 71 | TOOL_VCC70_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
|---|
| 72 | else # this fallback is incorrect and won't work on a case sensitive FS.
|
|---|
| 73 | TOOL_VCC70_PDB = $(1).$(2)
|
|---|
| 74 | endif
|
|---|
| 75 |
|
|---|
| 76 | #ifeq ($(BUILD_PLATFORM),win32)
|
|---|
| 77 | VCC70_NEW_DEPS = 1
|
|---|
| 78 | #endif
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | ## Compile C source.
|
|---|
| 83 | # @param $(target) Normalized main target name.
|
|---|
| 84 | # @param $(source) Source filename (relative).
|
|---|
| 85 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 86 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 87 | # @param $(flags) Flags.
|
|---|
| 88 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 89 | # @param $(incs) Includes. No -I or something.
|
|---|
| 90 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 91 | # @param $(deps) Other dependencies.
|
|---|
| 92 | #
|
|---|
| 93 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 94 | # @param $(objsuff) Object suffix.
|
|---|
| 95 | TOOL_VCC70_COMPILE_C_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC70_PDB, $(outbase)-obj,idb)
|
|---|
| 96 | TOOL_VCC70_COMPILE_C_DEPEND =
|
|---|
| 97 | TOOL_VCC70_COMPILE_C_DEPORD =
|
|---|
| 98 | ifdef VCC70_NEW_DEPS
|
|---|
| 99 | define TOOL_VCC70_COMPILE_C_CMDS
|
|---|
| 100 | $(TOOL_VCC70_CC) -c\
|
|---|
| 101 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 102 | -Fd$(outbase)-obj.pdb \
|
|---|
| 103 | -FD\
|
|---|
| 104 | -Fo$(obj)\
|
|---|
| 105 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 106 | $(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC70_PDB,$(outbase)-obj,idb)
|
|---|
| 107 | endef
|
|---|
| 108 | else
|
|---|
| 109 | define TOOL_VCC70_COMPILE_C_CMDS
|
|---|
| 110 | $(TOOL_VCC70_CC) -c\
|
|---|
| 111 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 112 | -Fd$(outbase)-obj.pdb \
|
|---|
| 113 | -Fo$(obj)\
|
|---|
| 114 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 115 | $(TOOL_VCC70_CC) -E\
|
|---|
| 116 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 117 | $(subst /,\\,$(call ABSPATH,$(source)))\
|
|---|
| 118 | | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
|
|---|
| 119 | endef
|
|---|
| 120 | endif
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 | ## Compile C++ source.
|
|---|
| 124 | # @param $(target) Normalized main target name.
|
|---|
| 125 | # @param $(source) Source filename (relative).
|
|---|
| 126 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 127 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 128 | # @param $(flags) Flags.
|
|---|
| 129 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 130 | # @param $(incs) Includes. No -I or something.
|
|---|
| 131 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 132 | # @param $(deps) Other dependencies.
|
|---|
| 133 | #
|
|---|
| 134 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 135 | # @param $(objsuff) Object suffix.
|
|---|
| 136 | TOOL_VCC70_COMPILE_CXX_OUTPUT = $(call TOOL_VCC70_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC70_PDB, $(outbase)-obj,idb)
|
|---|
| 137 | TOOL_VCC70_COMPILE_CXX_DEPEND =
|
|---|
| 138 | TOOL_VCC70_COMPILE_CXX_DEPORD =
|
|---|
| 139 | ifdef VCC70_NEW_DEPS
|
|---|
| 140 | define TOOL_VCC70_COMPILE_CXX_CMDS
|
|---|
| 141 | $(TOOL_VCC70_CXX) -c\
|
|---|
| 142 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 143 | -Fd$(outbase)-obj.pdb \
|
|---|
| 144 | -FD\
|
|---|
| 145 | -Fo$(obj)\
|
|---|
| 146 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 147 | $(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC70_PDB,$(outbase)-obj,idb)
|
|---|
| 148 | endef
|
|---|
| 149 | else
|
|---|
| 150 | define TOOL_VCC70_COMPILE_CXX_CMDS
|
|---|
| 151 | $(TOOL_VCC70_CXX) -c\
|
|---|
| 152 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 153 | -Fd$(outbase)-obj.pdb \
|
|---|
| 154 | -Fo$(obj)\
|
|---|
| 155 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 156 | $(TOOL_VCC70_CXX) -E\
|
|---|
| 157 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 158 | $(subst /,\\,$(call ABSPATH,$(source)))\
|
|---|
| 159 | | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
|
|---|
| 160 | endef
|
|---|
| 161 | endif
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 | ## Link library
|
|---|
| 165 | # @param $(target) Normalized main target name.
|
|---|
| 166 | # @param $(out) Library name.
|
|---|
| 167 | # @param $(objs) Object files to put in the library.
|
|---|
| 168 | # @param $(flags) Flags.
|
|---|
| 169 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 170 | # @param $(deps) Other dependencies.
|
|---|
| 171 | # @param $(othersrc) Unhandled sources.
|
|---|
| 172 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 173 | #
|
|---|
| 174 | TOOL_VCC70_LINK_LIBRARY_OUTPUT = $(outbase).lst $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase),pdb)
|
|---|
| 175 | TOOL_VCC70_LINK_LIBRARY_DEPEND = $(othersrc)
|
|---|
| 176 | TOOL_VCC70_LINK_LIBRARY_DEPORD =
|
|---|
| 177 | define TOOL_VCC70_LINK_LIBRARY_CMDS
|
|---|
| 178 | $(TOOL_VCC70_AR) $(flags) /OUT:$(out) $(subst /,\\,$(objs) $(filter %.a %.lib,$(othersrc))) \
|
|---|
| 179 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
|
|---|
| 180 | endef
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 | ## Link program
|
|---|
| 184 | # @param $(target) Normalized main target name.
|
|---|
| 185 | # @param $(out) Program name.
|
|---|
| 186 | # @param $(objs) Object files to link together.
|
|---|
| 187 | # @param $(libs) Libraries to search.
|
|---|
| 188 | # @param $(libpath) Library search paths.
|
|---|
| 189 | # @param $(flags) Flags.
|
|---|
| 190 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 191 | # @param $(deps) Other dependencies.
|
|---|
| 192 | # @param $(othersrc) Unhandled sources.
|
|---|
| 193 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 194 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 195 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 196 | #
|
|---|
| 197 | TOOL_VCC70_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase),pdb) $(outbase).ilk
|
|---|
| 198 | TOOL_VCC70_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 199 | TOOL_VCC70_LINK_PROGRAM_DEPORD =
|
|---|
| 200 | define TOOL_VCC70_LINK_PROGRAM_CMDS
|
|---|
| 201 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 202 | /OUT:$(out) \
|
|---|
| 203 | /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
|
|---|
| 204 | /MAP:$(outbase).map \
|
|---|
| 205 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 206 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 207 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 208 | $(subst /,\\,$(objs)) \
|
|---|
| 209 | $(subst /,\\,$(libs))
|
|---|
| 210 | endef
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 | ## Link DLL.
|
|---|
| 214 | # @param $(target) Normalized main target name.
|
|---|
| 215 | # @param $(out) DLL name.
|
|---|
| 216 | # @param $(objs) Object files to link together.
|
|---|
| 217 | # @param $(libs) Libraries to search.
|
|---|
| 218 | # @param $(libpath) Library search paths.
|
|---|
| 219 | # @param $(flags) Flags.
|
|---|
| 220 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 221 | # @param $(deps) Other dependencies.
|
|---|
| 222 | # @param $(othersrc) Unhandled sources.
|
|---|
| 223 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 224 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 225 | #
|
|---|
| 226 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 227 | TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase),pdb) $(outbase).ilk
|
|---|
| 228 | TOOL_VCC70_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 229 | TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
|
|---|
| 230 | define TOOL_VCC70_LINK_DLL_CMDS
|
|---|
| 231 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 232 | /OUT:$(out) \
|
|---|
| 233 | /IMPLIB:$(outbase).lib \
|
|---|
| 234 | /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
|
|---|
| 235 | /MAP:$(outbase).map \
|
|---|
| 236 | /DLL \
|
|---|
| 237 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 238 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 239 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 240 | $(subst /,\\,$(objs)) \
|
|---|
| 241 | $(subst /,\\,$(libs))
|
|---|
| 242 | ifeq ($(filter %.exp .def,$(othersrc)),)
|
|---|
| 243 | if test -f $(outbase).exp; then $(CP_EXT) $(outbase).exp $(PATH_LIB)/; fi
|
|---|
| 244 | if test -f $(outbase).lib; then $(CP_EXT) $(outbase).lib $(PATH_LIB)/; fi
|
|---|
| 245 | endif
|
|---|
| 246 | $(eval _DIRS += $(PATH_LIB))
|
|---|
| 247 | endef
|
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 251 | # @param $(target) Normalized main target name.
|
|---|
| 252 | # @param $(out) System module name.
|
|---|
| 253 | # @param $(objs) Object files to link together.
|
|---|
| 254 | # @param $(libs) Libraries to search.
|
|---|
| 255 | # @param $(libpath) Library search paths.
|
|---|
| 256 | # @param $(flags) Flags.
|
|---|
| 257 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 258 | # @param $(deps) Other dependencies.
|
|---|
| 259 | # @param $(othersrc) Unhandled sources.
|
|---|
| 260 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 261 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 262 | #
|
|---|
| 263 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 264 | TOOL_VCC70_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC70_PDB, $(outbase),pdb) $(outbase).ilk
|
|---|
| 265 | TOOL_VCC70_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 266 | TOOL_VCC70_LINK_SYSMOD_DEPORD =
|
|---|
| 267 | define TOOL_VCC70_LINK_SYSMOD_CMDS
|
|---|
| 268 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 269 | /OUT:$(out) \
|
|---|
| 270 | /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
|
|---|
| 271 | /MAP:$(outbase).map \
|
|---|
| 272 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 273 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 274 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 275 | $(subst /,\\,$(objs)) \
|
|---|
| 276 | $(subst /,\\,$(libs))
|
|---|
| 277 | endef
|
|---|
| 278 |
|
|---|