1#  Copyright (C) 2001-2006 Artifex Software, Inc.
2#  All Rights Reserved.
3#
4#  This software is provided AS-IS with no warranty, either express or
5#  implied.
6#
7#  This software is distributed under license and may not be copied, modified
8#  or distributed except as expressly authorized under the terms of that
9#  license.  Refer to licensing information at http://www.artifex.com/
10#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
11#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12#
13# $Id: wccommon.mak 8477 2008-01-07 18:43:02Z henrys $
14# wccommon.mak
15# Section of Watcom C/C++ makefile common to MS-DOS and MS Windows.
16# We strongly recommend that you read the Watcom section of Make.htm
17# before attempting to build Ghostscript with the Watcom compiler.
18
19# This file is used by watc.mak, watcwin.mak, and watclib.mak.
20# Those files supply the following parameters:
21#   Configuration, public:
22#	GS_LIB_DEFAULT, SEARCH_HERE_FIRST, GS_INIT, FEATURE_DEVS,
23#	DEVICE_DEVS*, COMPILE_INITS, BAND_LIST_*
24#   Configuration, internal, generic:
25#	PLATFORM, MAKEFILE, AK, CC*, DEBUG, CP_, RM_, RMN_
26#   Configuration, internal, specific to DOS/Windows:
27#	TDEBUG, COMPDIR, LIBPATHS,
28#	CPU_TYPE,
29
30# We want Unix-compatible behavior.  This is part of it.
31
32.NOCHECK
33
34# Define additional extensions to keep `make' happy
35
36.EXTENSIONS: .be .z
37
38# Define the auxiliary program dependency. We don't use this.
39
40AK=
41
42# Note that built-in third-party libraries aren't available.
43
44SHARE_JPEG=0
45SHARE_LIBPNG=0
46SHARE_ZLIB=0
47SHARE_JBIG2=0
48SHARE_JPX=0
49
50# Define the extensions for command, object, and executable files.
51
52NULL=
53
54C_=
55CMD=.bat
56D_=-D
57_D_=$(NULL)=
58_D=
59I_=-i=
60II=-i=
61_I=
62NO_OP=%null
63O_=-fo=
64OBJ=obj
65Q=
66RO_=$(O_)
67XE=.exe
68XEAUX=.exe
69
70# Define the executable and shell invocations.
71
72D=\\
73
74EXP=
75SH=
76
77# Define generic commands.
78
79CP_=call $(GLSRCDIR)\cp.bat
80RM_=call $(GLSRCDIR)\rm.bat
81RMN_=call $(GLSRCDIR)\rm.bat
82
83# Define the arguments for genconf.
84
85# wmake interprets & as calling for background execution, and ^ fails on
86# Windows NT.
87CONFILES=-e ~ -p FILE~s~ps
88CONFLDTR=-ol
89
90# Define the names of the Watcom C files.
91# See the comments in watc.mak and watcwin.mak regarding WCVERSION.
92
93!ifeq WCVERSION 11.0
94# 11.0 is currently the same as 10.5.
95COMP=$(%WATCOM)\binw\wcc386
96LINK=$(%WATCOM)\binw\wlink
97STUB=$(%WATCOM)\binw\wstub.exe
98WRC=$(%WATCOM)\binw\wrc.exe
99!endif
100
101!ifeq WCVERSION 10.5
102COMP=$(%WATCOM)\binw\wcc386
103LINK=$(%WATCOM)\binw\wlink
104STUB=$(%WATCOM)\binw\wstub.exe
105WRC=$(%WATCOM)\binw\wrc.exe
106!endif
107
108!ifeq WCVERSION 10.0
109COMP=$(%WATCOM)\binb\wcc386
110LINK=$(%WATCOM)\bin\wlink
111STUB=$(%WATCOM)\binb\wstub.exe
112WRC=$(%WATCOM)\binb\wrc.exe
113!endif
114
115!ifeq WCVERSION 9.5
116COMP=$(%WATCOM)\bin\wcc386
117LINK=$(%WATCOM)\bin\wlinkp
118STUB=$(%WATCOM)\binb\wstub.exe
119WRC=$(%WATCOM)\binb\wrc.exe
120!endif
121
122# 95/NT Watcom compiler versions
123# 10.695 is 10.6 under Windows 95 or NT (32 bit hosted tools)
124!ifeq WCVERSION 10.695
125COMP=$(%WATCOM)\binnt\wcc386
126LINK=$(%WATCOM)\binnt\wlink
127STUB=$(%WATCOM)\binw\wstub.exe
128WRC=$(%WATCOM)\binnt\wrc.exe
129WAT32=1
130!endif
131
132# Defaults
133!ifndef COMP
134COMP=$(%WATCOM)\bin\wcc386p
135LINK=$(%WATCOM)\bin\wlinkp
136STUB=$(%WATCOM)\binb\wstub.exe
137WRC=$(%WATCOM)\binb\rc.exe
138!endif
139!ifndef WAT32
140WAT32=0
141!endif
142
143!ifeq WAT32 0
144INCDIRS=$(%WATCOM)\h
145!else
146INCDIRS=$(%WATCOM)\h;$(%WATCOM)\h\nt
147!endif
148WBIND=$(%WATCOM)\binb\wbind.exe
149
150# Define the generic compilation flags.
151
152!ifeq CPU_TYPE 586
153!ifeq FPU_TYPE 0
154FPU_TYPE=387
155!endif
156!else
157!ifeq CPU_TYPE 486
158!ifeq FPU_TYPE 0
159FPU_TYPE=387
160!endif
161!endif
162!endif
163
164!ifeq FPU_TYPE 387
165FPFLAGS=-fpi87
166!else
167!ifeq FPU_TYPE 287
168FPFLAGS=-fpi287
169!else
170!ifeq FPU_TYPE -1
171FPFLAGS=-fpc
172!else
173FPFLAGS=-fpi
174!endif
175!endif
176!endif
177
178# Make sure we get the right default target for make.
179
180dosdefault: default
181	$(NO_OP)
182
183# Define the compilation flags.
184
185# Run-time debugging and stack checking
186!ifneq DEBUG 0
187CD=-dDEBUG
188CS=
189!else
190CD=
191CS=-oeilnt -s
192!endif
193
194# Debugger symbols
195!ifneq TDEBUG 0
196CT=-d2
197LCT=DEBUG ALL
198!else
199CT=-d1
200LCT=DEBUG LINES
201!endif
202
203GENOPT=$(CD) $(CT) $(CS)
204
205CCOPT=-d+ -i=$(INCDIRS) -zq -zp8 -ei
206CCFLAGS=$(CCOPT) $(GENOPT) $(PLATOPT) $(FPFLAGS) $(CFLAGS) $(XCFLAGS)
207CC=$(COMP) -oi $(CCFLAGS)
208CCAUX=$(COMP) -oi $(CCOPT) $(FPFLAGS)
209CC_=$(CC)
210CC_D=$(CC)
211CC_INT=$(COMP) -oit $(CCFLAGS)
212CC_NO_WARN=$(CC_)
213