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

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

watcom and open watcom location fixes.

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