1#    Copyright (C) 1989, 1995, 1996, 1997, 1998, 1999, 2000 artofcode LLC.  All rights reserved.
2#
3#  This program is free software; you can redistribute it and/or modify it
4#  under the terms of the GNU General Public License as published by the
5#  Free Software Foundation; either version 2 of the License, or (at your
6#  option) any later version.
7#
8#  This program is distributed in the hope that it will be useful, but
9#  WITHOUT ANY WARRANTY; without even the implied warranty of
10#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11#  General Public License for more details.
12#
13#  You should have received a copy of the GNU General Public License along
14#  with this program; if not, write to the Free Software Foundation, Inc.,
15#  59 Temple Place, Suite 330, Boston, MA, 02111-1307.
16
17
18# $Id: os2.mak,v 1.19.2.7.2.2 2003/03/11 11:59:10 ghostgum Exp $
19# makefile for MS-DOS or OS/2 GCC/EMX platform.
20# Uses Borland (MSDOS) MAKER or
21# Uses IBM NMAKE.EXE Version 2.000.000 Mar 27 1992
22
23# ------------------------------- Options ------------------------------- #
24
25###### This section is the only part of the file you should need to edit.
26
27# ------ Generic options ------ #
28
29# Define the directory for the final executable, and the
30# source, generated intermediate file, and object directories
31# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
32
33# This makefile has never been tested with any other values than these,
34# and almost certainly won't work with other values.
35BINDIR=bin
36GLSRCDIR=src
37GLGENDIR=obj
38GLOBJDIR=obj
39PSSRCDIR=src
40PSLIBDIR=lib
41PSGENDIR=obj
42PSOBJDIR=obj
43
44# Define the root directory for Ghostscript installation.
45
46AROOTDIR=c:/gs
47GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
48
49# Define the directory that will hold documentation at runtime.
50
51GS_DOCDIR=$(GSROOTDIR)/doc
52
53# Define the default directory/ies for the runtime
54# initialization and font files.  Separate multiple directories with ;.
55# Use / to indicate directories, not a single \.
56
57GS_LIB_DEFAULT=$(GSROOTDIR)/lib;$(AROOTDIR)/fonts
58
59# Define whether or not searching for initialization files should always
60# look in the current directory first.  This leads to well-known security
61# and confusion problems, but users insist on it.
62# NOTE: this also affects searching for files named on the command line:
63# see the "File searching" section of Use.htm for full details.
64# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended.
65
66SEARCH_HERE_FIRST=1
67
68# Define the name of the interpreter initialization file.
69# (There is no reason to change this.)
70
71GS_INIT=gs_init.ps
72
73# Choose generic configuration options.
74
75# Setting DEBUG=1 includes debugging features (-Z switch) in the code.
76# Code runs substantially slower even if no debugging switches are set,
77# and also takes about another 25K of memory.
78
79DEBUG=0
80
81# Setting GDEBUG=1 includes symbol table information for GDB.
82# Produces larger .OBJ and .EXE files.
83
84GDEBUG=0
85
86# Setting NOPRIVATE=1 makes private (static) procedures and variables public,
87# so they are visible to the debugger and profiler.
88# No execution time or space penalty, just larger .OBJ and .EXE files.
89
90NOPRIVATE=0
91
92# Setting MAKEDLL=1 makes the target a DLL instead of an EXE
93MAKEDLL=1
94
95# Setting EMX=1 uses GCC/EMX
96# Setting IBMCPP=1 uses IBM C++
97EMX=1
98IBMCPP=0
99
100# Setting BUILD_X11=1 builds X11 client using Xfree86
101BUILD_X11=0
102!if $(BUILD_X11)
103X11INCLUDE=-I$(X11ROOT)\XFree86\include
104X11LIBS=$(X11ROOT)\XFree86\lib\Xt.lib $(X11ROOT)\XFree86\lib\X11.lib
105MT_OPT=-Zmtd
106!endif
107
108# Define the name of the executable file.
109
110GS=gsos2
111GSDLL=gsdll2
112
113# Define the name of a pre-built executable that can be invoked at build
114# time.  Currently, this is only needed for compiled fonts.  The usual
115# alternatives are:
116#   - the standard name of Ghostscript on your system (typically `gs'):
117BUILD_TIME_GS=gsos2
118#   - the name of the executable you are building now.  If you choose this
119# option, then you must build the executable first without compiled fonts,
120# and then again with compiled fonts.
121#BUILD_TIME_GS=$(BINDIR)\$(GS) -I$(PSLIBDIR)
122
123# Define the directory where the IJG JPEG library sources are stored,
124# and the major version of the library that is stored there.
125# You may need to change this if the IJG library version changes.
126# See jpeg.mak for more information.
127
128JSRCDIR=jpeg
129JVERSION=6
130
131# Define the directory where the PNG library sources are stored,
132# and the version of the library that is stored there.
133# You may need to change this if the libpng version changes.
134# See libpng.mak for more information.
135
136PSRCDIR=libpng
137PVERSION=10205
138
139# Define the directory where the zlib sources are stored.
140# See zlib.mak for more information.
141
142ZSRCDIR=zlib
143
144# Define the directory where the icclib source are stored.
145# See icclib.mak for more information
146
147ICCSRCDIR=icclib
148
149# IJS has not been ported to OS/2. If you do the port,
150# you'll need to set these values. You'll also need to
151# include the ijs.mak makefile (right after icclib.mak).
152#
153# Define the directory where the ijs source is stored,
154# and the process forking method to use for the server.
155# See ijs.mak for more information.
156
157#IJSSRCDIR=ijs
158#IJSEXECTYPE=win
159
160# The following is a hack to get around the special treatment of \ at
161# the end of a line.
162NUL=
163DD=$(GLGENDIR)\$(NUL)
164GLD=$(GLGENDIR)\$(NUL)
165PSD=$(PSGENDIR)\$(NUL)
166
167
168# ------ Platform-specific options ------ #
169
170# If you don't have an assembler, set USE_ASM=0.  Otherwise, set USE_ASM=1,
171# and set ASM to the name of the assembler you are using.  This can be
172# a full path name if you want.  Normally it will be masm or tasm.
173
174USE_ASM=0
175ASM=
176
177# Define the drive, directory, and compiler name for the EMX files.
178# COMP is the compiler name (gcc)
179# COMPDIR contains the compiler and linker (normally \emx\bin).
180# EMXPATH contains the path to the EMX directory (normally /emx)
181# INCDIR contains the include files (normally /emx/include).
182# LIBDIR contains the library files (normally /emx/lib).
183# Note that these prefixes are always followed by a \,
184#   so if you want to use the current directory, use an explicit '.'.
185
186!if $(EMX)
187COMP=gcc $(X11INCLUDE)
188COMPBASE=\emx
189EMXPATH=/emx
190COMPDIR=$(COMPBASE)\bin
191INCDIR=$(EMXPATH)/include
192LIBDIR=$(EMXPATH)/lib
193!if $(PVERSION) >= 10009
194CPNG=-DPNGAPI=
195!endif
196!endif
197
198!if $(IBMCPP)
199COMP=icc /Q
200COMPBASE=\ibmcpp
201TOOLPATH=\toolkit
202COMPDIR=$(COMPBASE)\bin
203INCDIR=$(TOOLPATH)\h;$(COMPBASE)\include
204LIBDIR=$(TOOLPATH)\lib;$(COMPBASE)\lib
205!endif
206
207# Choose platform-specific options.
208
209# Define the processor (CPU) type.  Options are 86 (8086 or 8088),
210# 186, 286, 386, 485 (486SX or Cyrix 486SLC), 486 (486DX), or 586 (Pentium).
211# Higher numbers produce code that may be significantly smaller and faster,
212# but the executable will bail out with an error message on any processor
213# less capable than the designated one.
214
215# EMX requires 386 or higher
216CPU_TYPE=386
217
218# Define the math coprocessor (FPU) type.
219# Options are -1 (optimize for no FPU), 0 (optimize for FPU present,
220# but do not require a FPU), 87, 287, or 387.
221# If CPU_TYPE is 486 or above, FPU_TYPE is implicitly set to 387,
222# since 486DX and later processors include the equivalent of an 80387 on-chip.
223# An xx87 option means that the executable will run only if a FPU
224# of that type (or higher) is available: this is NOT currently checked
225# at runtime.
226
227FPU_TYPE=387
228
229# Define the .dev module that implements thread and synchronization
230# primitives for this platform.  Don't change this unless you really know
231# what you're doing.
232
233SYNC=winsync
234
235# ---------------------------- End of options ---------------------------- #
236
237# Note that built-in libpng and zlib aren't available.
238
239SHARE_JPEG=0
240SHARE_LIBPNG=0
241SHARE_ZLIB=0
242
243# Swapping `make' out of memory makes linking much faster.
244# only used by Borland MAKER.EXE
245
246#.swap
247
248# Define the platform name.
249
250PLATFORM=os2_
251
252# Define the name of the makefile -- used in dependencies.
253
254MAKEFILE=$(GLSRCDIR)\os2.mak
255TOP_MAKEFILES=$(MAKEFILE)
256
257# Define the files to be deleted by 'make clean'.
258
259BEGINFILES=$(BINDIR)\gspmdrv.exe $(GLOBJDIR)\gspmdrv.o $(GLOBJDIR)\gs*.res $(GLOBJDIR)\gs*.ico $(BINDIR)\$(GSDLL).dll
260
261# Define the auxiliary program dependency. We don't use this.
262
263AK=
264
265#Compiler Optimiser option
266!if $(EMX)
267CO=-O
268!endif
269!if $(IBMCPP)
270#CO=/O+
271CO=/O-
272!endif
273
274# Make sure we get the right default target for make.
275
276dosdefault: default $(BINDIR)\gspmdrv.exe
277
278# Define a rule for invoking just the preprocessor.
279
280.c.i:
281	$(COMPDIR)\cpp $(CCFLAGS) $<
282
283# Define the extensions for command, object, and executable files.
284
285# Work around the fact that some `make' programs drop trailing spaces
286# or interpret == as a special definition operator.
287NULL=
288
289CMD=.cmd
290C_=-c
291D_=-D
292_D_=$(NULL)=
293_D=
294I_=-I
295II=-I
296_I=
297O_=-o $(NULL)
298!if $(MAKEDLL)
299OBJ=obj
300!else
301OBJ=o
302!endif
303Q=
304XE=.exe
305XEAUX=.exe
306
307# Define the current directory prefix and shell name.
308
309D=\#
310
311EXP=
312SH=
313
314# Define generic commands.
315
316# We use cp.cmd rather than copy /B so that we update the write date.
317CP_=$(GLSRCDIR)\cp.cmd
318# We use rm.cmd rather than erase because rm.cmd never generates
319# a non-zero return code.
320RM_=$(GLSRCDIR)\rm.cmd
321# OS/2 erase, unlike MS-DOS erase, accepts multiple files or patterns.
322RMN_=$(GLSRCDIR)\rm.cmd
323
324# Define the arguments for genconf.
325
326!if $(MAKEDLL)
327CONFILES=-p %%s+ -l $(GLGENDIR)\lib.tr
328!else
329CONFILES=-l $(GLGENDIR)\lib.tr
330!endif
331CONFLDTR=-o
332
333# Define the generic compilation flags.
334
335!if $(CPU_TYPE) >= 486
336ASMCPU=/DFOR80386 /DFOR80486
337PLATOPT=-DFOR80386 -DFOR80486
338!else
339!if $(CPU_TYPE) >= 386
340ASMCPU=/DFOR80386
341PLATOPT=-DFOR80386
342!endif
343!endif
344
345!if $(FPU_TYPE) > 0
346ASMFPU=/DFORFPU
347!else
348ASMFPU=
349!endif
350
351!if $(USE_ASM)
352INTASM=iutilasm.$(OBJ)
353PCFBASM=gdevegaa.$(OBJ)
354!else
355INTASM=
356PCFBASM=
357!endif
358
359# Define the generic compilation rules.
360
361ASMFLAGS=$(ASMCPU) $(ASMFPU) $(ASMDEBUG)
362
363.asm.o:
364	$(ASM) $(ASMFLAGS) $<;
365
366# ---------------------- MS-DOS I/O debugging option ---------------------- #
367
368dosio_=$(PSOBJ)zdosio.$(OBJ)
369dosio.dev: $(PSGEN)dosio.dev
370	$(NO_OP)
371
372$(PSGEN)dosio.dev: $(dosio_)
373	$(SETMOD) $(PSGEN)dosio $(dosio_)
374	$(ADDMOD) $(PSGEN)dosio -oper zdosio
375
376$(PSOBJ)zdosio.$(OBJ): $(PSSRC)zdosio.c $(OP) $(store_h)
377	$(PSCC) $(PSO_)zdosio.$(OBJ) $(C_) $(PSSRC)zdosio.c
378
379# ----------------------------- Assembly code ----------------------------- #
380
381$(PSOBJ)iutilasm.$(OBJ): $(PSSRC)iutilasm.asm
382
383#################  END
384
385# Define the compilation flags.
386
387!if $(NOPRIVATE)
388CP=-DNOPRIVATE
389!else
390CP=
391!endif
392
393!if $(DEBUG)
394CD=-DDEBUG
395!else
396CD=
397!endif
398
399!if $(GDEBUG)
400!if $(EMX)
401CGDB=-g
402!endif
403!if $(IBMCPP)
404CGDB=/Ti+
405!endif
406!else
407CGDB=
408!endif
409
410!if $(MAKEDLL)
411!if $(EMX)
412CDLL=-Zdll -Zso -Zsys -Zomf $(MT_OPT) -D__DLL__
413!endif
414!if $(IBMCPP)
415CDLL=/Gd- /Ge- /Gm+ /Gs+ /D__DLL__
416!endif
417!else
418CDLL=
419!endif
420
421!if $(EMX)
422CEXE=-Zomf
423!endif
424
425GENOPT=$(CP) $(CD) $(CGDB) $(CDLL) $(CO) $(CPNG)
426
427CCFLAGS0=$(GENOPT) $(PLATOPT) -D__OS2__
428CCFLAGS=$(CCFLAGS0)
429CC=$(COMPDIR)\$(COMP) $(CCFLAGS0)
430CC_=$(CC)
431CC_D=$(CC) $(CO)
432CC_INT=$(CC)
433CC_LEAF=$(CC_)
434CC_NO_WARN=$(CC_)
435
436# ------ Devices and features ------ #
437
438# Choose the language feature(s) to include.  See gs.mak for details.
439# Since we have a large address space, we include some optional features.
440
441FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev
442
443# Choose whether to compile the .ps initialization files into the executable.
444# See gs.mak for details.
445
446COMPILE_INITS=0
447
448# Choose whether to store band lists on files or in memory.
449# The choices are 'file' or 'memory'.
450
451BAND_LIST_STORAGE=file
452
453# Choose which compression method to use when storing band lists in memory.
454# The choices are 'lzw' or 'zlib'.  lzw is not recommended, because the
455# LZW-compatible code in Ghostscript doesn't actually compress its input.
456
457BAND_LIST_COMPRESSOR=zlib
458
459# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
460# See gs.mak and sfxfd.c for more details.
461
462FILE_IMPLEMENTATION=stdio
463
464# Choose the implementation of stdio: '' for file I/O and 'c' for callouts
465# See gs.mak and ziodevs.c/ziodevsc.c for more details.
466
467STDIO_IMPLEMENTATION=c
468
469# Choose the device(s) to include.  See devs.mak for details,
470# devs.mak, pcwin.mak, and contrib.mak for the list of available devices.
471
472!if $(MAKEDLL)
473DEVICE_DEVS=$(DD)display.dev $(DD)os2pm.dev $(DD)os2dll.dev $(DD)os2prn.dev
474!else
475DEVICE_DEVS=$(DD)os2pm.dev
476!endif
477!if $(BUILD_X11)
478DEVICE_DEVS1=$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev
479!else
480DEVICE_DEVS1=
481!endif
482DEVICE_DEVS2=$(DD)epson.dev $(DD)eps9high.dev $(DD)eps9mid.dev $(DD)epsonc.dev $(DD)ibmpro.dev
483DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev
484DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev
485DEVICE_DEVS5=$(DD)uniprint.dev $(DD)djet500c.dev $(DD)declj250.dev $(DD)lj250.dev
486DEVICE_DEVS6=$(DD)st800.dev $(DD)stcolor.dev $(DD)bj10e.dev $(DD)bj200.dev
487DEVICE_DEVS7=$(DD)t4693d2.dev $(DD)t4693d4.dev $(DD)t4693d8.dev $(DD)tek4696.dev
488DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev
489DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev
490DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
491DEVICE_DEVS11=$(DD)bmpmono.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)tiff12nc.dev $(DD)tiff24nc.dev
492DEVICE_DEVS12=$(DD)psmono.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
493DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
494DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev
495DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
496DEVICE_DEVS16=$(DD)bbox.dev
497# Overflow for DEVS3,4,5,6,9
498DEVICE_DEVS17=$(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev
499DEVICE_DEVS18=$(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev $(DD)jetp3852.dev $(DD)r4081.dev
500DEVICE_DEVS19=$(DD)lbp8.dev $(DD)m8510.dev $(DD)necp6.dev $(DD)bjc600.dev $(DD)bjc800.dev
501DEVICE_DEVS20=$(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev
502
503# Include the generic makefiles.
504!include "$(GLSRCDIR)\version.mak"
505!include "$(GLSRCDIR)\gs.mak"
506!include "$(GLSRCDIR)\lib.mak"
507!include "$(GLSRCDIR)\jpeg.mak"
508# zlib.mak must precede libpng.mak
509!include "$(GLSRCDIR)\zlib.mak"
510!include "$(GLSRCDIR)\libpng.mak"
511!include "$(GLSRCDIR)\icclib.mak"
512!include "$(GLSRCDIR)\devs.mak"
513!include "$(GLSRCDIR)\pcwin.mak"
514!include "$(GLSRCDIR)\contrib.mak"
515!include "$(GLSRCDIR)\int.mak"
516!include "$(GLSRCDIR)\cfonts.mak"
517
518# -------------------------------- Library -------------------------------- #
519
520# The GCC/EMX platform
521
522os2__=$(GLOBJ)gp_getnv.$(OBJ) $(GLOBJ)gp_os2.$(OBJ) $(GLOBJ)gp_stdia.$(OBJ)
523$(GLGEN)os2_.dev: $(os2__) $(GLD)nosync.dev
524	$(SETMOD) $(GLGEN)os2_ $(os2__) -include $(GLD)nosync
525
526$(GLOBJ)gp_os2.$(OBJ): $(GLSRC)gp_os2.c\
527 $(dos__h) $(pipe__h) $(string__h) $(time__h)\
528 $(gsdll_h) $(gx_h) $(gsexit_h) $(gsutil_h) $(gp_h) $(gpmisc_h)
529	$(GLCC) $(GLO_)gp_os2.$(OBJ) $(C_) $(GLSRC)gp_os2.c
530
531$(GLOBJ)gp_stdia.$(OBJ): $(GLSRC)gp_stdia.c $(AK)\
532  $(stdio__h) $(time__h) $(unistd__h) $(gx_h) $(gp_h)
533	$(GLCC) $(GLO_)gp_stdia.$(OBJ) $(C_) $(GLSRC)gp_stdia.c
534
535# -------------------------- Auxiliary programs --------------------------- #
536
537#CCAUX=$(COMPDIR)\$(COMP) $(CO)
538# emx 0.9d (gcc 2.8.1) crashes when compiling genarch.c with optimizer
539CCAUX=$(COMPDIR)\$(COMP)
540
541$(ECHOGS_XE): $(GLSRCDIR)\echogs.c
542!if $(EMX)
543	$(CCAUX) -o $(AUXGEN)echogs $(GLSRCDIR)\echogs.c
544	$(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe $(AUXGEN)echogs $(ECHOGS_XE)
545	del $(AUXGEN)echogs
546!endif
547!if $(IBMCPP)
548	$(CCAUX) /Fe$(ECHOGS_XE) $(GLSRCDIR)\echogs.c
549!endif
550
551$(GENARCH_XE): $(GLSRCDIR)\genarch.c $(GENARCH_DEPS)
552	-mkdir $(GLGENDIR)
553	-mkdir $(BINDIR)
554!if $(EMX)
555	$(CCAUX) -o $(AUXGEN)genarch $(GLSRCDIR)\genarch.c
556	$(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe $(AUXGEN)genarch $(GENARCH_XE)
557	del $(AUXGEN)genarch
558!endif
559!if $(IBMCPP)
560	$(CCAUX) /Fe$(GENARCH_XE) $(GLSRCDIR)\genarch.c
561!endif
562
563$(GENCONF_XE): $(GLSRCDIR)\genconf.c $(GENCONF_DEPS)
564!if $(EMX)
565	$(CCAUX) -o $(AUXGEN)genconf $(GLSRCDIR)\genconf.c
566	$(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe $(AUXGEN)genconf $(GENCONF_XE)
567	del $(AUXGEN)genconf
568!endif
569!if $(IBMCPP)
570	$(CCAUX) /Fe$(GENCONF_XE) $(GLSRCDIR)\genconf.c
571!endif
572
573$(GENDEV_XE): $(GLSRCDIR)\gendev.c $(GENDEV_DEPS)
574!if $(EMX)
575	$(CCAUX) -o $(AUXGEN)gendev $(GLSRCDIR)\gendev.c
576	$(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe $(AUXGEN)gendev $(GENDEV_XE)
577	del $(AUXGEN)gendev
578!endif
579!if $(IBMCPP)
580	$(CCAUX) /Fe$(GENDEV_XE) $(GLSRCDIR)\gendev.c
581!endif
582
583$(GENHT_XE): $(PSSRC)genht.c $(GENHT_DEPS)
584!if $(EMX)
585	$(CCAUX) -o $(AUXGEN)genht $(GENHT_CFLAGS) $(PSSRC)genht.c
586	$(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe $(AUXGEN)genht $(GENHT_XE)
587	del $(AUXGEN)genht
588!endif
589!if $(IBMCPP)
590	$(CCAUX) /Fe$(GENHT_XE) genht.c
591!endif
592
593$(GENINIT_XE): $(PSSRC)geninit.c $(GENINIT_DEPS)
594!if $(EMX)
595	$(CCAUX) -o $(AUXGEN)geninit $(PSSRC)geninit.c
596	$(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe $(AUXGEN)geninit $(GENINIT_XE)
597	del $(AUXGEN)geninit
598!endif
599!if $(IBMCPP)
600	$(CCAUX) /Fe$(GENINIT_XE) geninit.c
601!endif
602
603# No special gconfig_.h is needed.
604$(gconfig__h): $(TOP_MAKEFILES) $(ECHOGS_XE)
605	$(ECHOGS_XE) -w $(gconfig__h) /* This file deliberately left blank. */
606
607$(gconfigv_h): $(GLSRCDIR)\os2.mak $(TOP_MAKEFILES) $(ECHOGS_XE)
608	$(ECHOGS_XE) -w $(gconfigv_h) -x 23 define USE_ASM -x 2028 -q $(USE_ASM)-0 -x 29
609	$(ECHOGS_XE) -a $(gconfigv_h) -x 23 define USE_FPU -x 2028 -q $(FPU_TYPE)-0 -x 29
610	$(ECHOGS_XE) -a $(gconfigv_h) -x 23 define EXTEND_NAMES 0$(EXTEND_NAMES)
611	$(ECHOGS_XE) -a $(gconfigv_h) -x 23 define SYSTEM_CONSTANTS_ARE_WRITABLE 0$(SYSTEM_CONSTANTS_ARE_WRITABLE)
612
613# ----------------------------- Main program ------------------------------ #
614
615gsdllos2_h=$(GLSRC)gsdllos2.h
616
617# Interpreter main program
618
619ICONS=$(GLOBJ)gsos2.ico $(GLOBJ)gspmdrv.ico
620
621$(GLOBJ)dpmain.$(OBJ): $(GLSRC)dpmain.c $(AK)\
622 $(gdevdsp_h) $(iapi_h) $(gscdefs_h) $(errors_h)
623	$(CC) $(CEXE) -I$(GLSRCDIR) -I$(GLGENDIR) $(GLO_)dpmain.$(OBJ) $(C_) $(GLSRC)dpmain.c
624
625!if $(MAKEDLL)
626#making a DLL
627GS_ALL=$(GLOBJ)gsdll.$(OBJ) $(INT_ALL) $(INTASM)\
628  $(LIB_ALL) $(LIBCTR) $(ld_tr) $(GLGEN)lib.tr $(GLOBJ)$(GS).res $(ICONS)
629
630$(GS_XE): $(BINDIR)\$(GSDLL).dll $(GLSRC)dpmain.c $(gsdll_h) $(gsdllos2_h) $(GLSRC)gsos2.rc $(GLOBJ)gscdefs.$(OBJ)
631!if $(EMX)
632	$(COMPDIR)\$(COMP) $(CGDB) $(CO) -Zomf $(MT_OPT) -I$(GLSRCDIR) -I$(GLOBJDIR) -o$(GS_XE) $(GLSRC)dpmain.c $(GLOBJ)gscdefs.$(OBJ) $(GLSRC)gsos2.def
633!endif
634!if $(IBMCPP)
635	$(CCAUX) -I$(GLSRCDIR) -I$(GLOBJDIR) /Fe$(GX_XE) $(GLSRC)dpmain.c $(GLOBJ)gscdefs.$(OBJ)
636!endif
637	rc $(GLOBJ)$(GS).res $(GS_XE)
638
639$(GLOBJ)gsdll.$(OBJ): $(GLSRC)gsdll.c $(gsdll_h) $(ghost_h) $(gscdefs_h)
640	$(PSCC) $(GLO_)gsdll.$(OBJ) $(C_) $(GLSRC)gsdll.c
641
642$(BINDIR)\$(GSDLL).dll: $(GS_ALL) $(ALL_DEVS) $(GLOBJ)gsdll.$(OBJ)
643!if $(EMX)
644	LINK386 /DEBUG $(COMPBASE)\lib\dll0.obj $(COMPBASE)\lib\end.lib @$(ld_tr) $(GLOBJ)gsdll.obj, $(BINDIR)\$(GSDLL).dll, ,$(X11LIBS) $(COMPBASE)\lib\gcc.lib $(COMPBASE)\lib\st\c.lib $(COMPBASE)\lib\st\c_dllso.lib $(COMPBASE)\lib\st\sys.lib $(COMPBASE)\lib\c_alias.lib $(COMPBASE)\lib\os2.lib, $(GLSRC)gsdll2.def
645!endif
646!if $(IBMCPP)
647	LINK386 /NOE /DEBUG @$(ld_tr) $(GLOBJ)gsdll.obj, $(BINDIR)\$(GSDLL).dll, , , $(GLSRC)gsdll2.def
648!endif
649
650!else
651#making an EXE
652GS_ALL=$(GLOBJ)gs.$(OBJ) $(INT_ALL) $(INTASM)\
653  $(LIB_ALL) $(LIBCTR) $(ld_tr) $(GLGEN)lib.tr $(GLOBJ)$(GS).res $(ICONS)
654
655$(GS_XE): $(GS_ALL) $(ALL_DEVS)
656	$(COMPDIR)\$(COMP) $(CGDB) -I$(GLSRCDIR) -o $(GLOBJ)$(GS) $(GLOBJ)gs.$(OBJ) @$(ld_tr) $(INTASM) -lm
657	$(COMPDIR)\emxbind -r$(GLOBJ)$(GS).res $(COMPDIR)\emxl.exe $(GLOBJ)$(GS) $(GS_XE) -ac
658	del $(GLOBJ)$(GS)
659!endif
660
661# Make the icons from their text form.
662
663$(GLOBJ)gsos2.ico: $(GLSRC)gsos2.icx $(ECHOGS_XE)
664	$(ECHOGS_XE) -wb $(GLOBJ)gsos2.ico -n -X -r $(GLSRC)gsos2.icx
665
666$(GLOBJ)gspmdrv.ico: $(GLSRC)gspmdrv.icx $(ECHOGS_XE)
667	$(ECHOGS_XE) -wb $(GLOBJ)gspmdrv.ico -n -X -r $(GLSRC)gspmdrv.icx
668
669$(GLOBJ)$(GS).res: $(GLSRC)$(GS).rc $(GLOBJ)gsos2.ico
670	rc -i $(COMPBASE)\include -i $(GLSRCDIR) -i $(GLOBJDIR) -r $(GLSRC)$(GS).rc $(GLOBJ)$(GS).res
671
672
673# PM driver program
674
675$(GLOBJ)gspmdrv.o: $(GLSRC)gspmdrv.c $(GLSRC)gspmdrv.h
676	$(COMPDIR)\$(COMP) $(CGDB) $(CO) -I$(GLSRCDIR) -o $(GLOBJ)gspmdrv.o -c $(GLSRC)gspmdrv.c
677
678$(GLOBJ)gspmdrv.res: $(GLSRC)gspmdrv.rc $(GLSRC)gspmdrv.h $(GLOBJ)gspmdrv.ico
679	rc -i $(COMPBASE)\include -i $(GLSRCDIR) -i $(GLOBJDIR) -r $(GLSRC)gspmdrv.rc $(GLOBJ)gspmdrv.res
680
681$(BINDIR)\gspmdrv.exe: $(GLOBJ)gspmdrv.o $(GLOBJ)gspmdrv.res $(GLSRC)gspmdrv.def
682	$(COMPDIR)\$(COMP) $(CGDB) $(CO) -o $(GLOBJ)gspmdrv $(GLOBJ)gspmdrv.o
683	$(COMPDIR)\emxbind -p -r$(GLOBJ)gspmdrv.res -d$(GLSRC)gspmdrv.def $(COMPDIR)\emxl.exe $(GLOBJ)gspmdrv $(BINDIR)\gspmdrv.exe
684	del $(GLOBJ)gspmdrv
685
686# Create a ZIP archive
687# This assumes that the current directory is named gs#.## relative to its
688# parent, where #.## is the Ghostscript version.
689
690ZIP_XE=zip
691ZIPPROGFILE1=gs$(GS_DOT_VERSION)\bin\gsos2.exe
692ZIPPROGFILE2=gs$(GS_DOT_VERSION)\bin\gsdll2.dll
693ZIPPROGFILE3=gs$(GS_DOT_VERSION)\bin\gspmdrv.exe
694ZIPPROGFILE4=gs$(GS_DOT_VERSION)\doc
695ZIPPROGFILE5=gs$(GS_DOT_VERSION)\examples
696ZIPPROGFILE6=gs$(GS_DOT_VERSION)\lib
697ZIPFONTDIR=fonts
698
699# Make the zip archive.
700zip:
701	cd ..
702	-del gs$(GS_VERSION)os2.zip
703	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPFONTDIR)
704	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPPROGFILE1)
705	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPPROGFILE2)
706	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPPROGFILE3)
707	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPPROGFILE4)
708	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPPROGFILE5)
709	$(ZIP_XE) -9 -r gs$(GS_VERSION)os2.zip $(ZIPPROGFILE6)
710	cd gs$(GS_DOT_VERSION)
711