1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# Copyright (C) 2001, Aladdin Enterprises. All rights reserved.
#
# This file is part of AFPL Ghostscript.
#
# AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
# distributor accepts any responsibility for the consequences of using it, or
# for whether it serves any particular purpose or works at all, unless he or
# she says so in writing. Refer to the Aladdin Free Public License (the
# "License") for full details.
#
# Every copy of AFPL Ghostscript must include a copy of the License, normally
# in a plain ASCII text file named PUBLIC. The License grants you the right
# to copy, modify and redistribute AFPL Ghostscript, but only under certain
# conditions described in the License. Among other things, the License
# requires that the copyright notice and this notice be preserved on all
# copies.
# $Id$
# Partial makefile for Unix shared object target
# Useful make commands:
# make so make ghostscript as a shared object
# make sodebug make debug ghostscript as a shared object
# make soinstall install shared object ghostscript
# make soclean remove build files
#
# If you want to test the executable without installing:
# export LD_LIBRARY_PATH=/insert-path-here/sobin
# export GS_LIB=/insert-path-here/lib
# Location for building shared object
SOOBJRELDIR=../soobj
SOBINRELDIR=../sobin
# ------------------- Ghostscript shared object --------------------------- #
# Shared object names
# simple loader (no support for display device)
GSSOC_XENAME=$(GS)c$(XE)
GSSOC_XE=$(BINDIR)/$(GSSOC_XENAME)
GSSOC=$(BINDIR)/$(SOBINRELDIR)/$(GSSOC_XENAME)
# loader suporting display device using Gtk+
GSSOX_XENAME=$(GS)x$(XE)
GSSOX_XE=$(BINDIR)/$(GSSOX_XENAME)
GSSOX=$(BINDIR)/$(SOBINRELDIR)/$(GSSOX_XENAME)
# shared library
GS_SONAME=lib$(GS).so
GS_SONAME_MAJOR=$(GS_SONAME).$(GS_VERSION_MAJOR)
GS_SONAME_MAJOR_MINOR= $(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR)
GS_SO=$(BINDIR)/$(GS_SONAME)
GS_SO_MAJOR=$(GS_SO).$(GS_VERSION_MAJOR)
GS_SO_MAJOR_MINOR=$(GS_SO_MAJOR).$(GS_VERSION_MINOR)
# Shared object is built by redefining GS_XE in a recursive make.
# Create symbolic links to the Ghostscript interpreter library
$(GS_SO): $(GS_SO_MAJOR)
$(RM_) $(GS_SO)
ln -s $(GS_SONAME_MAJOR_MINOR) $(GS_SO)
$(GS_SO_MAJOR): $(GS_SO_MAJOR_MINOR)
$(RM_) $(GS_SO_MAJOR)
ln -s $(GS_SONAME_MAJOR_MINOR) $(GS_SO_MAJOR)
# Build the small Ghostscript loaders, with Gtk+ and without
$(GSSOX_XE): $(GS_SO) $(GLSRC)dxmain.c
$(GLCC) -g `gtk-config --cflags` -o $(GSSOX_XE) $(GLSRC)dxmain.c -L$(BINDIR) -l$(GS) `gtk-config --libs`
$(GSSOC_XE): $(GS_SO) $(GLSRC)dxmainc.c
$(GLCC) -g -o $(GSSOC_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS)
# ------------------------- Recursive make targets ------------------------- #
SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -shared -Wl,-soname,$(GS_SONAME_MAJOR)'\
GS_XE=$(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR)\
STDIO_IMPLEMENTATION=c\
DISPLAY_DEV=$(DD)$(SOOBJRELDIR)/display.dev\
BINDIR=$(BINDIR)/$(SOBINRELDIR)\
GLGENDIR=$(GLGENDIR)/$(SOOBJRELDIR)\
GLOBJDIR=$(GLOBJDIR)/$(SOOBJRELDIR)\
PSGENDIR=$(PSGENDIR)/$(SOOBJRELDIR)\
PSOBJDIR=$(PSOBJDIR)/$(SOOBJRELDIR)
# Normal shared object
so: SODIRS
$(MAKE) $(SODEFS) CFLAGS='$(CFLAGS_STANDARD) $(CFLAGS_SO) $(GCFLAGS) $(XCFLAGS)' prefix=$(prefix) $(GSSOC) $(GSSOX)
# Debug shared object
# Note that this is in the same directory as the normal shared
# object, so you will need to use 'make soclean', 'make sodebug'
sodebug: SODIRS
$(MAKE) $(SODEFS) GENOPT='-DDEBUG' CFLAGS='$(CFLAGS_DEBUG) $(CFLAGS_SO) $(GCFLAGS) $(XCFLAGS)' $(GSSOC) $(GSSOX)
install-so: so
-mkdir $(prefix)
-mkdir $(datadir)
-mkdir $(gsdir)
-mkdir $(gsdatadir)
-mkdir $(bindir)
-mkdir $(libdir)
$(INSTALL_PROGRAM) $(GSSOC) $(bindir)/$(GSSOC_XENAME)
$(INSTALL_PROGRAM) $(GSSOX) $(bindir)/$(GSSOX_XENAME)
$(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR_MINOR)
$(RM_) $(libdir)/$(GS_SONAME)
ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME)
$(RM_) $(libdir)/$(GS_SONAME_MAJOR)
ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR)
soinstall: install-so install-scripts install-data
# Make the build directories
SODIRS: STDDIRS
@if test ! -d $(BINDIR)/$(SOBINRELDIR); then mkdir $(BINDIR)/$(SOBINRELDIR); fi
@if test ! -d $(GLGENDIR)/$(SOOBJRELDIR); then mkdir $(GLGENDIR)/$(SOOBJRELDIR); fi
@if test ! -d $(GLOBJDIR)/$(SOOBJRELDIR); then mkdir $(GLOBJDIR)/$(SOOBJRELDIR); fi
@if test ! -d $(PSGENDIR)/$(SOOBJRELDIR); then mkdir $(PSGENDIR)/$(SOOBJRELDIR); fi
@if test ! -d $(PSOBJDIR)/$(SOOBJRELDIR); then mkdir $(PSOBJDIR)/$(SOOBJRELDIR); fi
soclean: SODIRS
$(MAKE) $(SODEFS) clean
$(RM_) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME)
$(RM_) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR)
$(RM_) $(GSSOC)
$(RM_) $(GSSOX)
# End of unix-dll.mak
|