source: trunk/kBuild/tools/VAC308.kmk@ 1312

Last change on this file since 1312 was 1147, checked in by bird, 18 years ago

resource compiler setup.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.8 KB
Line 
1# $Id: VAC308.kmk 1147 2007-09-27 18:20:07Z bird $
2## @file
3#
4# kBuild Tool Config - VisualAge for C++ v3.08.
5#
6# Copyright (c) 2004-2007 knut st. osmundsen <bird-kBuild-spam@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
27TOOL_VAC308 := VisualAge for C++ v3.08
28
29TOOL_VAC308_ENV_SETUP ?=
30
31# Determin VAC308 location.
32ifndef PATH_TOOL_VAC308
33 PATH_TOOL_VAC308 := $(wildcard $(PATH_DEVTOOLS_BLD)/vac/v308*)
34 ifeq ($(PATH_TOOL_VAC308),)
35 PATH_TOOL_VAC308 := $(wildcard $(PATH_DEVTOOLS_TRG)/vac/v308*)
36 endif
37 ifeq ($(PATH_TOOL_VAC308),)
38 PATH_TOOL_VAC308 := $(lastword $(sort $(PATH_TOOL_VAC308)))
39 endif
40 # if not found, we'll enter 'pathless' mode.
41else
42 # Resolve any fancy stuff once and for all.
43 PATH_TOOL_VAC308 := $(PATH_TOOL_VAC308)
44endif
45ifneq ($(PATH_TOOL_VAC308),)
46 PATH_TOOL_VAC308_BIN ?= $(PATH_TOOL_VAC308)/bin
47 PATH_TOOL_VAC308_LIB ?= $(PATH_TOOL_VAC308)/lib
48 PATH_TOOL_VAC308_INC ?= $(PATH_TOOL_VAC308)/include
49
50 TOOL_VAC308_CC ?= $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
51 TOOL_VAC308_CXX ?= $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
52 TOOL_VAC308_AR ?= $(PATH_TOOL_VAC308_BIN)/ilib$(HOSTSUFF_EXE)
53 TOOL_VAC308_LD ?= $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
54 TOOL_VAC308_RC ?= $(PATH_TOOL_VAC308_BIN)/rc$(HOSTSUFF_EXE)
55
56else
57 # Pathless, relies on the environment.
58 TOOL_VAC308_CC ?= icc$(HOSTSUFF_EXE)
59 TOOL_VAC308_CXX ?= icc$(HOSTSUFF_EXE)
60 TOOL_VAC308_AR ?= ilib$(HOSTSUFF_EXE)
61 TOOL_VAC308_LD ?= icc$(HOSTSUFF_EXE)
62 TOOL_VAC308_RC ?= rc$(HOSTSUFF_EXE)
63
64endif
65
66# More tool specific properties.
67# Note: implib isn't really a part of VAC308.
68TOOL_VAC308_IMP ?= implib$(HOSTSUFF_EXE)
69TOOL_VAC308_IMPFLAGS ?= /nologo /noignorecase
70
71# General Properties used by kBuild
72TOOL_VAC308_COBJSUFF ?= .obj
73TOOL_VAC308_CFLAGS ?= -Q+
74TOOL_VAC308_CFLAGS.debug ?= -Ti+
75TOOL_VAC308_CFLAGS.release ?= -O
76TOOL_VAC308_CINCS ?=
77TOOL_VAC308_CDEFS ?=
78
79TOOL_VAC308_CXXOBJSUFF ?= .obj
80TOOL_VAC308_CXXFLAGS ?= -Q+
81TOOL_VAC308_CXXFLAGS.debug ?= -Ti
82TOOL_VAC308_CXXFLAGS.release ?= -O
83TOOL_VAC308_CXXINCS ?=
84TOOL_VAC308_CXXDEFS ?=
85
86TOOL_VAC308_RCOBJSUFF ?= .res
87TOOL_VAC308_RCFLAGS ?= -n
88TOOL_VAC308_RCINCS ?=
89TOOL_VAC308_RCDEFS ?=
90
91TOOL_VAC308_ARFLAGS ?= /nologo /noignorecase
92TOOL_VAC308_ARLIBSUFF ?= .lib
93
94TOOL_VAC308_LDFLAGS ?= -Q+
95TOOL_VAC308_LDFLAGS.debug ?= -Ti+
96
97
98
99## Compile C source.
100# @param $(target) Normalized main target name.
101# @param $(source) Source filename (relative).
102# @param $(obj) Object file name. This shall be (re)created by the compilation.
103# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
104# @param $(flags) Flags.
105# @param $(defs) Definitions. No -D or something.
106# @param $(incs) Includes. No -I or something.
107# @param $(dirdep) Directory creation dependency.
108# @param $(deps) Other dependencies.
109#
110# @param $(outbase) Output basename (full). Use this for list files and such.
111# @param $(objsuff) Object suffix.
112TOOL_VAC308_COMPILE_C_DEPEND =
113TOOL_VAC308_COMPILE_C_DEPORD =
114TOOL_VAC308_COMPILE_C_OUTPUT =
115define TOOL_VAC308_COMPILE_C_CMDS
116 $(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CC) -c\
117 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
118 -Fo$(obj)\
119 $(abspath $(source))
120 $(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CC) -P+ -Pd+ \
121 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
122 $(abspath $(source)) \
123 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
124endef
125
126
127## Compile C++ source.
128# @param $(target) Normalized main target name.
129# @param $(source) Source filename (relative).
130# @param $(obj) Object file name. This shall be (re)created by the compilation.
131# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
132# @param $(flags) Flags.
133# @param $(defs) Definitions. No -D or something.
134# @param $(incs) Includes. No -I or something.
135# @param $(dirdep) Directory creation dependency.
136# @param $(deps) Other dependencies.
137#
138# @param $(outbase) Output basename (full). Use this for list files and such.
139# @param $(objsuff) Object suffix.
140TOOL_VAC308_COMPILE_CXX_DEPEND =
141TOOL_VAC308_COMPILE_CXX_DEPORD =
142TOOL_VAC308_COMPILE_CXX_OUTPUT =
143define TOOL_VAC308_COMPILE_CXX_CMDS
144 $(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CXX) -c\
145 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
146 -Fo$(obj)\
147 $(abspath $(source))
148 $(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CXX) -P+ -Pd+ \
149 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
150 $(abspath $(source)) \
151 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
152endef
153
154
155## Compile resource 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.
168TOOL_VAC308_COMPILE_RC_OUTPUT =
169TOOL_VAC308_COMPILE_RC_DEPEND =
170TOOL_VAC308_COMPILE_RC_DEPORD =
171define TOOL_VAC308_COMPILE_RC_CMDS
172 $(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_RC) -r\
173 $(flags) $(addprefix -i, $(subst /,\\,$(incs))) $(addprefix -D, $(defs))\
174 $(subst /,\\,$(abspath $(source))) \
175 $(obj)
176endef
177
178
179## Link library
180# @param $(target) Normalized main target name.
181# @param $(out) Library name.
182# @param $(objs) Object files to put in the library.
183# @param $(flags) Flags.
184# @param $(dirdep) Directory creation dependency.
185# @param $(deps) Other dependencies.
186# @param $(othersrc) Unhandled sources.
187#
188# @param $(outbase) Output basename (full). Use this for list files and such.
189TOOL_VAC308_LINK_LIBRARY_OUTPUT = $(outbase).rsp
190TOOL_VAC308_LINK_LIBRARY_DEPEND = $(othersrc)
191TOOL_VAC308_LINK_LIBRARY_DEPORD =
192define TOOL_VAC308_LINK_LIBRARY_CMDS
193 $(if $(strip $(othersrc)),\
194 $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
195 $(TOOL_VAC308_IMP) $(TOOL_VAC308_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
196 $(if $(strip $(objs)),$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
197 $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
198 $(TOOL_VAC308_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
199endef
200
201
202## Link program
203# @param $(target) Normalized main target name.
204# @param $(out) Program name.
205# @param $(objs) Object files to link together.
206# @param $(libs) Libraries to search.
207# @param $(libpath) Library search paths.
208# @param $(flags) Flags.
209# @param $(dirdep) Directory creation dependency.
210# @param $(deps) Other dependencies.
211# @param $(othersrc) Unhandled sources.
212# @param $(custom_pre) Custom step invoked before linking.
213# @param $(custom_post) Custom step invoked after linking.
214#
215# @param $(outbase) Output basename (full). Use this for list files and such.
216TOOL_VAC308_LINK_PROGRAM_OUTPUT = $(outbase).map
217TOOL_VAC308_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
218TOOL_VAC308_LINK_PROGRAM_DEPORD =
219define TOOL_VAC308_LINK_PROGRAM_CMDS
220 $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
221 $(if $(strip $(libpath)),LIB="$(subst ; ,;,$(foreach lp,$(libpath),$(lp);))$(LIB)") \
222 $(TOOL_VAC308_LD) $(flags) -Fe$(out) -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
223 $(if $(filter %.res,$(objs)), $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
224 $(TOOL_VAC308_RC) $(filter %.res,$(objs)) $(out))
225endef
226
227
228## Link DLL
229# @param $(target) Normalized main target name.
230# @param $(out) Program name.
231# @param $(objs) Object files to link together.
232# @param $(libs) Libraries to search.
233# @param $(libpath) Library search paths.
234# @param $(flags) Flags.
235# @param $(dirdep) Directory creation dependency.
236# @param $(deps) Other dependencies.
237# @param $(othersrc) Unhandled sources.
238# @param $(custom_pre) Custom step invoked before linking.
239# @param $(custom_post) Custom step invoked after linking.
240#
241# @param $(outbase) Output basename (full). Use this for list files and such.
242TOOL_VAC308_LINK_DLL_OUTPUT = $(outbase).map
243TOOL_VAC308_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
244TOOL_VAC308_LINK_DLL_DEPORD =
245define TOOL_VAC308_LINK_DLL_CMDS
246 $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
247 $(if $(strip $(libpath)),LIB="$(subst ; ,;,$(foreach lp,$(libpath),$(lp);))$(LIB)") \
248 $(TOOL_VAC308_LD) /B"/DLL" $(flags) -Fe$(out) -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
249 $(if $(filter %.res,$(objs)), $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
250 $(TOOL_VAC308_RC) $(filter %.res,$(objs)) $(out))
251endef
252
253
254## Link system module (windows aka driver, linux aka kernel module)
255# @param $(target) Normalized main target name.
256# @param $(out) System module name.
257# @param $(objs) Object files to link together.
258# @param $(libs) Libraries to search.
259# @param $(libpath) Library search paths.
260# @param $(flags) Flags.
261# @param $(dirdep) Directory creation dependency.
262# @param $(deps) Other dependencies.
263# @param $(othersrc) Unhandled sources.
264# @param $(custom_pre) Custom step invoked before linking.
265# @param $(custom_post) Custom step invoked after linking.
266#
267# @param $(outbase) Output basename (full). Use this for list files and such.
268TOOL_VAC308_LINK_SYSMOD_OUTPUT = $(outbase).map
269TOOL_VAC308_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
270TOOL_VAC308_LINK_SYSMOD_DEPORD =
271define TOOL_VAC308_LINK_SYSMOD_CMDS
272 $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
273 $(if $(strip $(libpath)),LIB="$(subst ; ,;,$(foreach lp,$(libpath),$(lp);))$(LIB)") \
274 $(TOOL_VAC308_LD) $(flags) -Fe$(out) -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
275 $(if $(filter %.res,$(objs)), $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
276 $(TOOL_VAC308_RC) $(filter %.res,$(objs)) $(out))
277endef
278
Note: See TracBrowser for help on using the repository browser.