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: openvms.mmk 8479 2008-01-07 20:58:40Z giles $
14
# makefile for OpenVMS VAX and Alpha using MMK
16
# Please contact Jim Dunham (dunham@omtool.com) if you have questions.
17
# Addapted for MMK by Jouk Jansen (joukj@hrem.stm.tudelft.nl)
18
# Support for VAX C on OpenVMS was removed in release 6.01 by Aladdin:
19
# DEC C is now used on both VAX and Alpha platforms.
21
# ------------------------------- Options ------------------------------- #
23
###### This section is the only part of the file you should need to edit.
25
# on the make command line specify:
26
# mmk/descrip=[.src]openvms.mmk/macro=("DECWINDOWS1_2={0,1}")
28
# Define the directory for the final executable, and the
29
# source, generated intermediate file, and object directories
30
# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
40
# Because of OpenVMS syntactic problems, the following redundant definitions
41
# are necessary. If you are using more than one GENDIR and/or OBJDIR,
42
# you will have to edit the code below that creates these directories.
48
if f$search("$(BIN_DIR)") .eqs. "" then create/directory/log $(BINDIR)
49
if f$search("$(OBJ_DIR)") .eqs. "" then create/directory/log $(GLOBJDIR)
51
# Do not edit the next group of lines.
53
#.include $(COMMONDIR)vmscdefs.mak
54
#.include $(COMMONDIR)vmsdefs.mak
55
#.include $(COMMONDIR)generic.mak
56
.include $(GLSRCDIR)version.mak
61
# ------ Generic options ------ #
63
# Define the directory that will hold documentation at runtime.
66
#GS_DOCDIR=SYS$COMMON:[GS]
68
# Define the default directory/ies for the runtime
69
# initialization and font files. Separate multiple directories with ,.
72
#GS_LIB_DEFAULT=SYS$COMMON:[GS],SYS$COMMON:[GS.FONT]
74
# Define whether or not searching for initialization files should always
75
# look in the current directory first. This leads to well-known security
76
# and confusion problems, but users insist on it.
77
# NOTE: this also affects searching for files named on the command line:
78
# see the "File searching" section of Use.htm for full details.
79
# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended.
83
# Define the name of the interpreter initialization file.
84
# (There is no reason to change this.)
88
# Choose generic configuration options.
90
# Setting DEBUG=1 includes debugging features in the code
94
# Setting TDEBUG=1 includes symbol table information for the debugger,
95
# and also enables stack tracing on failure.
99
# Setting CDEBUG=1 enables 'C' compiler debugging and turns off optimization
100
# Code is substantially slower and larger.
104
# Define the name of the executable file.
108
# Define the name of a pre-built executable that can be invoked at build
109
# time. Currently, this is only needed for compiled fonts. The usual
111
# - the standard name of Ghostscript on your system (typically `gs'):
113
# - the name of the executable you are building now. If you choose this
114
# option, then you must build the executable first without compiled fonts,
115
# and then again with compiled fonts.
116
#BUILD_TIME_GS=$(BINDIR)$(GS) -I$(PSLIBDIR)
118
# Define the directory where the IJG JPEG library sources are stored,
119
# and the major version of the library that is stored there.
120
# You may need to change this if the IJG library version changes.
121
# See jpeg.mak for more information.
129
# Define the directory where the PNG library sources are stored,
130
# and the version of the library that is stored there.
131
# You may need to change this if the libpng version changes.
132
# See libpng.mak for more information.
135
PNGSRCDIR=sys$library:
137
PNGSRCDIR=[--.libpng]
140
# Define the directory where the zlib sources are stored.
141
# See zlib.mak for more information.
149
# Define the directory where the jbig2dec library sources are stored.
150
# See jbig2.mak for more information
154
JBIG2SRCDIR=sys$library:
156
JBIG2SRCDIR=[--.jbig2dec]
159
# Define the jpeg2k library and source directory
163
JPXSRCDIR=sys$library:
165
JPXSRCDIR=[--.jasper]
168
# Define the directory where the icclib source are stored.
169
# See icclib.mak for more information
173
# IJS has not been ported to OpenVMS. If you do the port,
174
# you'll need to set these values. You'll also need to
175
# include the ijs.mak makefile (right after icclib.mak).
177
# Define the directory where the ijs source is stored,
178
# and the process forking method to use for the server.
179
# See ijs.mak for more information.
184
# Note that built-in third-party libraries aren't available.
191
# Define the path to X11 include files
193
X_INCLUDE=DECW$INCLUDE
195
# ------ Platform-specific options ------ #
197
# Define the drive, directory, and compiler name for the 'C' compiler.
198
# COMP is the full compiler path name.
201
SW_DEBUG=/DEBUG/NOOPTIMIZE
203
# This should include /OPTIMIZE, but some OpenVMS compilers have an
204
# optimizer bug that causes them to generate incorrect code for gdevpsfx.c,
205
# so we must disable optimization. (Eventually we will check for the bug
206
# in genarch and enable optimization if it is safe.)
207
#SW_DEBUG=/NODEBUG/OPTIMIZE
208
SW_DEBUG=/NODEBUG/NOOPTIMIZE
211
SW_PLATFORM=/DECC/PREFIX=ALL/NESTED_INCLUDE=PRIMARY/name=(as_is,short)/nowarn
213
# Define any other compilation flags.
214
# Including defines for A4 paper size
217
SW_PAPER=/DEFINE=("A4","HAVE_MKSTEMP")
219
SW_PAPER=/DEFINE=("HAVE_MKSTEMP")
228
COMP=CC$(SW_DEBUG)$(SW_PLATFORM)$(SW_PAPER)$(SW_IEEE)
230
# LINK is the full linker path name
233
LINKER=LINK/DEBUG/TRACEBACK
235
LINKER=LINK/NODEBUG/NOTRACEBACK
238
# INCDIR contains the include files
241
# LIBDIR contains the library files
244
# Define the .dev module that implements thread and synchronization
245
# primitives for this platform. Don't change this unless you really know
250
# ------ Devices and features ------ #
252
# Choose the device(s) to include. See devs.mak for details,
253
# devs.mak and contrib.mak for the list of available devices.
255
DEVICE_DEVS=$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev
258
DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev
259
DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev
260
DEVICE_DEVS5=$(DD)uniprint.dev
261
DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev
262
DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev
263
DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
264
DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev
265
DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
266
DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev
267
DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
268
DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
269
DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev
270
DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
271
DEVICE_DEVS16=$(DD)bbox.dev
272
# Overflow from DEVS9
273
DEVICE_DEVS17=$(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev
280
# Choose the language feature(s) to include. See gs.mak for details.
282
FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(PSD)fapi.dev $(PSD)jbig2.dev
284
# Choose whether to compile the .ps initialization files into the executable.
285
# See gs.mak for details.
289
# Choose whether to store band lists on files or in memory.
290
# The choices are 'file' or 'memory'.
292
BAND_LIST_STORAGE=file
294
# Choose which compression method to use when storing band lists in memory.
295
# The choices are 'lzw' or 'zlib'.
297
BAND_LIST_COMPRESSOR=zlib
299
# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
300
# See gs.mak and sfxfd.c for more details.
302
FILE_IMPLEMENTATION=stdio
304
# Choose the implementation of stdio: '' for file I/O and 'c' for callouts
305
# See gs.mak and ziodevs.c/ziodevsc.c for more details.
307
STDIO_IMPLEMENTATION=c
309
# Define the platform name.
313
# Define the name of the makefile -- used in dependencies.
315
MAKEFILE=$(GLSRCDIR)openvms.mmk
316
TOP_MAKEFILES=$(MAKEFILE)
318
# Define the platform options
322
# It is very unlikely that anyone would want to edit the remaining
323
# symbols, but we describe them here for completeness:
325
# Define the suffix for command files (e.g., null or .bat).
329
# Define the directory separator character (\ for MS-DOS, / for Unix,
330
# nothing for OpenVMS).
334
# Define the brackets for passing preprocessor definitions to the C compiler.
341
# Define the syntax of search paths for the C compiler.
342
# The OpenVMS compilers uses /INCLUDE=(dir1, dir2, ...dirn),
343
# and only a single /INCLUDE switch is allowed in the command line.
349
# Define the string for specifying the output file from the C compiler.
353
# Define the quoting string for mixed-case arguments.
354
# (OpenVMS is the only platform where this isn't an empty string.)
358
# Define the extension for executable files (e.g., null or .exe).
362
# Define the extension for executable files for the auxiliary programs
363
# (e.g., null or .exe).
367
# Define the list of files that `make clean' removes.
369
BEGINFILES=$(GLSRCDIR)OPENVMS.OPT $(GLSRCDIR)OPENVMS.COM
371
# Define the C invocation for auxiliary programs (echogs, genarch).
372
# We don't need to define this separately.
376
# Define the C invocation for normal compilation.
380
# Define the Link invocation.
382
LINK=$(LINKER)/EXE=$@ $+,$(GLSRCDIR)OPENVMS.OPT/OPTION
384
# Define the auxiliary program dependency. We don't need this.
388
# Define the syntax for command, object, and executable files.
392
# Define the prefix for image invocations.
396
# Define the prefix for shell invocations.
400
# Define generic commands.
402
CP_=@$(GLSRCDIR)COPY_ONE
404
# Define the command for deleting (a) file(s) (including wild cards)
406
RM_=@$(GLSRCDIR)RM_ONE
408
# Define the command for deleting multiple files / patterns.
410
RMN_=@$(GLSRCDIR)RM_ALL
412
# Define the arguments for genconf.
417
# Define the generic compilation rules.
419
.suffixes : .c .obj .exe
424
# ---------------------------- End of options ---------------------------- #
426
# Define various incantations of the 'c' compiler.
433
# ------------------- Include the generic makefiles ---------------------- #
435
all : macro [.lib]Fontmap. $(GS_XE)
437
#.include $(COMMONDIR)/ansidefs.mak
438
#.include $(COMMONDIR)/vmsdefs.mak
439
#.include $(COMMONDIR)/generic.mak
440
.include $(GLSRCDIR)gs.mak
441
.include $(GLSRCDIR)lib.mak
442
.include $(PSSRCDIR)int.mak
443
.include $(PSSRCDIR)cfonts.mak
444
.include $(GLSRCDIR)jpeg.mak
445
# zlib.mak must precede libpng.mak
446
.include $(GLSRCDIR)zlib.mak
447
.include $(GLSRCDIR)libpng.mak
448
JBIG2_EXTRA_OBJS=$(JBIG2OBJDIR)$(D)snprintf.$(OBJ)
449
.include $(GLSRCDIR)jbig2.mak
450
.include $(GLSRCDIR)icclib.mak
451
.include $(GLSRCDIR)devs.mak
452
.include $(GLSRCDIR)contrib.mak
455
# ----------------------------- Main program ------------------------------
473
@ decc = f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes.""
474
@ decw12 = f$search("SYS$SHARE:DECW$XTLIBSHRR5.EXE").nes.""
476
@ if dsl.or.a4p.or.decc.or.decw12 then macro = "/MACRO=("
477
@ if decw12 then macro = macro + "DECWINDOWS1_2=1,"
478
@ if a4p then macro = macro + "A4_PAPER=1,"
479
@ if dsl then macro = macro + "SYSLIB=1,"
480
@ if i3e then macro = macro + "IEEE=1,"
481
@ if macro.nes."" then macro = f$extract(0,f$length(macro)-1,macro)+ ")"
482
$(MMS)$(MMSQUALIFIERS)'macro' $(GS_XE)
484
$(GS_XE) : openvms $(GLGEN)arch.h $(GLOBJDIR)gs.$(OBJ) $(INT_ALL) $(LIB_ALL)
485
$(LINKER)/EXE=$@ $(GLOBJDIR)gs.$(OBJ),$(ld_tr)/OPTIONS,$(GLSRCDIR)OPENVMS.OPT/OPTION
486
@ Write Sys$Output "Build of GhostScript is complete!"
490
openvms__=$(GLOBJ)gp_getnv.$(OBJ) $(GLOBJ)gp_vms.$(OBJ) $(GLOBJ)gp_stdia.$(OBJ)
491
$(GLGEN)openvms_.dev : $(openvms__) $(GLGEN)nosync.dev
492
$(SETMOD) $(GLGEN)openvms_ $(openvms__) -include $(GLGEN)nosync
494
$(ECHOGS_XE) : $(GLOBJDIR)echogs.$(OBJ)
495
$(GENARCH_XE) : $(GLOBJDIR)genarch.$(OBJ)
496
$(GENCONF_XE) : $(GLOBJDIR)genconf.$(OBJ)
497
$(GENDEV_XE) : $(GLOBJDIR)gendev.$(OBJ)
498
$(GENHT_XE) : $(GLOBJDIR)genht.$(OBJ)
499
$(GENINIT_XE) : $(GLOBJDIR)geninit.$(OBJ)
501
$(GLOBJDIR)echogs.$(OBJ) : $(GLSRCDIR)echogs.c
502
$(GLOBJDIR)genarch.$(OBJ) : $(GLSRCDIR)genarch.c $(GENARCH_DEPS)
503
$(GLOBJDIR)genconf.$(OBJ) : $(GLSRCDIR)genconf.c $(GENCONF_DEPS)
504
$(GLOBJDIR)gendev.$(OBJ) : $(GLSRCDIR)gendev.c $(GENDEV_DEPS)
505
# ****** NEED TO ADD $(GENHT_CFLAGS) HERE ******
506
$(GLOBJDIR)genht.$(OBJ) : $(GLSRCDIR)genht.c $(GENHT_DEPS)
507
$(GLOBJDIR)geninit.$(OBJ) : $(GLSRCDIR)geninit.c $(GENINIT_DEPS)
509
$(GLOBJ)gp_vms.$(OBJ) : $(GLSRC)gp_vms.c $(string__h) $(memory__h) $(gx_h) $(gp_h) $(gpmisc_h) $(gsstruct_h)
510
$(CC_)/include=($(GLGENDIR),$(GLSRCDIR))/obj=$(GLOBJ)gp_vms.$(OBJ) $(GLSRC)gp_vms.c
512
$(GLOBJ)gp_stdia.$(OBJ) : $(GLSRC)gp_stdia.c $(AK) $(stdio__h) $(time__h) $(unistd__h) $(gx_h) $(gp_h)
513
$(CC_)/incl=$(GLOBJ)/obj=$(GLOBJ)gp_stdia.$(OBJ) $(GLSRC)gp_stdia.c
515
# Preliminary definitions
517
openvms : $(GLSRCDIR)openvms.com $(GLSRCDIR)openvms.opt
520
$(GLSRCDIR)openvms.com : $(GLSRCDIR)append_l.com
521
@$(GLSRCDIR)APPEND_L $@ "$ DEFINE/JOB X11 $(X_INCLUDE)"
522
@$(GLSRCDIR)APPEND_L $@ "$ DEFINE/JOB GS_LIB ''F$ENVIRONMENT(""DEFAULT"")'"
523
@$(GLSRCDIR)APPEND_L $@ "$ DEFINE/JOB GS_DOC ''F$ENVIRONMENT(""DEFAULT"")'"
524
@$(GLSRCDIR)APPEND_L $@ "$ DEFINE/JOB DECC$USER_INCLUDE ''F$ENVIRONMENT(""DEFAULT"")', DECW$INCLUDE, DECC$LIBRARY_INCLUDE, SYS$LIBRARY"
525
@$(GLSRCDIR)APPEND_L $@ "$ DEFINE/JOB DECC$SYSTEM_INCLUDE ''F$ENVIRONMENT(""DEFAULT"")', DECW$INCLUDE, DECC$LIBRARY_INCLUDE, SYS$LIBRARY"
526
@$(GLSRCDIR)APPEND_L $@ "$ DEFINE/JOB SYS "DECC$LIBRARY_INCLUDE,SYS$LIBRARY"
528
$(GLSRCDIR)openvms.opt :
530
@$(GLSRCDIR)APPEND_L $@ "SYS$SHARE:DECW$XMLIBSHR12.EXE/SHARE"
531
@$(GLSRCDIR)APPEND_L $@ "SYS$SHARE:DECW$XTLIBSHRR5.EXE/SHARE"
532
@$(GLSRCDIR)APPEND_L $@ "SYS$SHARE:DECW$XLIBSHR.EXE/SHARE"
534
@$(GLSRCDIR)APPEND_L $@ "SYS$SHARE:DECW$XMLIBSHR.EXE/SHARE"
535
@$(GLSRCDIR)APPEND_L $@ "SYS$SHARE:DECW$XTSHR.EXE/SHARE"
536
@$(GLSRCDIR)APPEND_L $@ "SYS$SHARE:DECW$XLIBSHR.EXE/SHARE"
538
@$(GLSRCDIR)APPEND_L $@ ""Ident="""""GS $(GS_DOT_VERSION)"""""
540
# The platform-specific makefiles must also include rules for creating
541
# certain dynamically generated files:
542
# gconfig_.h - this indicates the presence or absence of
543
# certain system header files that are located in different
544
# places on different systems. (It could be generated by
545
# the GNU `configure' program.)
547
$(gconfig__h) : $(TOP_MAKEFILES) $(ECHOGS_XE)
548
$(EXP)$(ECHOGS_XE) -w $(gconfig__h) -x 23 define "HAVE_SYS_TIME_H"