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

Last change on this file since 2743 was 2731, checked in by bird, 11 years ago

wcl and wcl386 doodoos in the current directory which causes trouble for parallel execution of them.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.3 KB
Line 
1# $Id: WATCOMC11C.kmk 2731 2014-06-28 14:58:12Z bird $
2## @file
3# kBuild Tool Config - Watcom C v11.0c
4#
5
6#
7# Copyright (c) 2008-2014 knut st. osmundsen <bird-kBuild-spam-xiv@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 $(KBUILD_DEVTOOLS_BLD)/watcom/v11.0c*)
39 endif
40 ifeq ($(PATH_TOOL_WATCOMC11C),)
41 PATH_TOOL_WATCOMC11C := $(wildcard $(KBUILD_DEVTOOLS_TRG)/watcom/v11.0c*)
42 endif
43 ifeq ($(PATH_TOOL_WATCOMC11C),)
44 PATH_TOOL_WATCOMC11C := $(wildcard $(KBUILD_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 'EDPATH=$(PATH_TOOL_WATCOMC11C)/EDDAT' \
70 -E 'LIB=$1' \
71 -E 'INCLUDE=' \
72 $2 --
73 else
74 PATH_TOOL_WATCOMC11C_BIN = $(PATH_TOOL_WATCOMC11C)/binnt
75 PATH_TOOL_WATCOMC11C_BIN2 = $(PATH_TOOL_WATCOMC11C_BIN)
76 TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
77 -E 'PATH=$(PATH_TOOL_WATCOMC11C_BIN);$(PATH_TOOL_WATCOMC11C)/binw' \
78 -E 'WATCOM=$(PATH_TOOL_WATCOMC11C)' \
79 -E 'EDPATH=$(PATH_TOOL_WATCOMC11C)/EDDAT' \
80 -E 'LIB=$1' \
81 -E 'INCLUDE=' \
82 $2 --
83 endif
84
85 TOOL_WATCOMC11C_CC ?= $(PATH_TOOL_WATCOMC11C_BIN)/wcc386$(HOSTSUFF_EXE)
86 TOOL_WATCOMC11C_CC16 ?= $(PATH_TOOL_WATCOMC11C_BIN)/wcc$(HOSTSUFF_EXE)
87 TOOL_WATCOMC11C_CXX ?= $(PATH_TOOL_WATCOMC11C_BIN)/wpp386$(HOSTSUFF_EXE)
88 TOOL_WATCOMC11C_CXX16 ?= $(PATH_TOOL_WATCOMC11C_BIN)/wpp$(HOSTSUFF_EXE)
89 TOOL_WATCOMC11C_AS ?= $(PATH_TOOL_WATCOMC11C_BIN)/wasm$(HOSTSUFF_EXE)
90 TOOL_WATCOMC11C_AR ?= $(PATH_TOOL_WATCOMC11C_BIN)/wlib$(HOSTSUFF_EXE)
91 TOOL_WATCOMC11C_RC ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wrc$(HOSTSUFF_EXE)
92 TOOL_WATCOMC11C_LD ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl386$(HOSTSUFF_EXE)
93 TOOL_WATCOMC11C_LD16 ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl$(HOSTSUFF_EXE)
94 TOOL_WATCOMC11C_WLINK ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wlink$(HOSTSUFF_EXE)
95
96else
97 # Pathless, relies on the environment.
98 TOOL_WATCOMC11C_PATHLESS :=
99 TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
100 -E 'LIB=$1' \
101 -E 'INCLUDE=' \
102 $2 --
103 TOOL_WATCOMC11C_CC ?= wcc386$(HOSTSUFF_EXE)
104 TOOL_WATCOMC11C_CC16 ?= wcc$(HOSTSUFF_EXE)
105 TOOL_WATCOMC11C_CXX ?= wpp386$(HOSTSUFF_EXE)
106 TOOL_WATCOMC11C_CXX16 ?= wpp$(HOSTSUFF_EXE)
107 TOOL_WATCOMC11C_AS ?= wasm$(HOSTSUFF_EXE)
108 TOOL_WATCOMC11C_AR ?= wlib$(HOSTSUFF_EXE)
109 TOOL_WATCOMC11C_RC ?= wrc$(HOSTSUFF_EXE)
110 TOOL_WATCOMC11C_LD ?= wcl386$(HOSTSUFF_EXE)
111 TOOL_WATCOMC11C_LD16 ?= wcl$(HOSTSUFF_EXE)
112 TOOL_WATCOMC11C_WLINK ?= wcl$(HOSTSUFF_EXE)
113
114endif
115
116# General Properties used by kBuild
117TOOL_WATCOMC11C_COBJSUFF ?= .obj
118TOOL_WATCOMC11C_CFLAGS ?= -zq
119TOOL_WATCOMC11C_CFLAGS.dos ?= -bt=dos
120TOOL_WATCOMC11C_CFLAGS.os2 ?= -bt=os2
121TOOL_WATCOMC11C_CFLAGS.win ?= -bt=nt
122ifdef PATH_TOOL_WATCOMC11C
123 TOOL_WATCOMC11C_CINCS ?= $(PATH_TOOL_WATCOMC11C)/h
124endif
125
126TOOL_WATCOMC11C_CXXOBJSUFF ?= .obj
127TOOL_WATCOMC11C_CXXFLAGS ?= -zq
128TOOL_WATCOMC11C_CXXFLAGS.dos ?= -bt=dos
129TOOL_WATCOMC11C_CXXFLAGS.os2 ?= -bt=os2
130TOOL_WATCOMC11C_CXXFLAGS.win ?= -bt=nt
131ifdef PATH_TOOL_WATCOMC11C
132 TOOL_WATCOMC11C_CXXINCS ?= $(PATH_TOOL_WATCOMC11C)/h
133endif
134
135TOOL_WATCOMC11C_RCOBJSUFF ?= .res
136TOOL_WATCOMC11C_RCFLAGS ?= -r
137ifdef PATH_TOOL_WATCOMC11C
138 TOOL_WATCOMC11C_RCINCS ?= $(PATH_TOOL_WATCOMC11C)/h
139endif
140
141TOOL_WATCOMC11C_ARFLAGS ?= -q
142TOOL_WATCOMC11C_ARLIBSUFF ?= .lib
143
144TOOL_WATCOMC11C_LDFLAGS ?= -zq -y
145TOOL_WATCOMC11C_LDFLAGS.dos ?= -bt=dos
146TOOL_WATCOMC11C_LDFLAGS.os2 ?= -bt=os2
147TOOL_WATCOMC11C_LDFLAGS.win ?= -bt=nt
148
149
150TOOL_WATCOMC11C_COMPILE_C_DEPEND =
151TOOL_WATCOMC11C_COMPILE_C_DEPORD =
152TOOL_WATCOMC11C_COMPILE_C_OUTPUT = $(obj).err
153define TOOL_WATCOMC11C_COMPILE_C_CMDS
154 $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CC) \
155 $(flags) \
156 $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
157 $(addprefix -d, $(defs)) \
158 -fo=$(subst /,\\,$(obj)) \
159 -fr=$(subst /,\\,$(obj)).err \
160 $(subst /,\\,$(abspath $(source)))
161 $(QUIET)$(APPEND) -n $(obj).err
162## @todo dependencies
163endef
164
165TOOL_WATCOMC11C_COMPILE_CXX_DEPEND =
166TOOL_WATCOMC11C_COMPILE_CXX_DEPORD =
167TOOL_WATCOMC11C_COMPILE_CXX_OUTPUT = $(obj).err
168define TOOL_WATCOMC11C_COMPILE_CXX_CMDS
169 $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CXX) \
170 $(flags) \
171 $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
172 $(addprefix -d, $(defs)) \
173 -fo=$(subst /,\\,$(obj)) \
174 -fr=$(subst /,\\,$(obj)).err \
175 $(subst /,\\,$(abspath $(source)))
176 $(QUIET)$(APPEND) -n $(obj).err
177## @todo dependencies
178endef
179
180TOOL_WATCOMC11C_COMPILE_RC_OUTPUT =
181TOOL_WATCOMC11C_COMPILE_RC_DEPEND =
182TOOL_WATCOMC11C_COMPILE_RC_DEPORD =
183define TOOL_WATCOMC11C_COMPILE_RC_CMDS
184 $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) \
185 $(TOOL_WATCOMC11C_RC) -r\
186 $(flags) \
187 $(addprefix -i=, $(subst /,\\,$(incs))) \
188 $(addprefix -d, $(defs))\
189 -fo=$(subst /,\\,$(obj)) \
190 $(subst /,\\,$(abspath $(source)))
191endef
192
193TOOL_WATCOMC11C_LINK_LIBRARY_OUTPUT = $(outbase).rsp
194TOOL_WATCOMC11C_LINK_LIBRARY_DEPEND = $(othersrc)
195TOOL_WATCOMC11C_LINK_LIBRARY_DEPORD =
196define TOOL_WATCOMC11C_LINK_LIBRARY_CMDS
197 $(QUIET)$(APPEND) -tn $(outbase).rsp $(foreach obj,$(subst /,\,$(objs) $(othersrc)),'+"$(obj)"')
198 $(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_AR) $(flags) $(subst /,\\,$(out)) @$(outbase).rsp
199endef
200
201TOOL_WATCOMC11C_LINK_PROGRAM_OUTPUT = $(outbase).map
202TOOL_WATCOMC11C_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
203TOOL_WATCOMC11C_LINK_PROGRAM_DEPORD =
204define TOOL_WATCOMC11C_LINK_PROGRAM_CMDS
205 $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath))),-C $(dir $(out))) \
206 $(TOOL_WATCOMC11C_LD) \
207 $(flags) \
208 -fe=$(subst /,\\,$(out)) \
209 -fm=$(subst /,\\,$(outbase).map) \
210 $(subst /,\\,$(filter-out %.res,$(objs))) \
211 $(subst /,\\,$(libs)) \
212 $(subst /,\\,$(othersrc))
213 $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
214 $(TOOL_WATCOMC11C_RC) \
215 $(filter -bt=%,$(flags)) \
216 /fe=$(subst /,\\,$(out)) \
217 $(subst /,\\,$(filter %.res,$(objs))))
218endef
219
220TOOL_WATCOMC11C_LINK_DLL_OUTPUT = $(outbase).map
221TOOL_WATCOMC11C_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
222TOOL_WATCOMC11C_LINK_DLL_DEPORD =
223define TOOL_WATCOMC11C_LINK_DLL_CMDS
224 $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath))),-C $(dir $(out))) \
225 $(TOOL_WATCOMC11C_LD) \
226 $(flags) \
227 -fe=$(subst /,\\,$(out)) \
228 -fm=$(subst /,\\,$(outbase).map) \
229 $(subst /,\\,$(filter-out %.res,$(objs))) \
230 $(subst /,\\,$(libs)) \
231 $(subst /,\\,$(othersrc))
232 $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
233 $(TOOL_WATCOMC11C_RC) \
234 $(filter -bt=%,$(flags)) \
235 /fe=$(subst /,\\,$(out)) \
236 $(subst /,\\,$(filter %.res,$(objs))))
237endef
238
239TOOL_WATCOMC11C_LINK_SYSMOD_OUTPUT = $(outbase).map
240TOOL_WATCOMC11C_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
241TOOL_WATCOMC11C_LINK_SYSMOD_DEPORD =
242define TOOL_WATCOMC11C_LINK_SYSMOD_CMDS
243 $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath))),-C $(dir $(out))) \
244 $(TOOL_WATCOMC11C_LD) \
245 $(flags) \
246 -fe=$(subst /,\\,$(out)) \
247 -fm=$(subst /,\\,$(outbase).map) \
248 $(subst /,\\,$(filter-out %.res,$(objs))) \
249 $(subst /,\\,$(libs)) \
250 $(subst /,\\,$(othersrc))
251 $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
252 $(TOOL_WATCOMC11C_RC) \
253 $(filter -bt=%,$(flags)) \
254 /fe=$(subst /,\\,$(out)) \
255 $(subst /,\\,$(filter %.res,$(objs))))
256endef
257
258
Note: See TracBrowser for help on using the repository browser.