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

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

Shut up the watcom librarian and use strict libpath so it's possible to use different watcom versions simulatiously.

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