xref: /plan9-contrib/sys/src/cmd/gs/src/unixlink.mak (revision d46c239f8612929b7dbade67d0d071633df3a15d)
1#    Copyright (C) 1990, 1995, 1996, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
2#
3# This file is part of AFPL Ghostscript.
4#
5# AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
6# distributor accepts any responsibility for the consequences of using it, or
7# for whether it serves any particular purpose or works at all, unless he or
8# she says so in writing.  Refer to the Aladdin Free Public License (the
9# "License") for full details.
10#
11# Every copy of AFPL Ghostscript must include a copy of the License, normally
12# in a plain ASCII text file named PUBLIC.  The License grants you the right
13# to copy, modify and redistribute AFPL Ghostscript, but only under certain
14# conditions described in the License.  Among other things, the License
15# requires that the copyright notice and this notice be preserved on all
16# copies.
17
18# $Id: unixlink.mak,v 1.3 2000/11/28 00:14:48 raph Exp $
19# Partial makefile common to all Unix configurations.
20# This part of the makefile contains the linking steps.
21
22# Define the name of this makefile.
23UNIXLINK_MAK=$(GLSRC)unixlink.mak
24
25# The following prevents GNU make from constructing argument lists that
26# include all environment variables, which can easily be longer than
27# brain-damaged system V allows.
28
29.NOEXPORT:
30
31# ----------------------------- Main program ------------------------------ #
32
33### Library files and archive
34
35LIB_ARCHIVE_ALL=$(LIB_ALL) $(DEVS_ALL)\
36 $(GLOBJ)gsnogc.$(OBJ) $(GLOBJ)gconfig.$(OBJ) $(GLOBJ)gscdefs.$(OBJ)
37
38# Build an archive for the library only.
39# This is not used in a standard build.
40GSLIB_A=$(GS)lib.a
41$(GSLIB_A): $(LIB_ARCHIVE_ALL)
42	rm -f $(GSLIB_A)
43	$(AR) $(ARFLAGS) $(GSLIB_A) $(LIB_ARCHIVE_ALL)
44	$(RANLIB) $(GSLIB_A)
45
46### Interpreter main program
47
48INT_ARCHIVE_ALL=$(PSOBJ)imainarg.$(OBJ) $(PSOBJ)imain.$(OBJ) $(INT_ALL) $(DEVS_ALL)\
49 $(GLOBJ)gconfig.$(OBJ) $(GLOBJ)gscdefs.$(OBJ)
50XE_ALL=$(PSOBJ)gs.$(OBJ) $(INT_ARCHIVE_ALL)
51
52# Build a library archive for the entire interpreter.
53# This is not used in a standard build.
54GS_A=$(GS).a
55$(GS_A): $(INT_ARCHIVE_ALL)
56	rm -f $(GS_A)
57	$(AR) $(ARFLAGS) $(GS_A) $(INT_ARCHIVE_ALL)
58	$(RANLIB) $(GS_A)
59
60# Here is the final link step.  The stuff with LD_RUN_PATH is for SVR4
61# systems with dynamic library loading; I believe it's harmless elsewhere.
62# The resetting of the environment variables to empty strings is for SCO Unix,
63# which has limited environment space.
64ldt_tr=$(PSOBJ)ldt.tr
65$(GS_XE): $(ld_tr) $(ECHOGS_XE) $(XE_ALL)
66	$(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(LDFLAGS) -o $(GS_XE)
67	$(ECHOGS_XE) -a $(ldt_tr) -n -s $(PSOBJ)gs.$(OBJ) -s
68	cat $(ld_tr) >>$(ldt_tr)
69	$(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS)
70	if [ x$(XLIBDIR) != x ]; then LD_RUN_PATH=$(XLIBDIR); export LD_RUN_PATH; fi; \
71	XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
72	FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \
73	DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \
74	DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \
75	DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \
76	DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \
77	$(SH) <$(ldt_tr)
78