| 1 | # $Id: VCC70.kmk 184 2004-12-04 02:26:54Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | #
|
|---|
| 4 | # kBuild Tool Config - Visual C++ 7.0 (aka Visual .NET)
|
|---|
| 5 | #
|
|---|
| 6 | # Copyright (c) 2004 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 | PATH_TOOL_VCC70 ?= $(PATH_DEV)/x86.win32/vcc70
|
|---|
| 30 | PATH_TOOL_VCC70_LIB ?= $(PATH_DEV)/x86.win32/vcc70/lib
|
|---|
| 31 |
|
|---|
| 32 | TOOL_VCC70_CC := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
|
|---|
| 33 | TOOL_VCC70_COBJSUFF := .obj
|
|---|
| 34 | TOOL_VCC70_CFLAGS := -TC -c -nologo
|
|---|
| 35 | TOOL_VCC70_CFLAGS.debug := -Od -Zi
|
|---|
| 36 | TOOL_VCC70_CFLAGS.release := -O2
|
|---|
| 37 | TOOL_VCC70_CFLAGS.profile := -O2
|
|---|
| 38 | TOOL_VCC70_CINCS := $(PATH_TOOL_VCC70)/include
|
|---|
| 39 | TOOL_VCC70_CDEFS :=
|
|---|
| 40 |
|
|---|
| 41 | TOOL_VCC70_CXX := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
|
|---|
| 42 | TOOL_VCC70_CXXOBJSUFF := .obj
|
|---|
| 43 | TOOL_VCC70_CXXFLAGS := -TP -c -nologo
|
|---|
| 44 | TOOL_VCC70_CXXFLAGS.debug := -Od -Zi
|
|---|
| 45 | TOOL_VCC70_CXXFLAGS.release := -O2
|
|---|
| 46 | TOOL_VCC70_CXXFLAGS.profile := -O2
|
|---|
| 47 | TOOL_VCC70_CXXINCS := $(PATH_TOOL_VCC70)/include
|
|---|
| 48 | TOOL_VCC70_CXXDEFS :=
|
|---|
| 49 |
|
|---|
| 50 | TOOL_VCC70_AS := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/ml.exe
|
|---|
| 51 | TOOL_VCC70_ASOBJSUFF := .obj
|
|---|
| 52 |
|
|---|
| 53 | TOOL_VCC70_AR := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/lib.exe
|
|---|
| 54 | TOOL_VCC70_ARFLAGS := -nologo
|
|---|
| 55 | TOOL_VCC70_ARLIBSUFF := .lib
|
|---|
| 56 |
|
|---|
| 57 | TOOL_VCC70_LD := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/link.exe
|
|---|
| 58 | TOOL_VCC70_LDFLAGS := -nologo
|
|---|
| 59 | TOOL_VCC70_LDFLAGS.debug := -debug
|
|---|
| 60 | TOOL_VCC70_LDFLAGS.release :=
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | ## Compile C source.
|
|---|
| 64 | # @param $(target) Normalized main target name.
|
|---|
| 65 | # @param $(source) Source filename (relative).
|
|---|
| 66 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 67 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 68 | # @param $(flags) Flags.
|
|---|
| 69 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 70 | # @param $(incs) Includes. No -I or something.
|
|---|
| 71 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 72 | # @param $(deps) Other dependencies.
|
|---|
| 73 | #
|
|---|
| 74 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 75 | # @param $(objsuff) Object suffix.
|
|---|
| 76 | define TOOL_VCC70_COMPILE_C
|
|---|
| 77 | #$ (warning dbg: TOOL_VCC70_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
|
|---|
| 78 | $(obj): $(dirdep) $(source) $(deps)
|
|---|
| 79 | $(call MSG_L2,Compiling $$@ using VCC70)
|
|---|
| 80 | $(TOOL_VCC70_CC) -c\
|
|---|
| 81 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 82 | -Fd$(outbase).pdb \
|
|---|
| 83 | -Fo$(obj)\
|
|---|
| 84 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 85 | $(DEP_CCXX) -q -f $(dep) -o $(obj) \
|
|---|
| 86 | -D_M_IX86=500 -D_WIN32 -D_MSC_VER=1300 -D_MSC_EXTENSIONS=1 -D__COUNTER__=42 \
|
|---|
| 87 | -D__DATE__=\"0000.00.00\" -D__FILE__=\"filename.c\" -D__LINE__=42 -D__TIME__=\"00.00.00\" -D__TIMESTAMP__=\"lotsofnumbers\" \
|
|---|
| 88 | $(addprefix -D, $(defs)) $(addprefix -I, $(incs)) \
|
|---|
| 89 | $(call ABSPATH,$(source))
|
|---|
| 90 | _OUT_FILES += $(outbase).pdb
|
|---|
| 91 |
|
|---|
| 92 | endef
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | ## Compile C++ source.
|
|---|
| 96 | # @param $(target) Normalized main target name.
|
|---|
| 97 | # @param $(source) Source filename (relative).
|
|---|
| 98 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 99 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 100 | # @param $(flags) Flags.
|
|---|
| 101 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 102 | # @param $(incs) Includes. No -I or something.
|
|---|
| 103 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 104 | # @param $(deps) Other dependencies.
|
|---|
| 105 | #
|
|---|
| 106 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 107 | # @param $(objsuff) Object suffix.
|
|---|
| 108 | define TOOL_VCC70_COMPILE_CXX
|
|---|
| 109 | #$ (warning dbg: TOOL_VCC70_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
|
|---|
| 110 | $(obj): $(dirdep) $(source) $(deps)
|
|---|
| 111 | $(call MSG_L2,Compiling $$@ using VCC70)
|
|---|
| 112 | $(TOOL_VCC70_CXX) -c\
|
|---|
| 113 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 114 | -Fd$(outbase).pdb \
|
|---|
| 115 | -Fo$(obj)\
|
|---|
| 116 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 117 | $(DEP_CCXX) -q -f $(dep) -o $(obj) \
|
|---|
| 118 | -D__cplusplus \
|
|---|
| 119 | -D_M_IX86=500 -D_WIN32 -D_MSC_VER=1300 -D_MSC_EXTENSIONS=1 -D__COUNTER__=42 \
|
|---|
| 120 | -D__DATE__=\"0000.00.00\" -D__FILE__=\"filename.c\" -D__LINE__=42 -D__TIME__=\"00.00.00\" -D__TIMESTAMP__=\"lotsofnumbers\" \
|
|---|
| 121 | $(addprefix -D, $(defs)) $(addprefix -I, $(incs)) \
|
|---|
| 122 | $(call ABSPATH,$(source))
|
|---|
| 123 | _OUT_FILES += $(outbase).pdb
|
|---|
| 124 |
|
|---|
| 125 | endef
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 | ## Link library
|
|---|
| 129 | # @param $(target) Normalized main target name.
|
|---|
| 130 | # @param $(lib) Library name.
|
|---|
| 131 | # @param $(objs) Object files to put in the library.
|
|---|
| 132 | # @param $(flags) Flags.
|
|---|
| 133 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 134 | # @param $(deps) Other dependencies.
|
|---|
| 135 | # @param $(othersrc) Unhandled sources.
|
|---|
| 136 | #
|
|---|
| 137 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 138 | define TOOL_VCC70_LINK_LIBRARY
|
|---|
| 139 | #$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
|
|---|
| 140 | $(lib): $(dirdep) $(objs) $(deps) $(othersrc)
|
|---|
| 141 | $(call MSG_L1,Creating Library $$@)
|
|---|
| 142 | $(RM) -f $$@
|
|---|
| 143 | $(TOOL_VCC70_AR) $(flags) /OUT:$(lib) $(subst /,\\,$(objs)) \
|
|---|
| 144 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
|
|---|
| 145 |
|
|---|
| 146 | endef
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 | ## Link program
|
|---|
| 150 | # @param $(target) Normalized main target name.
|
|---|
| 151 | # @param $(exe) Program name.
|
|---|
| 152 | # @param $(objs) Object files to link together.
|
|---|
| 153 | # @param $(libs) Libraries to search.
|
|---|
| 154 | # @param $(libpath) Library search paths.
|
|---|
| 155 | # @param $(flags) Flags.
|
|---|
| 156 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 157 | # @param $(deps) Other dependencies.
|
|---|
| 158 | # @param $(othersrc) Unhandled sources.
|
|---|
| 159 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 160 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 161 | #
|
|---|
| 162 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 163 | define TOOL_VCC70_LINK_PROGRAM
|
|---|
| 164 | #$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
|
|---|
| 165 | $(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
|---|
| 166 | $(call MSG_L1,Creating Program $$@)
|
|---|
| 167 | ifneq ($(custom_pre),)
|
|---|
| 168 | $(eval $(custom_pre))
|
|---|
| 169 | endif
|
|---|
| 170 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 171 | /OUT:$(exe) \
|
|---|
| 172 | /MAPINFO:EXPORTS /MAPINFO:LINES \
|
|---|
| 173 | /MAP:$(outbase).map \
|
|---|
| 174 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 175 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 176 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 177 | $(subst /,\\,$(objs)) \
|
|---|
| 178 | $(subst /,\\,$(libs))
|
|---|
| 179 | ifneq ($(custom_post),)
|
|---|
| 180 | $(eval $(custom_post))
|
|---|
| 181 | endif
|
|---|
| 182 | _OUT_FILES += $(outbase).map $(outbase).pdb $(outbase).ilk
|
|---|
| 183 |
|
|---|
| 184 | endef
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 188 | # @param $(target) Normalized main target name.
|
|---|
| 189 | # @param $(sys) System module name.
|
|---|
| 190 | # @param $(objs) Object files to link together.
|
|---|
| 191 | # @param $(libs) Libraries to search.
|
|---|
| 192 | # @param $(libpath) Library search paths.
|
|---|
| 193 | # @param $(flags) Flags.
|
|---|
| 194 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 195 | # @param $(deps) Other dependencies.
|
|---|
| 196 | # @param $(othersrc) Unhandled sources.
|
|---|
| 197 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 198 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 199 | #
|
|---|
| 200 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 201 | define TOOL_VCC70_LINK_SYSMOD
|
|---|
| 202 | #$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) sys=$(sys) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
|
|---|
| 203 | $(sys): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
|---|
| 204 | $(call MSG_L1,Creating Program $$@)
|
|---|
| 205 | ifneq ($(custom_pre),)
|
|---|
| 206 | $(eval $(custom_pre))
|
|---|
| 207 | endif
|
|---|
| 208 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 209 | /OUT:$(sys) \
|
|---|
| 210 | /MAPINFO:EXPORTS /MAPINFO:LINES \
|
|---|
| 211 | /MAP:$(outbase).map \
|
|---|
| 212 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 213 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 214 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 215 | $(subst /,\\,$(objs)) \
|
|---|
| 216 | $(subst /,\\,$(libs))
|
|---|
| 217 | ifneq ($(custom_post),)
|
|---|
| 218 | $(eval $(custom_post))
|
|---|
| 219 | endif
|
|---|
| 220 | _OUT_FILES += $(outbase).map $(outbase).pdb $(outbase).ilk
|
|---|
| 221 |
|
|---|
| 222 | endef
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 226 | # @param $(target) Normalized main target name.
|
|---|
| 227 | # @param $(dll) System module name.
|
|---|
| 228 | # @param $(objs) Object files to link together.
|
|---|
| 229 | # @param $(libs) Libraries to search.
|
|---|
| 230 | # @param $(libpath) Library search paths.
|
|---|
| 231 | # @param $(flags) Flags.
|
|---|
| 232 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 233 | # @param $(deps) Other dependencies.
|
|---|
| 234 | # @param $(othersrc) Unhandled sources.
|
|---|
| 235 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 236 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 237 | #
|
|---|
| 238 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 239 | define TOOL_VCC70_LINK_DLL
|
|---|
| 240 | #$ (warning dbg: TOOL_VCC70_LINK_DLL: target=$(target) dll=$(dll) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
|
|---|
| 241 | $(dll): $(dirdep) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
|---|
| 242 | $(call MSG_L1,Creating Program $$@)
|
|---|
| 243 | ifneq ($(custom_pre),)
|
|---|
| 244 | $(eval $(custom_pre))
|
|---|
| 245 | endif
|
|---|
| 246 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 247 | /OUT:$(dll) \
|
|---|
| 248 | /IMPLIB:$(outbase).lib \
|
|---|
| 249 | /MAPINFO:EXPORTS /MAPINFO:LINES \
|
|---|
| 250 | /MAP:$(outbase).map \
|
|---|
| 251 | /DLL \
|
|---|
| 252 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 253 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 254 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 255 | $(subst /,\\,$(objs)) \
|
|---|
| 256 | $(subst /,\\,$(libs))
|
|---|
| 257 | ifeq ($(filter %.exp .def,$(othersrc)),)
|
|---|
| 258 | if test -f $(outbase).exp; then $(CP) $(outbase).exp $(PATH_LIB)/; fi
|
|---|
| 259 | if test -f $(outbase).lib; then $(CP) $(outbase).lib $(PATH_LIB)/; fi
|
|---|
| 260 | endif
|
|---|
| 261 | ifneq ($(custom_post),)
|
|---|
| 262 | $(eval $(custom_post))
|
|---|
| 263 | endif
|
|---|
| 264 | _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk
|
|---|
| 265 |
|
|---|
| 266 | endef
|
|---|
| 267 |
|
|---|