1#  Copyright (C) 2001-2009 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: gs.mak 10319 2009-11-11 17:42:22Z robin $
14# Generic makefile, common to all platforms, products, and configurations.
15# The platform-specific makefiles `include' this file.
16
17# Ghostscript makefiles cannot use default compilation rules, because
18# they may place the output in (multiple) different directories.
19# All compilation rules must have the form
20#	<<compiler>> $(O_)<<output_file>> $(C_)<<input_file>>
21# to cope with the divergent syntaxes of the various compilers.
22# Spaces must appear where indicated, and nowhere else; in particular,
23# there must be no space between $(O_) and the output file name.
24
25# The platform-specific makefiles define the following symbols:
26#	GS - the name of the executable (without the extension, if any).
27#	GS_LIB_DEFAULT - the default directory/ies for searching for the
28#	    initialization and font files at run time.
29#	GS_DEV_DEFAULT - array of default device names, in order of
30#	    preference. If empty the first DEVICE_DEV will be used.
31#	GS_CACHE_DIR - the default directory for caching data between
32#	    ghostscript invocations.
33#	SEARCH_HERE_FIRST - the default setting of -P (whether or not to
34#	    look for files in the current directory first).
35#	GS_DOCDIR - the directory where documentation will be available
36#	    at run time.
37#	JSRCDIR - the directory where the IJG JPEG library source code
38#	    is stored (at compilation time).
39#	PNGSRCDIR - the same for libpng.
40#	ZSRCDIR - the same for zlib.
41#	SHARE_JPEG - normally 0; if set to 1, asks the linker to use
42#	    an existing compiled libjpeg (-ljpeg) instead of compiling and
43#	    linking libjpeg explicitly.  (We strongly recommend against
44#	    doing this: see Make.htm details.)
45#	JPEG_NAME - the name of the shared library, currently always
46#	    jpeg (libjpeg, -lpjeg).
47#	SHARE_LIBPNG - normally 0; if set to 1, asks the linker to use
48#	    an existing compiled libpng (-lpng) instead of compiling and
49#	    linking libpng explicitly.
50#	LIBPNG_NAME, the name of the shared libpng, currently always
51#	    png (libpng, -lpng).
52#	SHARE_ZLIB - normally 0; if set to 1, asks the linker to use
53#	    an existing compiled zlib (-lgz or -lz) instead of compiling
54#	    and linking libgz/libz explicitly.
55#	ZLIB_NAME - the name of the shared zlib, either gz (for libgz, -lgz)
56#	    or z (for libz, -lz).
57#	JBIG2_LIB - choice of which jbig2 implementation to use
58#	SHARE_JBIG2 - normally 0; if set to 1, asks the linker to use
59#	    an existing complied libjbig2dec instead of compiling and linking
60#	    in from a local copy of the source
61#	JBIG2SRCDIR - the name of the jbig2dec library source directory
62#	    typically 'jbig2dec' or 'jbig2dec-/version/'
63#	JPX_LIB - choice of which jpeg2k implementation to use
64#	SHARE_JPX - if set to 1, asks the linker to use an existing
65#	    complied jpeg2k library. if set to 0, asks to compile and
66#	    link from a local copy of the source using our custom
67#	    makefile.
68#	JPXSRCDIR - the name of the jpeg2k library source directory
69#	    e.g. 'jasper' or 'jasper-/version/'
70#	JPX_CFLAGS - any platform-specific flags that are required
71#	    to properly compile in the jpeg2k library source
72#	ICCSRCDIR - the name of the ICC lib source dir, currently
73#	    always icclib (compiled in statically)
74#	IMDISRCDIR - the name of the IMDI lib source directory
75#	    generally 'imdi'
76#	DEVICE_DEVS - the devices to include in the executable.
77#	    See devs.mak for details.
78#	DEVICE_DEVS1...DEVICE_DEVS21 - additional devices, if the definition
79#	    of DEVICE_DEVS doesn't fit on one line.  See devs.mak for details.
80#	FEATURE_DEVS - what features to include in the executable.
81#	    Normally this is one of:
82#		    $(PSD)psl1.dev - a PostScript Level 1 language interpreter.
83#		    $(PSD)psl2.dev - a PostScript Level 2 language interpreter.
84#		    $(PSD)psl3.dev - a PostScript LanguageLevel 3 language
85#		      interpreter.
86#	      and/or
87#		    pdf - a PDF 1.2 interpreter.
88#	    psl3 includes everything in psl2, and psl2 includes everything
89#	      in psl1.  For backward compatibility, level1 is a synonym for
90#	      psl1, and level2 is a synonym for psl2.
91#	    The remaining features are of interest primarily to developers
92#	      who want to "mix and match" features to create custom
93#	      configurations:
94#		    btoken - support for binary token encodings.
95#			Included automatically in the dps and psl2 features.
96#		    cidfont - (currently partial) support for CID-keyed fonts.
97#		    color - support for the Level 1 CMYK color extensions.
98#			Included automatically in the dps and psl2 features.
99#		    compfont - support for composite (type 0) fonts.
100#			Included automatically in the psl2 feature.
101#		    dct - support for DCTEncode/Decode filters.
102#			Included automatically in the psl2 feature.
103#                   diskn - support for %disk IODevice emulation. Adds support
104#                       for %disk0 thru %disk9. Use requires setting the /Root
105#                       paramter for each %disk (see Language.htm).
106#		    dps - (partial) support for Display PostScript extensions:
107#			see Language.htm for details.
108#		    dpsnext - (partial) support for Display PostScript
109#			extensions with NeXT's additions.
110#		    epsf - support for recognizing and skipping the binary
111#			header of MS-DOS EPSF files.
112#		    filter - support for Level 2 filters (other than eexec,
113#			ASCIIHexEncode/Decode, NullEncode, PFBDecode,
114#			RunLengthEncode/Decode, and SubFileDecode, which are
115#			always included, and DCTEncode/Decode,
116#			which are separate).
117#			Included automatically in the psl2 feature.
118#		    fzlib - support for zlibEncode/Decode filters.
119#		    ttfont - support for TrueType fonts.
120#		    type1 - support for Type 1 fonts and eexec;
121#			normally included automatically in all configurations.
122#		    type32 - support for Type 32 (downloaded bitmap) fonts.
123#			Included automatically in the psl2 feature.
124#		    type42 - support for Type 42 (embedded TrueType) fonts.
125#			Included automatically in the psl2 feature.
126#                   fapi - Font API (3d party font renderer interface).
127#		There are quite a number of other sub-features that can be
128#		selectively included in or excluded from a configuration,
129#		but the above are the ones that are most likely to be of
130#		interest.
131#	COMPILE_INITS - normally 1; compiles the PostScript language
132#	    initialization files (gs_init.ps et al) and Resource/* tree
133#	    into the executable, eliminating the need for these files
134#	    to be present at run time. Files will be placed in the
135#	    %rom% device.
136#	BAND_LIST_STORAGE - normally file; if set to memory, stores band
137#	    lists in memory (with compression if needed).
138#	BAND_LIST_COMPRESSOR - normally zlib: selects the compression method
139#	    to use for band lists in memory.
140#	FILE_IMPLEMENTATION - normally stdio; if set to fd, uses file
141#	    descriptors instead of buffered stdio for file I/O; if set to
142#	    both, provides both implementations with different procedure
143#	    names for the fd-based implementation (see sfxfd.c for
144#	    more information).
145#	STDIO_IMPLEMENTATION - normally 'c' which uses callouts and
146#	    ziodevsc.c, but ghostscript library must use '' for file
147#	    based stdio in ziodevs.c.
148#           Callouts use procedure based streams and return back to
149#           to gs_main_interpret() in imain.c whenever stdio is needed.
150#
151# It is very unlikely that anyone would want to edit the remaining
152#   symbols, but we describe them here for completeness:
153#	GS_INIT - the name of the initialization file for the interpreter,
154#		normally gs_init.ps.
155#	PLATFORM - a "device" name for the platform, so that platforms can
156#		add various kinds of resources like devices and features.
157#	CMD - the suffix for shell command files (e.g., null or .bat).
158#		(This is only needed in a few places.)
159#	D - the directory separator character (\ for MS-DOS, / for Unix).
160#	O_ - the string for specifying the output file from the C compiler
161#		(-o for MS-DOS, -o ./ for Unix).
162#	OBJ - the extension for relocatable object files (e.g., o or obj).
163#	XE - the extension for executable files (e.g., null or .exe).
164#	XEAUX - the extension for the executable files (e.g., null or .exe)
165#		for the utility programs (those compiled with CCAUX).
166#	BEGINFILES - the list of additional files that `make clean' should
167#		delete.
168#	CCAUX - the C invocation for auxiliary programs (echogs, genarch,
169#		genconf, gendev, genht, geninit).
170#	CC_ - the C invocation for normal compilation.
171#	CCD - the C invocation for files that store into frame buffers or
172#		device registers.  Needed because some optimizing compilers
173#		will eliminate necessary stores.
174#	CCINT - the C invocation for compiling the main interpreter module,
175#		normally the same as CC_: this is needed because the
176#		Borland compiler generates *worse* code for this module
177#		(but only this module) when optimization (-O) is turned on.
178#	AK - if a particular platform requires any programs or data files
179#		to be built before compiling the source code, AK must list
180#		them.
181#	EXP - the prefix for invoking an executable program in a specified
182#		directory (MCR on OpenVMS, null on all other platforms).
183#	SH - the shell for scripts (null on MS-DOS, sh on Unix).
184#	CONFILES - the arguments for genconf to generate the appropriate
185#		linker control files (various).
186#	CONFLDTR - the genconf switch for generating ld_tr.
187#	CP_ - the command for copying one file to another.  Because of
188#		limitations in the MS-DOS/MS Windows environment, the
189#		second argument must be either '.' (in which case the
190#		write date may be either preserved or set to the current
191#		date) or a file name (in which case the write date is
192#		always updated).
193#	RM_ - the command for deleting (a) file(s) (including wild cards,
194#		but limited to a single file or pattern).
195#	RMN_ = the command for deleting multiple files / patterns.
196#
197# The platform-specific makefiles must also include rules for creating
198# certain dynamically generated files:
199#	gconfig_.h - this indicates the presence or absence of
200#	    certain system header files that are located in different
201#	    places on different systems.  (It could be generated by
202#	    the GNU `configure' program.)
203#	gconfigd.h - this is used for configuration-specific definitions
204#	    such as paths that must be defined by all top-level makefiles.
205
206#**************** PATCHES
207JGENDIR=$(GLGENDIR)
208JOBJDIR=$(GLOBJDIR)
209PNGGENDIR=$(GLGENDIR)
210PNGOBJDIR=$(GLOBJDIR)
211ZGENDIR=$(GLGENDIR)
212ZOBJDIR=$(GLOBJDIR)
213TIFFGENDIR=$(GLGENDIR)
214TIFFOBJDIR=$(GLOBJDIR)
215JBIG2GENDIR=$(GLGENDIR)
216JBIG2OBJDIR=$(GLOBJDIR)
217JPXGENDIR=$(GLGENDIR)
218JPXOBJDIR=$(GLOBJDIR)
219ICCGENDIR=$(GLGENDIR)
220ICCOBJDIR=$(GLOBJDIR)
221EXPATGENDIR=$(GLGENDIR)
222EXPATOBJDIR=$(GLOBJDIR)
223IJSGENDIR=$(GLGENDIR)
224IJSOBJDIR=$(GLOBJDIR)
225#**************** END PATCHES
226
227GSGEN=$(GLGENDIR)$(D)
228GSOBJ=$(GLOBJDIR)$(D)
229# All top-level makefiles define DD.
230#DD=$(GLGEN)
231
232# Define the name of this makefile.
233GS_MAK=$(GLSRCDIR)$(D)gs.mak
234
235# Define the names of the executables.
236GS_XE=$(BINDIR)$(D)$(GS)$(XE)
237AUXGENDIR=$(GLGENDIR)
238AUXGEN=$(AUXGENDIR)$(D)
239ECHOGS_XE=$(AUXGEN)echogs$(XEAUX)
240GENARCH_XE=$(AUXGEN)genarch$(XEAUX)
241GENCONF_XE=$(AUXGEN)genconf$(XEAUX)
242GENDEV_XE=$(AUXGEN)gendev$(XEAUX)
243GENHT_XE=$(AUXGEN)genht$(XEAUX)
244GENINIT_XE=$(AUXGEN)geninit$(XEAUX)
245MKROMFS_XE=$(AUXGEN)mkromfs$(XEAUX)
246
247# Define the names of the generated header files.
248# gconfig*.h and gconfx*.h are generated dynamically.
249gconfig_h=$(GLGENDIR)$(D)gconfxx.h
250gconfigf_h=$(GLGENDIR)$(D)gconfxc.h
251gconfigd_h=$(GLGENDIR)$(D)gconfigd.h
252
253all default : $(GS_XE) $(GS_SHARED_OBJS)
254	$(NO_OP)
255
256# the distclean and maintainer-clean targets (if any)
257# are the responsibility of the platform-specific
258# makefiles. We only handle the internal build system
259# apparatus here.
260realclean : clean
261	$(NO_OP)
262
263clean : mostlyclean
264	$(RM_) $(GSGEN)arch.h
265	$(RM_) $(GS_XE)
266	$(RM_) $(GS_SHARED_OBJS)
267
268#****** FOLLOWING IS WRONG, NEEDS TO BE PER-SUBSYSTEM ******
269mostlyclean : config-clean
270	$(RMN_) $(GSOBJ)*.$(OBJ) $(GSOBJ)*.a $(GSOBJ)core $(GSOBJ)gmon.out
271	$(RMN_) $(GSGEN)deflate.h $(GSGEN)zutil.h
272	$(RMN_) $(GSGEN)gconfig*.c $(GSGEN)gscdefs*.c $(GSGEN)iconfig*.c
273	$(RMN_) $(GSGEN)_temp_* $(GSGEN)_temp_*.* $(GSOBJ)*.map $(GSOBJ)*.sym
274	$(RMN_) $(GENARCH_XE) $(GENCONF_XE) $(GENDEV_XE) $(GENHT_XE) $(GENINIT_XE)
275	$(RMN_) $(ECHOGS_XE)
276	$(RMN_) $(GSGEN)gs_init.ps $(BEGINFILES)
277	$(RMN_) $(MKROMFS_XE)
278	$(RMN_) $(PSGEN)$(GS_INIT)
279	$(RMN_) $(GSGEN)gsromfs1.c
280
281# Remove only configuration-dependent information.
282#****** FOLLOWING IS WRONG, NEEDS TO BE PER-SUBSYSTEM ******
283config-clean :
284	$(RMN_) $(GSGEN)*.dev $(GSGEN)devs*.tr $(GSGEN)gconfig*.h
285	$(RMN_) $(GSGEN)gconfx*.h $(GSGEN)j*.h
286	$(RMN_) $(GSGEN)c*.tr $(GSGEN)o*.tr $(GSGEN)l*.tr
287
288# Macros for constructing the *.dev files that describe features and
289# devices.
290SETDEV=$(EXP)$(ECHOGS_XE) -e .dev -w- -l-dev -b -s -l-obj
291SETPDEV=$(EXP)$(ECHOGS_XE) -e .dev -w- -l-dev -b -s -l-include -l$(GLGENDIR)$(D)page -l-obj
292SETDEV2=$(EXP)$(ECHOGS_XE) -e .dev -w- -l-dev2 -b -s -l-obj
293SETPDEV2=$(EXP)$(ECHOGS_XE) -e .dev -w- -l-dev2 -b -s -l-include -l$(GLGENDIR)$(D)page -l-obj
294SETMOD=$(EXP)$(ECHOGS_XE) -e .dev -w- -l-obj
295ADDMOD=$(EXP)$(ECHOGS_XE) -e .dev -a- $(NULL)
296SETCOMP=$(EXP)$(ECHOGS_XE) -e .dev -w- -l-comp
297ADDCOMP=$(EXP)$(ECHOGS_XE) -e .dev -a- -l-comp
298
299# Define the search lists and compilation switches for the third-party
300# libraries, and the compilation switches for their clients.
301# The search lists must be enclosed in $(I_) and $(_I).
302# Note that we can't define the entire compilation command,
303# because this must include $(GLSRCDIR), which isn't defined yet.
304ICCI_=$(ICCSRCDIR)
305ICCF_=
306# Currently there is no option for sharing icclib.
307ICCCF_=
308IJSI_=$(IJSSRCDIR)
309IJSF_=
310# Currently there is no option for sharing ijs.
311IJSCF_=
312JI_=$(JSRCDIR)
313JF_=
314JCF_=$(D_)SHARE_JPEG=$(SHARE_JPEG)$(_D)
315PI_=$(PNGSRCDIR) $(II)$(ZSRCDIR)
316# PF_ should include PNG_USE_CONST, but this doesn't work.
317#PF_=-DPNG_USE_CONST
318TI_=$(TIFFSRCDIR)$(D)libtiff $(II)$(JGENDIR)  $(II)$(ZSRCDIR)
319PF_=
320PCF_=$(D_)SHARE_LIBPNG=$(SHARE_LIBPNG)$(_D)
321ZI_=$(ZSRCDIR)
322ZF_=
323ZCF_=$(D_)SHARE_ZLIB=$(SHARE_ZLIB)$(_D)
324JB2I_=$(JBIG2SRCDIR)
325JB2CF_=$(JBIG2_CFLAGS)
326LDF_JB2I_=$(JBIG2SRCDIR)$(D)source$(D)libraries
327JPXI_=$(JPXSRCDIR)$(D)src$(D)libjasper$(D)include
328LWF_JPXI_=$(JPXSRCDIR)$(D)library$(D)source
329JPXCF_=$(JPX_CFLAGS)
330
331######################## How to define new 'features' #######################
332#
333# One defines new 'features' exactly like devices (see devs.mak for details).
334# For example, one would define a feature abc by adding the following to
335# gs.mak:
336#
337#	abc_=abc1.$(OBJ) ...
338#	$(PSD)abc.dev : $(GS_MAK) $(ECHOGS_XE) $(abc_)
339#		$(SETMOD) $(PSD)abc $(abc_)
340#		$(ADDMOD) $(PSD)abc -obj ... [if needed]
341#		$(ADDMOD) $(PSD)abc -oper ... [if appropriate]
342#		$(ADDMOD) $(PSD)abc -ps ... [if appropriate]
343#
344# Use PSD for interpreter-related features, GLD for library-related.
345# If the abc feature requires the presence of some other features jkl and
346# pqr, then the rules must look like this:
347#
348#	abc_=abc1.$(OBJ) ...
349#	$(PSD)abc.dev : $(GS_MAK) $(ECHOGS_XE) $(abc_)\
350#	 $(PSD)jkl.dev $(PSD)pqr.dev
351#		$(SETMOD) $(PSD)abc $(abc_)
352#		...
353#		$(ADDMOD) $(PSD)abc -include $(PSD)jkl
354#		$(ADDMOD) $(PSD)abc -include $(PSD)pqr
355
356# --------------------- Configuration-dependent files --------------------- #
357
358# gconfig.h shouldn't have to depend on DEVS_ALL, but that would
359# involve rewriting gsconfig to only save the device name, not the
360# contents of the <device>.dev files.
361# FEATURE_DEVS must precede DEVICE_DEVS so that devices can override
362# features in obscure cases.
363
364# FEATURE_DEVS_EXTRA and DEVICE_DEVS_EXTRA are explicitly reserved
365# to be set from the command line.
366FEATURE_DEVS_EXTRA=
367DEVICE_DEVS_EXTRA=
368
369DEVS_ALL=$(GLGENDIR)$(D)$(PLATFORM).dev\
370 $(FEATURE_DEVS) $(FEATURE_DEVS_EXTRA) \
371 $(DEVICE_DEVS) $(DEVICE_DEVS1) \
372 $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5) \
373 $(DEVICE_DEVS6) $(DEVICE_DEVS7) $(DEVICE_DEVS8) $(DEVICE_DEVS9) \
374 $(DEVICE_DEVS10) $(DEVICE_DEVS11) $(DEVICE_DEVS12) $(DEVICE_DEVS13) \
375 $(DEVICE_DEVS14) $(DEVICE_DEVS15) $(DEVICE_DEVS16) $(DEVICE_DEVS17) \
376 $(DEVICE_DEVS18) $(DEVICE_DEVS19) $(DEVICE_DEVS20) $(DEVICE_DEVS21) \
377 $(DEVICE_DEVS_EXTRA) $(GLD)romfs$(COMPILE_INITS).dev
378
379devs_tr=$(GLGENDIR)$(D)devs.tr
380$(devs_tr) : $(GS_MAK) $(TOP_MAKEFILES) $(ECHOGS_XE)
381	$(EXP)$(ECHOGS_XE) -w $(devs_tr) - -include $(GLGENDIR)$(D)$(PLATFORM)
382	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(FEATURE_DEVS)
383	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(FEATURE_DEVS_EXTRA)
384	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS)
385	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS1)
386	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS2)
387	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS3)
388	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS4)
389	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS5)
390	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS6)
391	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS7)
392	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS8)
393	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS9)
394	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS10)
395	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS11)
396	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS12)
397	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS13)
398	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS14)
399	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS15)
400	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS16)
401	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS17)
402	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS18)
403	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS19)
404	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS20)
405	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS21)
406	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(DEVICE_DEVS_EXTRA)
407	$(EXP)$(ECHOGS_XE) -a $(devs_tr) -+ $(GLD)romfs$(COMPILE_INITS).dev
408	$(EXP)$(ECHOGS_XE) -a $(devs_tr) - $(GLGENDIR)$(D)libcore
409
410# GCONFIG_EXTRAS can be set on the command line.
411# Note that it consists of arguments for echogs, i.e.,
412# it isn't just literal text.
413GCONFIG_EXTRAS=
414
415ld_tr=$(GLGENDIR)$(D)ld.tr
416$(ld_tr) : \
417  $(GS_MAK) $(TOP_MAKEFILES) $(GLSRCDIR)$(D)version.mak $(GENCONF_XE) $(ECHOGS_XE) $(devs_tr) $(DEVS_ALL) $(GLGENDIR)$(D)libcore.dev
418	$(EXP)$(GENCONF_XE) $(devs_tr) -h /dev/stdout $(CONFILES) $(CONFLDTR) $(ld_tr) | awk 'BEGIN{j=0; p=1;} /jpeg_device/ {if(j++ > 0) p=0;} // {if(p==1) { print; } else { p=1 } }' > $(gconfig_h)
419	$(EXP)$(ECHOGS_XE) -a $(gconfig_h) $(GCONFIG_EXTRAS)
420
421$(gconfig_h) : $(ld_tr)
422	$(NO_OP)
423
424# The line above is an empty command; don't delete.
425
426# save our set of makefile variables that are defined in every build (paths, etc.)
427$(gconfigd_h) : $(ECHOGS_XE) $(GS_MAK) $(TOP_MAKEFILES) $(GLSRCDIR)$(D)version.mak
428	$(EXP)$(ECHOGS_XE) -w $(gconfigd_h) -x 23 define -s -u GS_LIB_DEFAULT -x 2022 $(GS_LIB_DEFAULT) -x 22
429	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_DEV_DEFAULT -x 2022 $(GS_DEV_DEFAULT) -x 22
430	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_CACHE_DIR -x 2022 $(GS_CACHE_DIR) -x 22
431	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u SEARCH_HERE_FIRST -s $(SEARCH_HERE_FIRST)
432	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_DOCDIR -x 2022 $(GS_DOCDIR) -x 22
433	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_INIT -x 2022 $(GS_INIT) -x 22
434	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_REVISION -s $(GS_REVISION)
435	$(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_REVISIONDATE -s $(GS_REVISIONDATE)
436
437obj_tr=$(GLGENDIR)$(D)obj.tr
438$(obj_tr) : $(ld_tr)
439	$(EXP)$(GENCONF_XE) $(devs_tr) $(CONFILES) -o $(obj_tr)
440