source: trunk/kBuild/tools/WATCOMC11C.kmk@ 2065

Last change on this file since 2065 was 2065, checked in by bird, 17 years ago

VAC308 hacking, Watcom C v11.0c, MASM v5.10 and MS Link v5.10 (OS/2 related).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 KB
Line 
1# $Id: WATCOMC11C.kmk 2065 2008-11-17 00:47:59Z bird $
2## @file
3# kBuild Tool Config - Watcom C v11.0c
4#
5
6#
7# Copyright (c) 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
34TOOL_WATCOMC11C = Watcom C/C++ v11.0c (generic)
35
36ifeq ($(PATH_TOOL_WATCOMC11C),)
37 ifeq ($(PATH_TOOL_WATCOMC11C),)
38 PATH_TOOL_WATCOMC11C := $(wildcard $(PATH_DEVTOOLS_BLD)/watcom/v11.0c*)
39 endif
40 ifeq ($(PATH_TOOL_WATCOMC11C),)
41 PATH_TOOL_WATCOMC11C := $(wildcard $(PATH_DEVTOOLS_TRG)/watcom/v11.0c*)
42 endif
43 if1of ($(USER) $(USERNAME) $(LOGNAME), bird)
44 PATH_TOOL_WATCOMC11C := $(wildcard d:/dev/Watcom/v11.0c*)
45 endif
46 PATH_TOOL_WATCOMC11C := $(firstword $(sort $(PATH_TOOL_WATCOMC11C)))
47 # if not found, we'll enter 'pathless' mode.
48else
49 # Resolve any fancy stuff once and for all.
50 PATH_TOOL_WATCOMC11C := $(PATH_TOOL_WATCOMC11C)
51endif
52
53ifneq ($(PATH_TOOL_WATCOMC11C),)
54 TOOL_WATCOMC11C_PATHLESS := no
55
56 ifeq ($(KBUILD_HOST),os2)
57 PATH_TOOL_WATCOMC11C_BIN = $(PATH_TOOL_WATCOMC11C)/binp
58 PATH_TOOL_WATCOMC11C_BIN2 = $(PATH_TOOL_WATCOMC11C)/binw
59 TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
60 -E 'BEGINLIBPATH=$(PATH_TOOL_WATCOMC11C)/binp/dll;$(BEGINLIBPATH)' \
61 -E 'PATH=$(PATH_TOOL_WATCOMC11C_BIN);$(PATH_TOOL_WATCOMC11C_BIN2)' \
62 -E 'WATCOM=$(PATH_TOOL_WATCOMC11C)' \
63 -E 'LIB=$1' \
64 -E 'INCLUDE=' \
65 --
66 else
67 PATH_TOOL_WATCOMC11C_BIN = $(PATH_TOOL_WATCOMC11C)/binnt
68 PATH_TOOL_WATCOMC11C_BIN2 = $(PATH_TOOL_WATCOMC11C_BIN)
69 TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
70 -E 'PATH=$(PATH_TOOL_WATCOMC11C_BIN)' \
71 -E 'WATCOM=$(PATH_TOOL_WATCOMC11C)' \
72 -E 'LIB=$1' \
73 -E 'INCLUDE=' \
74 --
75 endif
76
77 TOOL_WATCOMC11C_CC ?= $(PATH_TOOL_WATCOMC11C_BIN)/wcc386$(HOSTSUFF_EXE)
78 TOOL_WATCOMC11C_CC16 ?= $(PATH_TOOL_WATCOMC11C_BIN)/wcc$(HOSTSUFF_EXE)
79 TOOL_WATCOMC11C_CXX ?= $(PATH_TOOL_WATCOMC11C_BIN)/wpp386$(HOSTSUFF_EXE)
80 TOOL_WATCOMC11C_CXX16 ?= $(PATH_TOOL_WATCOMC11C_BIN)/wpp$(HOSTSUFF_EXE)
81 TOOL_WATCOMC11C_AS ?= $(PATH_TOOL_WATCOMC11C_BIN)/wasm$(HOSTSUFF_EXE) TOOL_WATCOMC11C_AR ?= $(PATH_TOOL_WATCOMC11C_BIN)/wlib$(HOSTSUFF_EXE)
82 TOOL_WATCOMC11C_LD ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl386$(HOSTSUFF_EXE)
83 TOOL_WATCOMC11C_LD16 ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl$(HOSTSUFF_EXE)
84 TOOL_WATCOMC11C_RC ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wrc$(HOSTSUFF_EXE)
85
86else
87 # Pathless, relies on the environment.
88 TOOL_WATCOMC11C_PATHLESS :=
89 TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
90 -E 'LIB=$1' \
91 -E 'INCLUDE=' \
92 --
93 TOOL_WATCOMC11C_CC ?= wcc386$(HOSTSUFF_EXE)
94 TOOL_WATCOMC11C_CC16 ?= wcc$(HOSTSUFF_EXE)
95 TOOL_WATCOMC11C_CXX ?= wpp386$(HOSTSUFF_EXE)
96 TOOL_WATCOMC11C_CXX16 ?= wpp$(HOSTSUFF_EXE)
97 TOOL_WATCOMC11C_AS ?= wasm$(HOSTSUFF_EXE)
98 TOOL_WATCOMC11C_AR ?= wlib$(HOSTSUFF_EXE)
99 TOOL_WATCOMC11C_LD ?= wcl386$(HOSTSUFF_EXE)
100 TOOL_WATCOMC11C_LD16 ?= wcl$(HOSTSUFF_EXE)
101 TOOL_WATCOMC11C_RC ?= wrc$(HOSTSUFF_EXE)
102
103endif
104
105# General Properties used by kBuild
106TOOL_WATCOMC11C_COBJSUFF ?= .obj
107TOOL_WATCOMC11C_CFLAGS ?= -zq
108TOOL_WATCOMC11C_CFLAGS.os2 ?= -bt=os2
109TOOL_WATCOMC11C_CFLAGS.win ?= -bt=nt
110TOOL_WATCOMC11C_CFLAGS.debug ?=
111TOOL_WATCOMC11C_CFLAGS.release ?=
112TOOL_WATCOMC11C_CINCS ?= $(PATH_TOOL_WATCOMC11C)/h
113TOOL_WATCOMC11C_CDEFS ?=
114
115TOOL_WATCOMC11C_CXXOBJSUFF ?= .obj
116TOOL_WATCOMC11C_CXXFLAGS ?= -zq
117TOOL_WATCOMC11C_CXXFLAGS.os2 ?= -bt=os2
118TOOL_WATCOMC11C_CXXFLAGS.win ?= -bt=nt
119TOOL_WATCOMC11C_CXXFLAGS.debug ?=
120TOOL_WATCOMC11C_CXXFLAGS.release ?=
121TOOL_WATCOMC11C_CXXINCS ?= $(PATH_TOOL_WATCOMC11C)/h
122TOOL_WATCOMC11C_CXXDEFS ?=
123
124TOOL_WATCOMC11C_RCOBJSUFF ?= .res
125TOOL_WATCOMC11C_RCFLAGS ?= -r
126TOOL_WATCOMC11C_RCINCS ?= $(PATH_TOOL_WATCOMC11C)/h
127TOOL_WATCOMC11C_RCDEFS ?=
128
129TOOL_WATCOMC11C_ARFLAGS ?=
130TOOL_WATCOMC11C_ARLIBSUFF ?= .lib
131
132TOOL_WATCOMC11C_LDFLAGS ?= -zq -y
133TOOL_WATCOMC11C_LDFLAGS.os2 ?= -bt=os2
134TOOL_WATCOMC11C_LDFLAGS.win ?= -bt=nt
135TOOL_WATCOMC11C_LDFLAGS.debug ?=
136
137
138TOOL_WATCOMC11C_COMPILE_C_DEPEND =
139TOOL_WATCOMC11C_COMPILE_C_DEPORD =
140TOOL_WATCOMC11C_COMPILE_C_OUTPUT = $(obj).err
141define TOOL_WATCOMC11C_COMPILE_C_CMDS
142 $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CC) \
143 $(flags) \
144 $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
145 $(addprefix -d, $(defs)) \
146 -fo=$(subst /,\\,$(obj)) \
147 -fr=$(subst /,\\,$(obj)).err \
148 $(subst /,\\,$(abspath $(source)))
149 $(QUIET)$(APPEND) -n $(obj).err
150## @todo dependencies
151endef
152
153TOOL_WATCOMC11C_COMPILE_CXX_DEPEND =
154TOOL_WATCOMC11C_COMPILE_CXX_DEPORD =
155TOOL_WATCOMC11C_COMPILE_CXX_OUTPUT = $(obj).err
156define TOOL_WATCOMC11C_COMPILE_CXX_CMDS
157 $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CXX) \
158 $(flags) \
159 $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
160 $(addprefix -d, $(defs)) \
161 -fo=$(subst /,\\,$(obj)) \
162 -fr=$(subst /,\\,$(obj)).err \
163 $(subst /,\\,$(abspath $(source)))
164 $(QUIET)$(APPEND) -n $(obj).err
165## @todo dependencies
166endef
167
168TOOL_WATCOMC11C_COMPILE_RC_OUTPUT =
169TOOL_WATCOMC11C_COMPILE_RC_DEPEND =
170TOOL_WATCOMC11C_COMPILE_RC_DEPORD =
171define TOOL_WATCOMC11C_COMPILE_RC_CMDS
172 $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) \
173 $(TOOL_WATCOMC11C_RC) -r\
174 $(flags) \
175 $(addprefix -i=, $(subst /,\\,$(incs))) \
176 $(addprefix -d, $(defs))\
177 -fo=$(subst /,\\,obj) \
178 $(subst /,\\,$(abspath $(source)))
179endef
180
181TOOL_WATCOMC11C_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
182TOOL_WATCOMC11C_LINK_LIBRARY_DEPEND = $(othersrc)
183TOOL_WATCOMC11C_LINK_LIBRARY_DEPORD =
184define TOOL_WATCOMC11C_LINK_LIBRARY_CMDS
185 $(if $(strip $(othersrc)),\
186 $(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
187 $(TOOL_WATCOMC11C_IMP) $(TOOL_WATCOMC11C_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
188 $(if $(strip $(objs)),$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
189 $(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
190 $(TOOL_WATCOMC11C_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
191endef
192
193TOOL_WATCOMC11C_LINK_PROGRAM_OUTPUT = $(outbase).map
194TOOL_WATCOMC11C_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
195TOOL_WATCOMC11C_LINK_PROGRAM_DEPORD =
196define TOOL_WATCOMC11C_LINK_PROGRAM_CMDS
197 $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
198 $(TOOL_WATCOMC11C_LD) \
199 $(flags) \
200 -fe=$(subst /,\\,$(out)) \
201 -fm=$(subst /,\\,$(outbase).map) \
202 $(subst /,\\,$(filter-out %.res,$(objs))) \
203 $(subst /,\\,$(libs)) \
204 $(subst /,\\,$(othersrc))
205 $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
206 $(TOOL_WATCOMC11C_RC) \
207 $(filter -bt=%,$(flags)) \
208 /fe=$(subst /,\\,$(out)) \
209 $(subst /,\\,$(filter %.res,$(objs))))
210endef
211
212TOOL_WATCOMC11C_LINK_DLL_OUTPUT = $(outbase).map
213TOOL_WATCOMC11C_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
214TOOL_WATCOMC11C_LINK_DLL_DEPORD =
215define TOOL_WATCOMC11C_LINK_DLL_CMDS
216 $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
217 $(TOOL_WATCOMC11C_LD) \
218 $(flags) \
219 -fe=$(subst /,\\,$(out)) \
220 -fm=$(subst /,\\,$(outbase).map) \
221 $(subst /,\\,$(filter-out %.res,$(objs))) \
222 $(subst /,\\,$(libs)) \
223 $(subst /,\\,$(othersrc))
224 $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
225 $(TOOL_WATCOMC11C_RC) \
226 $(filter -bt=%,$(flags)) \
227 /fe=$(subst /,\\,$(out)) \
228 $(subst /,\\,$(filter %.res,$(objs))))
229endef
230
231TOOL_WATCOMC11C_LINK_SYSMOD_OUTPUT = $(outbase).map
232TOOL_WATCOMC11C_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
233TOOL_WATCOMC11C_LINK_SYSMOD_DEPORD =
234define TOOL_WATCOMC11C_LINK_SYSMOD_CMDS
235 $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
236 $(TOOL_WATCOMC11C_LD) \
237 $(flags) \
238 -fe=$(subst /,\\,$(out)) \
239 -fm=$(subst /,\\,$(outbase).map) \
240 $(subst /,\\,$(filter-out %.res,$(objs))) \
241 $(subst /,\\,$(libs)) \
242 $(subst /,\\,$(othersrc))
243 $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
244 $(TOOL_WATCOMC11C_RC) \
245 $(filter -bt=%,$(flags)) \
246 /fe=$(subst /,\\,$(out)) \
247 $(subst /,\\,$(filter %.res,$(objs))))
248endef
249
250
Note: See TracBrowser for help on using the repository browser.