1#  Copyright (C) 2001-2006 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: unixlink.mak 8559 2008-02-29 08:13:08Z ray $
14# Partial makefile common to all Unix configurations.
15# This part of the makefile contains the linking steps.
16
17# Define the name of this makefile.
18UNIXLINK_MAK=$(GLSRC)unixlink.mak
19
20# The following prevents GNU make from constructing argument lists that
21# include all environment variables, which can easily be longer than
22# brain-damaged system V allows.
23
24.NOEXPORT:
25
26# ----------------------------- Main program ------------------------------ #
27
28### Interpreter main program
29
30INT_ARCHIVE_ALL=$(PSOBJ)imainarg.$(OBJ) $(PSOBJ)imain.$(OBJ) \
31 $(GLOBJ)gconfig.$(OBJ) $(GLOBJ)gscdefs.$(OBJ)
32XE_ALL=$(PSOBJ)gs.$(OBJ) $(INT_ARCHIVE_ALL) $(INT_ALL) $(DEVS_ALL)
33
34# Build a library archive for the entire interpreter.
35# This is not used in a standard build.
36liar_tr=$(GLOBJ)liar.tr
37GS_A=$(GS).a
38$(GS_A): $(obj_tr) $(ECHOGS_XE) $(INT_ARCHIVE_ALL) $(INT_ALL) $(DEVS_ALL)
39	rm -f $(GS_A)
40	$(ECHOGS_XE) -w $(liar_tr) -n - $(AR) $(ARFLAGS) $(GS_A)
41	$(ECHOGS_XE) -a $(liar_tr) -n -s $(INT_ARCHIVE_ALL) -s
42	cat $(obj_tr) >>$(liar_tr)
43	$(ECHOGS_XE) -a $(liar_tr) -s -
44	$(SH) <$(liar_tr)
45	$(RANLIB) $(GS_A)
46
47# Here is the final link step.  The stuff with LD_RUN_PATH is for SVR4
48# systems with dynamic library loading; I believe it's harmless elsewhere.
49# The resetting of the environment variables to empty strings is for SCO Unix,
50# which has limited environment space.
51ldt_tr=$(PSOBJ)ldt.tr
52$(GS_XE): $(ld_tr) $(ECHOGS_XE) $(XE_ALL) $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
53	$(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(LDFLAGS) -o $(GS_XE)
54	$(ECHOGS_XE) -a $(ldt_tr) -n -s $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) $(PSOBJ)gs.$(OBJ) -s
55	cat $(ld_tr) >>$(ldt_tr)
56	$(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS)
57	if [ x$(XLIBDIR) != x ]; then LD_RUN_PATH=$(XLIBDIR); export LD_RUN_PATH; fi; \
58	XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
59	FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \
60	DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \
61	DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \
62	DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \
63	DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \
64	DEVICE_DEVS_EXTRA= \
65	$(SH) <$(ldt_tr)
66