1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
|
# Copyright (C) 1991-2000 Aladdin Enterprises. All rights reserved.
#
# This file is part of AFPL Ghostscript.
#
# AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
# distributor accepts any responsibility for the consequences of using it, or
# for whether it serves any particular purpose or works at all, unless he or
# she says so in writing. Refer to the Aladdin Free Public License (the
# "License") for full details.
#
# Every copy of AFPL Ghostscript must include a copy of the License, normally
# in a plain ASCII text file named PUBLIC. The License grants you the right
# to copy, modify and redistribute AFPL Ghostscript, but only under certain
# conditions described in the License. Among other things, the License
# requires that the copyright notice and this notice be preserved on all
# copies.
# $Id$
# makefile for Microsoft Visual C++ 4.1 or later, Windows NT or Windows 95 LIBRARY.
#
# All configurable options are surrounded by !ifndef/!endif to allow
# preconfiguration from within another makefile.
# ------------------------------- Options ------------------------------- #
###### This section is the only part of the file you should need to edit.
# ------ Generic options ------ #
# Define the root directory for Ghostscript installation.
!ifndef AROOTDIR
AROOTDIR=c:/gs
!endif
!ifndef GSROOTDIR
GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
!endif
# Define the directory that will hold documentation at runtime.
!ifndef GS_DOCDIR
GS_DOCDIR=$(GSROOTDIR)/doc
!endif
# Define the default directory/ies for the runtime initialization and
# font files. Separate multiple directories with ';'.
# Use / to indicate directories, not \.
# MSVC will not allow \'s here because it sees '\;' CPP-style as an
# illegal escape.
!ifndef GS_LIB_DEFAULT
GS_LIB_DEFAULT=$(GSROOTDIR)/lib;$(AROOTDIR)/fonts
!endif
# Define whether or not searching for initialization files should always
# look in the current directory first. This leads to well-known security
# and confusion problems, but users insist on it.
# NOTE: this also affects searching for files named on the command line:
# see the "File searching" section of Use.htm for full details.
# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended.
!ifndef SEARCH_HERE_FIRST
SEARCH_HERE_FIRST=1
!endif
# Define the name of the interpreter initialization file.
# (There is no reason to change this.)
GS_INIT=gs_init.ps
# Choose generic configuration options.
# Setting DEBUG=1 includes debugging features (-Z switch) in the code.
# Code runs substantially slower even if no debugging switches are set,
# and also takes about another 25K of memory.
!ifndef DEBUG
DEBUG=0
!endif
# Setting TDEBUG=1 includes symbol table information for the debugger,
# and also enables stack checking. Code is substantially slower and larger.
# NOTE: The MSVC++ 5.0 compiler produces incorrect output code with TDEBUG=0.
# Leave TDEBUG set to 1.
!ifndef TDEBUG
TDEBUG=1
!endif
# Setting NOPRIVATE=1 makes private (static) procedures and variables public,
# so they are visible to the debugger and profiler.
# No execution time or space penalty, just larger .OBJ and .EXE files.
!ifndef NOPRIVATE
NOPRIVATE=0
!endif
# Define the name of the executable file.
!ifndef GS
GS=gslib
!endif
# Define the directory for the final executable, and the
# source, generated intermediate file, and object directories
# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
!ifndef BINDIR
BINDIR=.\bin
!endif
!ifndef GLSRCDIR
GLSRCDIR=.\src
!endif
!ifndef GLGENDIR
GLGENDIR=.\obj
!endif
!ifndef GLOBJDIR
GLOBJDIR=.\obj
!endif
# Do not edit the next group of lines.
NUL=
DD=$(GLGENDIR)\$(NUL)
GLD=$(GLGENDIR)\$(NUL)
# Define the directory where the IJG JPEG library sources are stored,
# and the major version of the library that is stored there.
# You may need to change this if the IJG library version changes.
# See jpeg.mak for more information.
!ifndef JSRCDIR
JSRCDIR=jpeg
JVERSION=6
!endif
# Define the directory where the PNG library sources are stored,
# and the version of the library that is stored there.
# You may need to change this if the libpng version changes.
# See libpng.mak for more information.
!ifndef PSRCDIR
PSRCDIR=libpng
PVERSION=10008
!endif
# Define the directory where the zlib sources are stored.
# See zlib.mak for more information.
!ifndef ZSRCDIR
ZSRCDIR=zlib
!endif
# Define the directory where the icclib source are stored.
# See icclib.mak for more information
!ifndef ICCSRCDIR
ICCSRCDIR=icclib
!endif
# Define any other compilation flags.
!ifndef CFLAGS
CFLAGS=
!endif
# ------ Platform-specific options ------ #
# Define which major version of MSVC is being used (currently, 4 & 5 supported)
!ifndef MSVC_VERSION
MSVC_VERSION = 5
!endif
# Define the drive, directory, and compiler name for the Microsoft C files.
# COMPDIR contains the compiler and linker (normally \msdev\bin).
# INCDIR contains the include files (normally \msdev\include).
# LIBDIR contains the library files (normally \msdev\lib).
# COMP is the full C compiler path name (normally \msdev\bin\cl).
# COMPCPP is the full C++ compiler path name (normally \msdev\bin\cl).
# COMPAUX is the compiler name for DOS utilities (normally \msdev\bin\cl).
# RCOMP is the resource compiler name (normallly \msdev\bin\rc).
# LINK is the full linker path name (normally \msdev\bin\link).
# Note that when INCDIR and LIBDIR are used, they always get a '\' appended,
# so if you want to use the current directory, use an explicit '.'.
!if $(MSVC_VERSION) == 4
! ifndef DEVSTUDIO
DEVSTUDIO=c:\msdev
! endif
COMPBASE=$(DEVSTUDIO)
SHAREDBASE=$(DEVSTUDIO)
!endif
!if $(MSVC_VERSION) == 5
! ifndef DEVSTUDIO
#DEVSTUDIO=c:\program files\devstudio
DEVSTUDIO=c:\progra~1\devstu~1
! endif
COMPBASE=$(DEVSTUDIO)\VC
SHAREDBASE=$(DEVSTUDIO)\SharedIDE
!endif
!if $(MSVC_VERSION) == 6
! ifndef DEVSTUDIO
#DEVSTUDIO=c:\program files\microsoft visual studio
DEVSTUDIO=c:\progra~1\micros~2
! endif
COMPBASE=$(DEVSTUDIO)\VC98
SHAREDBASE=$(DEVSTUDIO)\Common\MSDev98
!endif
# Some environments don't want to specify the path names for the tools at all.
# Typical definitions for such an environment would be:
# INCDIR= LIBDIR= COMP=cl COMPAUX=cl RCOMP=rc LINK=link
# COMPDIR, LINKDIR, and RCDIR are irrelevant, since they are only used to
# define COMP, LINK, and RCOMP respectively, but we allow them to be
# overridden anyway for completeness.
!ifndef COMPDIR
COMPDIR=$(COMPBASE)\bin
!endif
!ifndef LINKDIR
LINKDIR=$(COMPBASE)\bin
!endif
!ifndef RCDIR
RCDIR=$(SHAREDBASE)\bin
!endif
!ifndef INCDIR
INCDIR=$(COMPBASE)\include
!endif
!ifndef LIBDIR
LIBDIR=$(COMPBASE)\lib
!endif
!ifndef COMP
COMP=$(COMPDIR)\cl
!endif
!ifndef COMPCPP
COMPCPP=$(COMP)
!endif
!ifndef COMPAUX
COMPAUX=$(COMPDIR)\cl
!endif
!ifndef RCOMP
RCOMP=$(RCDIR)\rc
!endif
!ifndef LINK
LINK=$(LINKDIR)\link
!endif
# Define the processor architecture. (i386, ppc, alpha)
!ifndef CPU_FAMILY
CPU_FAMILY=i386
#CPU_FAMILY=ppc
#CPU_FAMILY=alpha # not supported yet - we need someone to tweak
!endif
# Define the processor (CPU) type. Allowable values depend on the family:
# i386: 386, 486, 586
# ppc: 601, 604, 620
# alpha: not currently used.
!ifndef CPU_TYPE
CPU_TYPE=486
#CPU_TYPE=601
!endif
!if "$(CPU_FAMILY)"=="i386"
# Intel(-compatible) processors are the only ones for which the CPU type
# doesn't indicate whether a math coprocessor is present.
# For Intel processors only, define the math coprocessor (FPU) type.
# Options are -1 (optimize for no FPU), 0 (optimize for FPU present,
# but do not require a FPU), 87, 287, or 387.
# If you have a 486 or Pentium CPU, you should normally set FPU_TYPE to 387,
# since most of these CPUs include the equivalent of an 80387 on-chip;
# however, the 486SX and the Cyrix 486SLC do not have an on-chip FPU, so if
# you have one of these CPUs and no external FPU, set FPU_TYPE to -1 or 0.
# An xx87 option means that the executable will run only if a FPU
# of that type (or higher) is available: this is NOT currently checked
# at runtime.
! ifndef FPU_TYPE
FPU_TYPE=387
! endif
!endif
# Define the .dev module that implements thread and synchronization
# primitives for this platform. Don't change this unless you really know
# what you're doing.
!ifndef SYNC
SYNC=winsync
!endif
# ------ Devices and features ------ #
# Choose the language feature(s) to include. See gs.mak for details.
!ifndef FEATURE_DEVS
FEATURE_DEVS=dps2lib.dev psl2cs.dev cielib.dev imasklib.dev patlib.dev htxlib.dev roplib.dev devcmap.dev bbox.dev pipe.dev
!endif
# Choose whether to compile the .ps initialization files into the executable.
# See gs.mak for details.
!ifndef COMPILED_INITS
COMPILE_INITS=0
!endif
# Choose whether to store band lists on files or in memory.
# The choices are 'file' or 'memory'.
!ifndef BAND_LIST_STORAGE
BAND_LIST_STORAGE=file
!endif
# Choose which compression method to use when storing band lists in memory.
# The choices are 'lzw' or 'zlib'. lzw is not recommended, because the
# LZW-compatible code in Ghostscript doesn't actually compress its input.
!ifndef BAND_LIST_COMPRESSOR
BAND_LIST_COMPRESSOR=zlib
!endif
# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
# See gs.mak and sfilefd.c for more details.
!ifndef FILE_IMPLEMENTATION
FILE_IMPLEMENTATION=stdio
!endif
# Choose the implementation of stdio: Only '' is allowed for library.
# See gs.mak and ziodevs.c/ziodevsc.c for more details.
STDIO_IMPLEMENTATION=
# Choose the device(s) to include. See devs.mak for details,
# devs.mak and contrib.mak for the list of available devices.
!ifndef DEVICE_DEVS
DEVICE_DEVS=ljet2p.dev bbox.dev
DEVICE_DEVS1=
DEVICE_DEVS2=
DEVICE_DEVS3=
DEVICE_DEVS4=
DEVICE_DEVS5=
DEVICE_DEVS6=
DEVICE_DEVS7=
DEVICE_DEVS8=
DEVICE_DEVS9=
DEVICE_DEVS10=
DEVICE_DEVS11=
DEVICE_DEVS12=
DEVICE_DEVS13=
DEVICE_DEVS14=
DEVICE_DEVS15=
DEVICE_DEVS16=
DEVICE_DEVS17=
DEVICE_DEVS18=
DEVICE_DEVS19=
DEVICE_DEVS20=
!endif
# ---------------------------- End of options ---------------------------- #
# Derive values for FPU_TYPE for non-Intel processors.
!if "$(CPU_FAMILY)"=="ppc"
! if $(CPU_TYPE)>601
FPU_TYPE=2
! else
FPU_TYPE=1
! endif
!endif
!if "$(CPU_FAMILY)"=="alpha"
# *** alpha *** This needs fixing
FPU_TYPE=1
!endif
# Define the name of the makefile -- used in dependencies.
MAKEFILE=$(GLSRCDIR)\msvclib.mak
TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)\msvccmd.mak $(GLSRCDIR)\msvctail.mak $(GLSRCDIR)\winlib.mak
# Define the files to be removed by `make clean'.
# nmake expands macros when encountered, not when used,
# so this must precede the !include statements.
BEGINFILES2=$(GLOBJDIR)\$(GS).ilk $(GLOBJDIR)\$(GS).pdb
# Define these right away because they modify the behavior of
# msvccmd.mak, msvctail.mak & winlib.mak.
LIB_ONLY=$(GLOBJDIR)\gslib.obj $(GLOBJDIR)\gsnogc.obj $(GLOBJDIR)\gconfig.obj $(GLOBJDIR)\gscdefs.obj
MAKEDLL=0
PLATFORM=mslib32_
!include $(GLSRCDIR)\version.mak
!include $(GLSRCDIR)\msvccmd.mak
!include $(GLSRCDIR)\winlib.mak
!include $(GLSRCDIR)\msvctail.mak
# -------------------------------- Library -------------------------------- #
# The Windows Win32 platform for library
# For some reason, C-file dependencies have to come before mslib32__.dev
$(GLOBJ)gp_mslib.$(OBJ): $(GLSRC)gp_mslib.c $(AK)
$(GLCCWIN) $(GLO_)gp_mslib.$(OBJ) $(C_) $(GLSRC)gp_mslib.c
mslib32__=$(GLOBJ)gp_mslib.$(OBJ)
$(GLGEN)mslib32_.dev: $(mslib32__) $(ECHOGS_XE) $(GLGEN)msw32nc_.dev
$(SETMOD) $(GLGEN)mslib32_ $(mslib32__)
$(ADDMOD) $(GLGEN)mslib32_ -include $(GLGEN)msw32nc_.dev
# ----------------------------- Main program ------------------------------ #
# The library tester EXE
$(GS_XE): $(GS_ALL) $(DEVS_ALL) $(LIB_ONLY) $(LIBCTR)
copy $(ld_tr) $(GLGENDIR)\gslib32.tr
echo $(GLOBJ)gsnogc.obj >> $(GLGENDIR)\gslib32.tr
echo $(GLOBJ)gconfig.obj >> $(GLGENDIR)\gslib32.tr
echo $(GLOBJ)gscdefs.obj >> $(GLGENDIR)\gslib32.tr
echo /SUBSYSTEM:CONSOLE > $(GLGENDIR)\gslib32.rsp
echo /OUT:$(GS_XE) >> $(GLGENDIR)\gslib32.rsp
$(LINK_SETUP)
$(LINK) $(LCT) @$(GLGENDIR)\gslib32.rsp $(GLOBJ)gslib @$(GLGENDIR)\gslib32.tr @$(LIBCTR) $(INTASM) @$(GLGENDIR)\lib.tr
-del $(GLGENDIR)\gslib32.rsp
-del $(GLGENDIR)\gslib32.tr
|