| 1 | # $Id: VCC70.kmk 175 2004-10-13 16:02:52Z 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 :=
|
|---|
| 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 :=
|
|---|
| 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 | #
|
|---|
| 73 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 74 | # @param $(objsuff) Object suffix.
|
|---|
| 75 | define TOOL_VCC70_COMPILE_C
|
|---|
| 76 | #$ (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))
|
|---|
| 77 | $(obj): $(dirdep) $(source)
|
|---|
| 78 | $(call MSG_L2,Compiling $$@ using VCC70)
|
|---|
| 79 | $(TOOL_VCC70_CC) -c\
|
|---|
| 80 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 81 | -Fd$(outbase).pdb \
|
|---|
| 82 | -Fo$(obj)\
|
|---|
| 83 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 84 | $(DEP_CCXX) -q -f $(dep) -o $(obj) $(addprefix -D, $(defs)) $(addprefix -I, $(incs)) $(call ABSPATH,$(source))
|
|---|
| 85 | _OUT_FILES += $(outbase).pdb
|
|---|
| 86 |
|
|---|
| 87 | endef
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 | ## Compile C++ source.
|
|---|
| 91 | # @param $(target) Normalized main target name.
|
|---|
| 92 | # @param $(source) Source filename (relative).
|
|---|
| 93 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
|---|
| 94 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
|---|
| 95 | # @param $(flags) Flags.
|
|---|
| 96 | # @param $(defs) Definitions. No -D or something.
|
|---|
| 97 | # @param $(incs) Includes. No -I or something.
|
|---|
| 98 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 99 | #
|
|---|
| 100 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 101 | # @param $(objsuff) Object suffix.
|
|---|
| 102 | define TOOL_VCC70_COMPILE_CXX
|
|---|
| 103 | #$ (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))
|
|---|
| 104 | $(obj): $(dirdep) $(source)
|
|---|
| 105 | $(call MSG_L2,Compiling $$@ using VCC70)
|
|---|
| 106 | $(TOOL_VCC70_CXX) -c\
|
|---|
| 107 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
|---|
| 108 | -Fd$(outbase).pdb \
|
|---|
| 109 | -Fo$(obj)\
|
|---|
| 110 | $(subst /,\\,$(call ABSPATH,$(source)))
|
|---|
| 111 | $(DEP_CCXX) -q -f $(dep) -o $(obj) $(addprefix -D, $(defs)) $(addprefix -I, $(incs)) $(call ABSPATH,$(source))
|
|---|
| 112 | _OUT_FILES += $(outbase).pdb
|
|---|
| 113 |
|
|---|
| 114 | endef
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 | ## Link library
|
|---|
| 118 | # @param $(target) Normalized main target name.
|
|---|
| 119 | # @param $(lib) Library name.
|
|---|
| 120 | # @param $(objs) Object files to put in the library.
|
|---|
| 121 | # @param $(flags) Flags.
|
|---|
| 122 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 123 | # @param $(deps) Other dependencies.
|
|---|
| 124 | # @param $(othersrc) Unhandled sources.
|
|---|
| 125 | #
|
|---|
| 126 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 127 | define TOOL_VCC70_LINK_LIBRARY
|
|---|
| 128 | #$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
|
|---|
| 129 | $(lib): $(dirdep) $(objs) $(deps) $(othersrc)
|
|---|
| 130 | $(call MSG_L1,Creating Library $$@)
|
|---|
| 131 | $(RM) -f $$@
|
|---|
| 132 | $(TOOL_VCC70_AR) $(flags) /OUT:$(lib) $(subst /,\\,$(objs)) \
|
|---|
| 133 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
|
|---|
| 134 |
|
|---|
| 135 | endef
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 | ## Link program
|
|---|
| 139 | # @param $(target) Normalized main target name.
|
|---|
| 140 | # @param $(exe) Program name.
|
|---|
| 141 | # @param $(objs) Object files to link together.
|
|---|
| 142 | # @param $(libs) Libraries to search.
|
|---|
| 143 | # @param $(libpath) Library search paths.
|
|---|
| 144 | # @param $(flags) Flags.
|
|---|
| 145 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 146 | # @param $(deps) Other dependencies.
|
|---|
| 147 | # @param $(othersrc) Unhandled sources.
|
|---|
| 148 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 149 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 150 | #
|
|---|
| 151 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 152 | define TOOL_VCC70_LINK_PROGRAM
|
|---|
| 153 | #$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
|
|---|
| 154 | $(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
|---|
| 155 | $(call MSG_L1,Creating Program $$@)
|
|---|
| 156 | ifneq ($(custom_pre),)
|
|---|
| 157 | $(eval $(custom_pre))
|
|---|
| 158 | endif
|
|---|
| 159 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 160 | /OUT:$(exe) \
|
|---|
| 161 | /MAPINFO:EXPORTS /MAPINFO:LINES \
|
|---|
| 162 | /MAP:$(outbase).map \
|
|---|
| 163 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 164 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 165 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 166 | $(subst /,\\,$(objs)) \
|
|---|
| 167 | $(subst /,\\,$(libs))
|
|---|
| 168 | ifneq ($(custom_post),)
|
|---|
| 169 | $(eval $(custom_post))
|
|---|
| 170 | endif
|
|---|
| 171 | _OUT_FILES += $(outbase).map $(outbase).pdb $(outbase).ilk
|
|---|
| 172 |
|
|---|
| 173 | endef
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 177 | # @param $(target) Normalized main target name.
|
|---|
| 178 | # @param $(sys) System module name.
|
|---|
| 179 | # @param $(objs) Object files to link together.
|
|---|
| 180 | # @param $(libs) Libraries to search.
|
|---|
| 181 | # @param $(libpath) Library search paths.
|
|---|
| 182 | # @param $(flags) Flags.
|
|---|
| 183 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 184 | # @param $(deps) Other dependencies.
|
|---|
| 185 | # @param $(othersrc) Unhandled sources.
|
|---|
| 186 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 187 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 188 | #
|
|---|
| 189 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 190 | define TOOL_VCC70_LINK_SYSMOD
|
|---|
| 191 | #$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) sys=$(sys) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
|
|---|
| 192 | $(sys): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
|---|
| 193 | $(call MSG_L1,Creating Program $$@)
|
|---|
| 194 | ifneq ($(custom_pre),)
|
|---|
| 195 | $(eval $(custom_pre))
|
|---|
| 196 | endif
|
|---|
| 197 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 198 | /OUT:$(sys) \
|
|---|
| 199 | /MAPINFO:EXPORTS /MAPINFO:LINES \
|
|---|
| 200 | /MAP:$(outbase).map \
|
|---|
| 201 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 202 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 203 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 204 | $(subst /,\\,$(objs)) \
|
|---|
| 205 | $(subst /,\\,$(libs))
|
|---|
| 206 | ifneq ($(custom_post),)
|
|---|
| 207 | $(eval $(custom_post))
|
|---|
| 208 | endif
|
|---|
| 209 | _OUT_FILES += $(outbase).map $(outbase).pdb $(outbase).ilk
|
|---|
| 210 |
|
|---|
| 211 | endef
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 | ## Link system module (windows aka driver, linux aka kernel module)
|
|---|
| 215 | # @param $(target) Normalized main target name.
|
|---|
| 216 | # @param $(dll) System module name.
|
|---|
| 217 | # @param $(objs) Object files to link together.
|
|---|
| 218 | # @param $(libs) Libraries to search.
|
|---|
| 219 | # @param $(libpath) Library search paths.
|
|---|
| 220 | # @param $(flags) Flags.
|
|---|
| 221 | # @param $(dirdep) Directory creation dependency.
|
|---|
| 222 | # @param $(deps) Other dependencies.
|
|---|
| 223 | # @param $(othersrc) Unhandled sources.
|
|---|
| 224 | # @param $(custom_pre) Custom step invoked before linking.
|
|---|
| 225 | # @param $(custom_post) Custom step invoked after linking.
|
|---|
| 226 | #
|
|---|
| 227 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
|---|
| 228 | define TOOL_VCC70_LINK_DLL
|
|---|
| 229 | #$ (warning dbg: TOOL_VCC70_LINK_DLL: target=$(target) dll=$(dll) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
|
|---|
| 230 | $(dll): $(dirdep) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
|---|
| 231 | $(call MSG_L1,Creating Program $$@)
|
|---|
| 232 | ifneq ($(custom_pre),)
|
|---|
| 233 | $(eval $(custom_pre))
|
|---|
| 234 | endif
|
|---|
| 235 | $(TOOL_VCC70_LD) $(flags) \
|
|---|
| 236 | /OUT:$(dll) \
|
|---|
| 237 | /IMPLIB:$(outbase).lib \
|
|---|
| 238 | /MAPINFO:EXPORTS /MAPINFO:LINES \
|
|---|
| 239 | /MAP:$(outbase).map \
|
|---|
| 240 | /DLL \
|
|---|
| 241 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
|---|
| 242 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
|---|
| 243 | $(foreach p,$(libpath), /LIBPATH:$(p)) \
|
|---|
| 244 | $(subst /,\\,$(objs)) \
|
|---|
| 245 | $(subst /,\\,$(libs))
|
|---|
| 246 | ifeq ($(filter %.exp .def,$(othersrc)),)
|
|---|
| 247 | if test -f $(outbase).exp; then $(CP) $(outbase).exp $(PATH_LIB)/; fi
|
|---|
| 248 | if test -f $(outbase).lib; then $(CP) $(outbase).lib $(PATH_LIB)/; fi
|
|---|
| 249 | endif
|
|---|
| 250 | ifneq ($(custom_post),)
|
|---|
| 251 | $(eval $(custom_post))
|
|---|
| 252 | endif
|
|---|
| 253 | _OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk
|
|---|
| 254 |
|
|---|
| 255 | endef
|
|---|
| 256 |
|
|---|