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

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

new watcom and open watcom location.

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