| 1 | # $Id: WATCOMC11C.kmk 2413 2010-09-11 17:43:04Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | # kBuild Tool Config - Watcom C v11.0c
|
|---|
| 4 | #
|
|---|
| 5 |
|
|---|
| 6 | #
|
|---|
| 7 | # Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@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 | 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.
|
|---|
| 53 | else
|
|---|
| 54 | # Resolve any fancy stuff once and for all.
|
|---|
| 55 | PATH_TOOL_WATCOMC11C := $(PATH_TOOL_WATCOMC11C)
|
|---|
| 56 | endif
|
|---|
| 57 |
|
|---|
| 58 | ifneq ($(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 | --
|
|---|
| 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 | --
|
|---|
| 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 |
|
|---|
| 96 | else
|
|---|
| 97 | # Pathless, relies on the environment.
|
|---|
| 98 | TOOL_WATCOMC11C_PATHLESS :=
|
|---|
| 99 | TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
|
|---|
| 100 | -E 'LIB=$1' \
|
|---|
| 101 | -E 'INCLUDE=' \
|
|---|
| 102 | --
|
|---|
| 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 |
|
|---|
| 114 | endif
|
|---|
| 115 |
|
|---|
| 116 | # General Properties used by kBuild
|
|---|
| 117 | TOOL_WATCOMC11C_COBJSUFF ?= .obj
|
|---|
| 118 | TOOL_WATCOMC11C_CFLAGS ?= -zq
|
|---|
| 119 | TOOL_WATCOMC11C_CFLAGS.dos ?= -bt=dos
|
|---|
| 120 | TOOL_WATCOMC11C_CFLAGS.os2 ?= -bt=os2
|
|---|
| 121 | TOOL_WATCOMC11C_CFLAGS.win ?= -bt=nt
|
|---|
| 122 | ifdef PATH_TOOL_WATCOMC11C
|
|---|
| 123 | TOOL_WATCOMC11C_CINCS ?= $(PATH_TOOL_WATCOMC11C)/h
|
|---|
| 124 | endif
|
|---|
| 125 |
|
|---|
| 126 | TOOL_WATCOMC11C_CXXOBJSUFF ?= .obj
|
|---|
| 127 | TOOL_WATCOMC11C_CXXFLAGS ?= -zq
|
|---|
| 128 | TOOL_WATCOMC11C_CXXFLAGS.dos ?= -bt=dos
|
|---|
| 129 | TOOL_WATCOMC11C_CXXFLAGS.os2 ?= -bt=os2
|
|---|
| 130 | TOOL_WATCOMC11C_CXXFLAGS.win ?= -bt=nt
|
|---|
| 131 | ifdef PATH_TOOL_WATCOMC11C
|
|---|
| 132 | TOOL_WATCOMC11C_CXXINCS ?= $(PATH_TOOL_WATCOMC11C)/h
|
|---|
| 133 | endif
|
|---|
| 134 |
|
|---|
| 135 | TOOL_WATCOMC11C_RCOBJSUFF ?= .res
|
|---|
| 136 | TOOL_WATCOMC11C_RCFLAGS ?= -r
|
|---|
| 137 | ifdef PATH_TOOL_WATCOMC11C
|
|---|
| 138 | TOOL_WATCOMC11C_RCINCS ?= $(PATH_TOOL_WATCOMC11C)/h
|
|---|
| 139 | endif
|
|---|
| 140 |
|
|---|
| 141 | TOOL_WATCOMC11C_ARFLAGS ?= -q
|
|---|
| 142 | TOOL_WATCOMC11C_ARLIBSUFF ?= .lib
|
|---|
| 143 |
|
|---|
| 144 | TOOL_WATCOMC11C_LDFLAGS ?= -zq -y
|
|---|
| 145 | TOOL_WATCOMC11C_LDFLAGS.dos ?= -bt=dos
|
|---|
| 146 | TOOL_WATCOMC11C_LDFLAGS.os2 ?= -bt=os2
|
|---|
| 147 | TOOL_WATCOMC11C_LDFLAGS.win ?= -bt=nt
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | TOOL_WATCOMC11C_COMPILE_C_DEPEND =
|
|---|
| 151 | TOOL_WATCOMC11C_COMPILE_C_DEPORD =
|
|---|
| 152 | TOOL_WATCOMC11C_COMPILE_C_OUTPUT = $(obj).err
|
|---|
| 153 | define 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
|
|---|
| 163 | endef
|
|---|
| 164 |
|
|---|
| 165 | TOOL_WATCOMC11C_COMPILE_CXX_DEPEND =
|
|---|
| 166 | TOOL_WATCOMC11C_COMPILE_CXX_DEPORD =
|
|---|
| 167 | TOOL_WATCOMC11C_COMPILE_CXX_OUTPUT = $(obj).err
|
|---|
| 168 | define 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
|
|---|
| 178 | endef
|
|---|
| 179 |
|
|---|
| 180 | TOOL_WATCOMC11C_COMPILE_RC_OUTPUT =
|
|---|
| 181 | TOOL_WATCOMC11C_COMPILE_RC_DEPEND =
|
|---|
| 182 | TOOL_WATCOMC11C_COMPILE_RC_DEPORD =
|
|---|
| 183 | define 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)))
|
|---|
| 191 | endef
|
|---|
| 192 |
|
|---|
| 193 | TOOL_WATCOMC11C_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
|---|
| 194 | TOOL_WATCOMC11C_LINK_LIBRARY_DEPEND = $(othersrc)
|
|---|
| 195 | TOOL_WATCOMC11C_LINK_LIBRARY_DEPORD =
|
|---|
| 196 | define 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
|
|---|
| 199 | endef
|
|---|
| 200 |
|
|---|
| 201 | TOOL_WATCOMC11C_LINK_PROGRAM_OUTPUT = $(outbase).map
|
|---|
| 202 | TOOL_WATCOMC11C_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 203 | TOOL_WATCOMC11C_LINK_PROGRAM_DEPORD =
|
|---|
| 204 | define TOOL_WATCOMC11C_LINK_PROGRAM_CMDS
|
|---|
| 205 | $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
|
|---|
| 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))))
|
|---|
| 218 | endef
|
|---|
| 219 |
|
|---|
| 220 | TOOL_WATCOMC11C_LINK_DLL_OUTPUT = $(outbase).map
|
|---|
| 221 | TOOL_WATCOMC11C_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 222 | TOOL_WATCOMC11C_LINK_DLL_DEPORD =
|
|---|
| 223 | define TOOL_WATCOMC11C_LINK_DLL_CMDS
|
|---|
| 224 | $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
|
|---|
| 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))))
|
|---|
| 237 | endef
|
|---|
| 238 |
|
|---|
| 239 | TOOL_WATCOMC11C_LINK_SYSMOD_OUTPUT = $(outbase).map
|
|---|
| 240 | TOOL_WATCOMC11C_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
|---|
| 241 | TOOL_WATCOMC11C_LINK_SYSMOD_DEPORD =
|
|---|
| 242 | define TOOL_WATCOMC11C_LINK_SYSMOD_CMDS
|
|---|
| 243 | $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
|
|---|
| 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))))
|
|---|
| 256 | endef
|
|---|
| 257 |
|
|---|
| 258 |
|
|---|