1 | # $Id: WATCOMC11C.kmk 2066 2008-11-17 00:53:11Z 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 |
|
---|
34 | TOOL_WATCOMC11C = Watcom C/C++ v11.0c (generic)
|
---|
35 |
|
---|
36 | ifeq ($(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.
|
---|
48 | else
|
---|
49 | # Resolve any fancy stuff once and for all.
|
---|
50 | PATH_TOOL_WATCOMC11C := $(PATH_TOOL_WATCOMC11C)
|
---|
51 | endif
|
---|
52 |
|
---|
53 | ifneq ($(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)
|
---|
82 | TOOL_WATCOMC11C_AR ?= $(PATH_TOOL_WATCOMC11C_BIN)/wlib$(HOSTSUFF_EXE)
|
---|
83 | TOOL_WATCOMC11C_LD ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl386$(HOSTSUFF_EXE)
|
---|
84 | TOOL_WATCOMC11C_LD16 ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl$(HOSTSUFF_EXE)
|
---|
85 | TOOL_WATCOMC11C_RC ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wrc$(HOSTSUFF_EXE)
|
---|
86 |
|
---|
87 | else
|
---|
88 | # Pathless, relies on the environment.
|
---|
89 | TOOL_WATCOMC11C_PATHLESS :=
|
---|
90 | TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
|
---|
91 | -E 'LIB=$1' \
|
---|
92 | -E 'INCLUDE=' \
|
---|
93 | --
|
---|
94 | TOOL_WATCOMC11C_CC ?= wcc386$(HOSTSUFF_EXE)
|
---|
95 | TOOL_WATCOMC11C_CC16 ?= wcc$(HOSTSUFF_EXE)
|
---|
96 | TOOL_WATCOMC11C_CXX ?= wpp386$(HOSTSUFF_EXE)
|
---|
97 | TOOL_WATCOMC11C_CXX16 ?= wpp$(HOSTSUFF_EXE)
|
---|
98 | TOOL_WATCOMC11C_AS ?= wasm$(HOSTSUFF_EXE)
|
---|
99 | TOOL_WATCOMC11C_AR ?= wlib$(HOSTSUFF_EXE)
|
---|
100 | TOOL_WATCOMC11C_LD ?= wcl386$(HOSTSUFF_EXE)
|
---|
101 | TOOL_WATCOMC11C_LD16 ?= wcl$(HOSTSUFF_EXE)
|
---|
102 | TOOL_WATCOMC11C_RC ?= wrc$(HOSTSUFF_EXE)
|
---|
103 |
|
---|
104 | endif
|
---|
105 |
|
---|
106 | # General Properties used by kBuild
|
---|
107 | TOOL_WATCOMC11C_COBJSUFF ?= .obj
|
---|
108 | TOOL_WATCOMC11C_CFLAGS ?= -zq
|
---|
109 | TOOL_WATCOMC11C_CFLAGS.os2 ?= -bt=os2
|
---|
110 | TOOL_WATCOMC11C_CFLAGS.win ?= -bt=nt
|
---|
111 | TOOL_WATCOMC11C_CFLAGS.debug ?=
|
---|
112 | TOOL_WATCOMC11C_CFLAGS.release ?=
|
---|
113 | TOOL_WATCOMC11C_CINCS ?= $(PATH_TOOL_WATCOMC11C)/h
|
---|
114 | TOOL_WATCOMC11C_CDEFS ?=
|
---|
115 |
|
---|
116 | TOOL_WATCOMC11C_CXXOBJSUFF ?= .obj
|
---|
117 | TOOL_WATCOMC11C_CXXFLAGS ?= -zq
|
---|
118 | TOOL_WATCOMC11C_CXXFLAGS.os2 ?= -bt=os2
|
---|
119 | TOOL_WATCOMC11C_CXXFLAGS.win ?= -bt=nt
|
---|
120 | TOOL_WATCOMC11C_CXXFLAGS.debug ?=
|
---|
121 | TOOL_WATCOMC11C_CXXFLAGS.release ?=
|
---|
122 | TOOL_WATCOMC11C_CXXINCS ?= $(PATH_TOOL_WATCOMC11C)/h
|
---|
123 | TOOL_WATCOMC11C_CXXDEFS ?=
|
---|
124 |
|
---|
125 | TOOL_WATCOMC11C_RCOBJSUFF ?= .res
|
---|
126 | TOOL_WATCOMC11C_RCFLAGS ?= -r
|
---|
127 | TOOL_WATCOMC11C_RCINCS ?= $(PATH_TOOL_WATCOMC11C)/h
|
---|
128 | TOOL_WATCOMC11C_RCDEFS ?=
|
---|
129 |
|
---|
130 | TOOL_WATCOMC11C_ARFLAGS ?=
|
---|
131 | TOOL_WATCOMC11C_ARLIBSUFF ?= .lib
|
---|
132 |
|
---|
133 | TOOL_WATCOMC11C_LDFLAGS ?= -zq -y
|
---|
134 | TOOL_WATCOMC11C_LDFLAGS.os2 ?= -bt=os2
|
---|
135 | TOOL_WATCOMC11C_LDFLAGS.win ?= -bt=nt
|
---|
136 | TOOL_WATCOMC11C_LDFLAGS.debug ?=
|
---|
137 |
|
---|
138 |
|
---|
139 | TOOL_WATCOMC11C_COMPILE_C_DEPEND =
|
---|
140 | TOOL_WATCOMC11C_COMPILE_C_DEPORD =
|
---|
141 | TOOL_WATCOMC11C_COMPILE_C_OUTPUT = $(obj).err
|
---|
142 | define TOOL_WATCOMC11C_COMPILE_C_CMDS
|
---|
143 | $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CC) \
|
---|
144 | $(flags) \
|
---|
145 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
|
---|
146 | $(addprefix -d, $(defs)) \
|
---|
147 | -fo=$(subst /,\\,$(obj)) \
|
---|
148 | -fr=$(subst /,\\,$(obj)).err \
|
---|
149 | $(subst /,\\,$(abspath $(source)))
|
---|
150 | $(QUIET)$(APPEND) -n $(obj).err
|
---|
151 | ## @todo dependencies
|
---|
152 | endef
|
---|
153 |
|
---|
154 | TOOL_WATCOMC11C_COMPILE_CXX_DEPEND =
|
---|
155 | TOOL_WATCOMC11C_COMPILE_CXX_DEPORD =
|
---|
156 | TOOL_WATCOMC11C_COMPILE_CXX_OUTPUT = $(obj).err
|
---|
157 | define TOOL_WATCOMC11C_COMPILE_CXX_CMDS
|
---|
158 | $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CXX) \
|
---|
159 | $(flags) \
|
---|
160 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
|
---|
161 | $(addprefix -d, $(defs)) \
|
---|
162 | -fo=$(subst /,\\,$(obj)) \
|
---|
163 | -fr=$(subst /,\\,$(obj)).err \
|
---|
164 | $(subst /,\\,$(abspath $(source)))
|
---|
165 | $(QUIET)$(APPEND) -n $(obj).err
|
---|
166 | ## @todo dependencies
|
---|
167 | endef
|
---|
168 |
|
---|
169 | TOOL_WATCOMC11C_COMPILE_RC_OUTPUT =
|
---|
170 | TOOL_WATCOMC11C_COMPILE_RC_DEPEND =
|
---|
171 | TOOL_WATCOMC11C_COMPILE_RC_DEPORD =
|
---|
172 | define TOOL_WATCOMC11C_COMPILE_RC_CMDS
|
---|
173 | $(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) \
|
---|
174 | $(TOOL_WATCOMC11C_RC) -r\
|
---|
175 | $(flags) \
|
---|
176 | $(addprefix -i=, $(subst /,\\,$(incs))) \
|
---|
177 | $(addprefix -d, $(defs))\
|
---|
178 | -fo=$(subst /,\\,obj) \
|
---|
179 | $(subst /,\\,$(abspath $(source)))
|
---|
180 | endef
|
---|
181 |
|
---|
182 | TOOL_WATCOMC11C_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
|
---|
183 | TOOL_WATCOMC11C_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
184 | TOOL_WATCOMC11C_LINK_LIBRARY_DEPORD =
|
---|
185 | define TOOL_WATCOMC11C_LINK_LIBRARY_CMDS
|
---|
186 | $(if $(strip $(othersrc)),\
|
---|
187 | $(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
|
---|
188 | $(TOOL_WATCOMC11C_IMP) $(TOOL_WATCOMC11C_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
|
---|
189 | $(if $(strip $(objs)),$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
|
---|
190 | $(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
|
---|
191 | $(TOOL_WATCOMC11C_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
|
---|
192 | endef
|
---|
193 |
|
---|
194 | TOOL_WATCOMC11C_LINK_PROGRAM_OUTPUT = $(outbase).map
|
---|
195 | TOOL_WATCOMC11C_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
196 | TOOL_WATCOMC11C_LINK_PROGRAM_DEPORD =
|
---|
197 | define 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))))
|
---|
211 | endef
|
---|
212 |
|
---|
213 | TOOL_WATCOMC11C_LINK_DLL_OUTPUT = $(outbase).map
|
---|
214 | TOOL_WATCOMC11C_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
215 | TOOL_WATCOMC11C_LINK_DLL_DEPORD =
|
---|
216 | define 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))))
|
---|
230 | endef
|
---|
231 |
|
---|
232 | TOOL_WATCOMC11C_LINK_SYSMOD_OUTPUT = $(outbase).map
|
---|
233 | TOOL_WATCOMC11C_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
234 | TOOL_WATCOMC11C_LINK_SYSMOD_DEPORD =
|
---|
235 | define 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))))
|
---|
249 | endef
|
---|
250 |
|
---|
251 |
|
---|