1
# Copyright (C) 2001-2007 Artifex Software, Inc.
4
# This software is provided AS-IS with no warranty, either express or
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.
13
# $Id: msvclib.mak 8559 2008-02-29 08:13:08Z ray $
14
# makefile for Microsoft Visual C++ 4.1 or later, Windows NT or Windows 95 LIBRARY.
16
# All configurable options are surrounded by !ifndef/!endif to allow
17
# preconfiguration from within another makefile.
19
# ------------------------------- Options ------------------------------- #
21
###### This section is the only part of the file you should need to edit.
23
# ------ Generic options ------ #
25
# Define the root directory for Ghostscript installation.
31
GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
34
# Define the directory that will hold documentation at runtime.
37
GS_DOCDIR=$(GSROOTDIR)/doc
40
# Define the default directory/ies for the runtime initialization, resource and
41
# font files. Separate multiple directories with ';'.
42
# Use / to indicate directories, not \.
43
# MSVC will not allow \'s here because it sees '\;' CPP-style as an
46
!ifndef GS_LIB_DEFAULT
47
GS_LIB_DEFAULT=$(GSROOTDIR)/lib;$(GSROOTDIR)/Resource;$(AROOTDIR)/fonts
50
# Define whether or not searching for initialization files should always
51
# look in the current directory first. This leads to well-known security
52
# and confusion problems, but users insist on it.
53
# NOTE: this also affects searching for files named on the command line:
54
# see the "File searching" section of Use.htm for full details.
55
# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended.
57
!ifndef SEARCH_HERE_FIRST
61
# Define the name of the interpreter initialization file.
62
# (There is no reason to change this.)
66
# Choose generic configuration options.
68
# Setting DEBUG=1 includes debugging features (-Z switch) in the code.
69
# Code runs substantially slower even if no debugging switches are set,
70
# and also takes about another 25K of memory.
76
# Setting TDEBUG=1 includes symbol table information for the debugger,
77
# and also enables stack checking. Code is substantially slower and larger.
79
# NOTE: The MSVC++ 5.0 compiler produces incorrect output code with TDEBUG=0.
80
# Leave TDEBUG set to 1.
86
# Define the name of the executable file.
92
# Define the directory for the final executable, and the
93
# source, generated intermediate file, and object directories
94
# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
112
# Do not edit the next group of lines.
114
DD=$(GLGENDIR)\$(NUL)
115
GLD=$(GLGENDIR)\$(NUL)
117
# Define the directory where the IJG JPEG library sources are stored,
118
# and the major version of the library that is stored there.
119
# You may need to change this if the IJG library version changes.
120
# See jpeg.mak for more information.
126
# Define the directory where the PNG library sources are stored,
127
# and the version of the library that is stored there.
128
# You may need to change this if the libpng version changes.
129
# See libpng.mak for more information.
135
# Define the directory where the zlib sources are stored.
136
# See zlib.mak for more information.
142
# Define the jbig2 library and source location.
143
# See jbig2.mak for more information.
153
# Define the jasper library source location.
154
# See jasper.mak for more information.
160
# Alternatively, you can build a separate DLL
161
# and define SHARE_JPX=1 in src/winlib.mak
167
# Define the directory where the icclib source are stored.
168
# See icclib.mak for more information
174
# Define the directory where the imdi library source is stored.
175
# See devs.mak for more information
181
# Define any other compilation flags.
187
# ------ Platform-specific options ------ #
189
# Define which major version of MSVC is being used (currently, 4, 5 & 6 supported)
195
# Define the drive, directory, and compiler name for the Microsoft C files.
196
# COMPDIR contains the compiler and linker (normally \msdev\bin).
197
# MSINCDIR contains the include files (normally \msdev\include).
198
# LIBDIR contains the library files (normally \msdev\lib).
199
# COMP is the full C compiler path name (normally \msdev\bin\cl).
200
# COMPCPP is the full C++ compiler path name (normally \msdev\bin\cl).
201
# COMPAUX is the compiler name for DOS utilities (normally \msdev\bin\cl).
202
# RCOMP is the resource compiler name (normallly \msdev\bin\rc).
203
# LINK is the full linker path name (normally \msdev\bin\link).
204
# Note that when MSINCDIR and LIBDIR are used, they always get a '\' appended,
205
# so if you want to use the current directory, use an explicit '.'.
207
!if $(MSVC_VERSION) == 4
211
COMPBASE=$(DEVSTUDIO)
212
SHAREDBASE=$(DEVSTUDIO)
215
!if $(MSVC_VERSION) == 5
217
DEVSTUDIO=C:\Program Files\Devstudio
219
!if "$(DEVSTUDIO)"==""
223
COMPBASE=$(DEVSTUDIO)\VC
224
SHAREDBASE=$(DEVSTUDIO)\SharedIDE
228
!if $(MSVC_VERSION) == 6
230
DEVSTUDIO=C:\Program Files\Microsoft Visual Studio
232
!if "$(DEVSTUDIO)"==""
236
COMPBASE=$(DEVSTUDIO)\VC98
237
SHAREDBASE=$(DEVSTUDIO)\Common\MSDev98
241
# Some environments don't want to specify the path names for the tools at all.
242
# Typical definitions for such an environment would be:
243
# MSINCDIR= LIBDIR= COMP=cl COMPAUX=cl RCOMP=rc LINK=link
244
# COMPDIR, LINKDIR, and RCDIR are irrelevant, since they are only used to
245
# define COMP, LINK, and RCOMP respectively, but we allow them to be
246
# overridden anyway for completeness.
248
!if "$(COMPBASE)"==""
251
COMPDIR=$(COMPBASE)\bin
256
!if "$(COMPBASE)"==""
259
LINKDIR=$(COMPBASE)\bin
264
!if "$(SHAREDBASE)"==""
267
RCDIR=$(SHAREDBASE)\bin
272
!if "$(COMPBASE)"==""
275
MSINCDIR=$(COMPBASE)\include
280
!if "$(COMPBASE)"==""
283
LIBDIR=$(COMPBASE)\lib
313
LINK="$(LINKDIR)\link"
317
# nmake does not have a form of .BEFORE or .FIRST which can be used
318
# to specify actions before anything else is done. If LIB and INCLUDE
319
# are not defined then we want to define them before we link or
320
# compile. Here is a kludge which allows us to to do what we want.
321
# nmake does evaluate preprocessor directives when they are encountered.
322
# So the desired set statements are put into dummy preprocessor
325
!if "$(MSINCDIR)"!=""
326
!if [set INCLUDE=$(MSINCDIR)]==0
332
!if [set LIB=$(LIBDIR)]==0
337
# Define the processor architecture. (i386, ppc, alpha)
342
#CPU_FAMILY=alpha # not supported yet - we need someone to tweak
345
# Define the processor (CPU) type. Allowable values depend on the family:
346
# i386: 386, 486, 586
348
# alpha: not currently used.
355
# Define the .dev module that implements thread and synchronization
356
# primitives for this platform. Don't change this unless you really know
363
# ------ Devices and features ------ #
365
# Choose the language feature(s) to include. See gs.mak for details.
368
FEATURE_DEVS=$(GLD)psl3lib.dev $(GLD)path1lib.dev $(GLD)dps2lib.dev $(GLD)psl2cs.dev $(GLD)cielib.dev $(GLD)imasklib.dev $(GLD)patlib.dev $(GLD)htxlib.dev $(GLD)roplib.dev $(GLD)devcmap.dev $(GLD)bbox.dev $(GLD)pipe.dev
371
# Choose whether to compile the .ps initialization files into the executable.
372
# See gs.mak for details.
374
!ifndef COMPILE_INITS
378
# Choose whether to store band lists on files or in memory.
379
# The choices are 'file' or 'memory'.
381
!ifndef BAND_LIST_STORAGE
382
BAND_LIST_STORAGE=file
385
# Choose which compression method to use when storing band lists in memory.
386
# The choices are 'lzw' or 'zlib'.
388
!ifndef BAND_LIST_COMPRESSOR
389
BAND_LIST_COMPRESSOR=zlib
392
# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
393
# See gs.mak and sfilefd.c for more details.
395
!ifndef FILE_IMPLEMENTATION
396
FILE_IMPLEMENTATION=stdio
399
# Choose the implementation of stdio: Only '' is allowed for library.
400
# See gs.mak and ziodevs.c/ziodevsc.c for more details.
402
STDIO_IMPLEMENTATION=
404
# Choose the device(s) to include. See devs.mak for details,
405
# devs.mak and contrib.mak for the list of available devices.
407
DEVICE_DEVS=$(DD)ljet2p.dev $(DD)bbox.dev
430
# ---------------------------- End of options ---------------------------- #
432
# Define the name of the makefile -- used in dependencies.
434
MAKEFILE=$(GLSRCDIR)\msvclib.mak
435
TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)\msvccmd.mak $(GLSRCDIR)\msvctail.mak $(GLSRCDIR)\winlib.mak
437
# Define the files to be removed by `make clean'.
438
# nmake expands macros when encountered, not when used,
439
# so this must precede the !include statements.
441
BEGINFILES2=$(GLOBJDIR)\$(GS).ilk $(GLOBJDIR)\$(GS).pdb $(GLOBJDIR)\genarch.ilk $(GLOBJDIR)\genarch.pdb
443
# Define these right away because they modify the behavior of
444
# msvccmd.mak, msvctail.mak & winlib.mak.
446
LIB_ONLY=$(GLOBJDIR)\gslib.obj $(GLOBJDIR)\gsnogc.obj $(GLOBJDIR)\gconfig.obj $(GLOBJDIR)\gscdefs.obj $(GLOBJDIR)\gsromfs$(COMPILE_INITS).obj
450
!include $(GLSRCDIR)\version.mak
451
!include $(GLSRCDIR)\msvccmd.mak
452
!include $(GLSRCDIR)\winlib.mak
453
!include $(GLSRCDIR)\msvctail.mak
455
# -------------------------------- Library -------------------------------- #
457
# The Windows Win32 platform for library
459
# For some reason, C-file dependencies have to come before mslib32__.dev
461
$(GLOBJ)gp_mslib.$(OBJ): $(GLSRC)gp_mslib.c $(AK)
462
$(GLCCWIN) $(GLO_)gp_mslib.$(OBJ) $(C_) $(GLSRC)gp_mslib.c
464
mslib32__=$(GLOBJ)gp_mslib.$(OBJ)
466
$(GLGEN)mslib32_.dev: $(mslib32__) $(ECHOGS_XE) $(GLGEN)mswin32_.dev
467
$(SETMOD) $(GLGEN)mslib32_ $(mslib32__)
468
$(ADDMOD) $(GLGEN)mslib32_ -include $(GLGEN)mswin32_.dev
470
# ----------------------------- Main program ------------------------------ #
472
# The library tester EXE
473
$(GS_XE): $(GS_ALL) $(DEVS_ALL) $(LIB_ONLY) $(LIBCTR)
474
copy $(ld_tr) $(GLGENDIR)\gslib32.tr
475
echo $(GLOBJDIR)\gsromfs$(COMPILE_INITS).$(OBJ) >> $(GLGENDIR)\gslib32.tr
476
echo $(GLOBJ)gsnogc.obj >> $(GLGENDIR)\gslib32.tr
477
echo $(GLOBJ)gconfig.obj >> $(GLGENDIR)\gslib32.tr
478
echo $(GLOBJ)gscdefs.obj >> $(GLGENDIR)\gslib32.tr
479
echo /SUBSYSTEM:CONSOLE > $(GLGENDIR)\gslib32.rsp
480
echo /OUT:$(GS_XE) >> $(GLGENDIR)\gslib32.rsp
481
$(LINK) $(LCT) @$(GLGENDIR)\gslib32.rsp $(GLOBJ)gslib @$(GLGENDIR)\gslib32.tr @$(LIBCTR)
482
-del $(GLGENDIR)\gslib32.rsp
483
-del $(GLGENDIR)\gslib32.tr