xref: /plan9/sys/src/cmd/gs/src/unixlink.mak (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1#    Copyright (C) 1990, 1995, 1996, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
2#
3# This software is provided AS-IS with no warranty, either express or
4# implied.
5#
6# This software is distributed under license and may not be copied,
7# modified or distributed except as expressly authorized under the terms
8# of the license contained in the file LICENSE in this distribution.
9#
10# For more information about licensing, please refer to
11# http://www.ghostscript.com/licensing/. For information on
12# commercial licensing, go to http://www.artifex.com/licensing/ or
13# contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14# San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15
16# $Id: unixlink.mak,v 1.7 2004/11/22 19:36:06 giles Exp $
17# Partial makefile common to all Unix configurations.
18# This part of the makefile contains the linking steps.
19
20# Define the name of this makefile.
21UNIXLINK_MAK=$(GLSRC)unixlink.mak
22
23# The following prevents GNU make from constructing argument lists that
24# include all environment variables, which can easily be longer than
25# brain-damaged system V allows.
26
27.NOEXPORT:
28
29# ----------------------------- Main program ------------------------------ #
30
31### Interpreter main program
32
33INT_ARCHIVE_ALL=$(PSOBJ)imainarg.$(OBJ) $(PSOBJ)imain.$(OBJ) \
34 $(GLOBJ)gconfig.$(OBJ) $(GLOBJ)gscdefs.$(OBJ)
35XE_ALL=$(PSOBJ)gs.$(OBJ) $(INT_ARCHIVE_ALL) $(INT_ALL) $(DEVS_ALL)
36
37# Build a library archive for the entire interpreter.
38# This is not used in a standard build.
39liar_tr=$(GLOBJ)liar.tr
40GS_A=$(GS).a
41$(GS_A): $(obj_tr) $(ECHOGS_XE) $(INT_ARCHIVE_ALL) $(INT_ALL) $(DEVS_ALL)
42	rm -f $(GS_A)
43	$(ECHOGS_XE) -w $(liar_tr) -n - $(AR) $(ARFLAGS) $(GS_A)
44	$(ECHOGS_XE) -a $(liar_tr) -n -s $(INT_ARCHIVE_ALL) -s
45	cat $(obj_tr) >>$(liar_tr)
46	$(ECHOGS_XE) -a $(liar_tr) -s -
47	$(SH) <$(liar_tr)
48	$(RANLIB) $(GS_A)
49
50# Here is the final link step.  The stuff with LD_RUN_PATH is for SVR4
51# systems with dynamic library loading; I believe it's harmless elsewhere.
52# The resetting of the environment variables to empty strings is for SCO Unix,
53# which has limited environment space.
54ldt_tr=$(PSOBJ)ldt.tr
55$(GS_XE): $(ld_tr) $(ECHOGS_XE) $(XE_ALL)
56	$(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(LDFLAGS) -o $(GS_XE)
57	$(ECHOGS_XE) -a $(ldt_tr) -n -s $(PSOBJ)gs.$(OBJ) -s
58	cat $(ld_tr) >>$(ldt_tr)
59	$(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS)
60	if [ x$(XLIBDIR) != x ]; then LD_RUN_PATH=$(XLIBDIR); export LD_RUN_PATH; fi; \
61	XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
62	FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \
63	DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \
64	DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \
65	DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \
66	DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \
67	DEVICE_DEVS_EXTRA= \
68	$(SH) <$(ldt_tr)
69