~ubuntu-branches/ubuntu/vivid/python-reportlab/vivid-proposed

« back to all changes in this revision

Viewing changes to src/rl_addons/rl_accel/Makefile.pre.in

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-01-12 02:16:21 UTC
  • mfrom: (1.2.9) (4.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20140112021621-f4mpp5qaj1dkq2yb
Tags: 2.8~20140112-1
* New upstream snapshot.
* Build python3 packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Universal Unix Makefile for Python extensions
2
 
# =============================================
3
 
 
4
 
# Short Instructions
5
 
# ------------------
6
 
 
7
 
# 1. Build and install Python (1.5 or newer).
8
 
# 2. "make -f Makefile.pre.in boot"
9
 
# 3. "make"
10
 
# You should now have a shared library.
11
 
 
12
 
# Long Instructions
13
 
# -----------------
14
 
 
15
 
# Build *and install* the basic Python 1.5 distribution.  See the
16
 
# Python README for instructions.  (This version of Makefile.pre.in
17
 
# only withs with Python 1.5, alpha 3 or newer.)
18
 
 
19
 
# Create a file Setup.in for your extension.  This file follows the
20
 
# format of the Modules/Setup.in file; see the instructions there.
21
 
# For a simple module called "spam" on file "spammodule.c", it can
22
 
# contain a single line:
23
 
#   spam spammodule.c
24
 
# You can build as many modules as you want in the same directory --
25
 
# just have a separate line for each of them in the Setup.in file.
26
 
 
27
 
# If you want to build your extension as a shared library, insert a
28
 
# line containing just the string
29
 
#   *shared*
30
 
# at the top of your Setup.in file.
31
 
 
32
 
# Note that the build process copies Setup.in to Setup, and then works
33
 
# with Setup.  It doesn't overwrite Setup when Setup.in is changed, so
34
 
# while you're in the process of debugging your Setup.in file, you may
35
 
# want to edit Setup instead, and copy it back to Setup.in later.
36
 
# (All this is done so you can distribute your extension easily and
37
 
# someone else can select the modules they actually want to build by
38
 
# commenting out lines in the Setup file, without editing the
39
 
# original.  Editing Setup is also used to specify nonstandard
40
 
# locations for include or library files.)
41
 
 
42
 
# Copy this file (Misc/Makefile.pre.in) to the directory containing
43
 
# your extension.
44
 
 
45
 
# Run "make -f Makefile.pre.in boot".  This creates Makefile
46
 
# (producing Makefile.pre and sedscript as intermediate files) and
47
 
# config.c, incorporating the values for sys.prefix, sys.exec_prefix
48
 
# and sys.version from the installed Python binary.  For this to work,
49
 
# the python binary must be on your path.  If this fails, try
50
 
#   make -f Makefile.pre.in Makefile VERSION=1.5 installdir=<prefix>
51
 
# where <prefix> is the prefix used to install Python for installdir
52
 
# (and possibly similar for exec_installdir=<exec_prefix>).
53
 
 
54
 
# Note: "make boot" implies "make clobber" -- it assumes that when you
55
 
# bootstrap you may have changed platforms so it removes all previous
56
 
# output files.
57
 
 
58
 
# If you are building your extension as a shared library (your
59
 
# Setup.in file starts with *shared*), run "make" or "make sharedmods"
60
 
# to build the shared library files.  If you are building a statically
61
 
# linked Python binary (the only solution of your platform doesn't
62
 
# support shared libraries, and sometimes handy if you want to
63
 
# distribute or install the resulting Python binary), run "make
64
 
# python".
65
 
 
66
 
# Note: Each time you edit Makefile.pre.in or Setup, you must run
67
 
# "make Makefile" before running "make".
68
 
 
69
 
# Hint: if you want to use VPATH, you can start in an empty
70
 
# subdirectory and say (e.g.):
71
 
#   make -f ../Makefile.pre.in boot srcdir=.. VPATH=..
72
 
 
73
 
 
74
 
# === Bootstrap variables (edited through "make boot") ===
75
 
 
76
 
# The prefix used by "make inclinstall libainstall" of core python
77
 
installdir=     /depot/sundry/
78
 
 
79
 
# The exec_prefix used by the same
80
 
exec_installdir=$(installdir)
81
 
 
82
 
# Source directory and VPATH in case you want to use VPATH.
83
 
# (You will have to edit these two lines yourself -- there is no
84
 
# automatic support as the Makefile is not generated by
85
 
# config.status.)
86
 
srcdir=         .
87
 
VPATH=          .
88
 
 
89
 
# === Variables that you may want to customize (rarely) ===
90
 
 
91
 
# (Static) build target
92
 
TARGET=         python
93
 
 
94
 
# Installed python binary (used only by boot target)
95
 
PYTHON=         python
96
 
 
97
 
# Add more -I and -D options here
98
 
CFLAGS=         $(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY) $(DEFS)
99
 
 
100
 
# These two variables can be set in Setup to merge extensions.
101
 
# See example[23].
102
 
BASELIB=        
103
 
BASESETUP=      
104
 
 
105
 
# Modes for directories, executables and data files created by the
106
 
# install process.  Default to group-writable directories but
107
 
# user-only-writable for executables and data files.
108
 
DIRMODE=        775
109
 
EXEMODE=        755
110
 
FILEMODE=       644
111
 
 
112
 
# Portable install script (configure doesn't always guess right)
113
 
INSTALL=        @srcdir@/install-sh -c
114
 
INSTALL_PROGRAM=${INSTALL} -m $(EXEMODE)
115
 
INSTALL_DATA=   ${INSTALL} -m $(FILEMODE)
116
 
 
117
 
# === Variables set by makesetup ===
118
 
 
119
 
MODOBJS=        _MODOBJS_
120
 
MODLIBS=        _MODLIBS_
121
 
 
122
 
# === Definitions added by makesetup ===
123
 
 
124
 
# === Variables from configure (through sedscript) ===
125
 
 
126
 
VERSION=        @VERSION@
127
 
CC=             @CC@
128
 
LINKCC=         @LINKCC@
129
 
SGI_ABI=        @SGI_ABI@
130
 
OPT=            @OPT@
131
 
LDFLAGS=        @LDFLAGS@
132
 
LDLAST=         @LDLAST@
133
 
DEFS=           @DEFS@
134
 
LIBS=           @LIBS@
135
 
LIBM=           @LIBM@
136
 
LIBC=           @LIBC@
137
 
RANLIB=         @RANLIB@
138
 
MACHDEP=        @MACHDEP@
139
 
SO=             @SO@
140
 
LDSHARED=       @LDSHARED@
141
 
CCSHARED=       @CCSHARED@
142
 
LINKFORSHARED=  @LINKFORSHARED@
143
 
#@SET_CCC@
144
 
 
145
 
# Install prefix for architecture-independent files
146
 
prefix=         /usr/local
147
 
 
148
 
# Install prefix for architecture-dependent files
149
 
exec_prefix=    $(prefix)
150
 
 
151
 
# === Fixed definitions ===
152
 
 
153
 
# Shell used by make (some versions default to the login shell, which is bad)
154
 
SHELL=          /bin/sh
155
 
 
156
 
# Expanded directories
157
 
BINDIR=         $(exec_installdir)/bin
158
 
LIBDIR=         $(exec_prefix)/lib
159
 
MANDIR=         $(installdir)/man
160
 
INCLUDEDIR=     $(installdir)/include
161
 
SCRIPTDIR=      $(prefix)/lib
162
 
 
163
 
# Detailed destination directories
164
 
BINLIBDEST=     $(LIBDIR)/python$(VERSION)
165
 
LIBDEST=        $(SCRIPTDIR)/python$(VERSION)
166
 
INCLUDEPY=      $(INCLUDEDIR)/python$(VERSION)
167
 
EXECINCLUDEPY=  $(exec_installdir)/include/python$(VERSION)
168
 
LIBP=           $(exec_installdir)/lib/python$(VERSION)
169
 
DESTSHARED=     $(BINLIBDEST)/site-packages
170
 
 
171
 
LIBPL=          $(LIBP)/config
172
 
 
173
 
PYTHONLIBS=     $(LIBPL)/libpython$(VERSION).a
174
 
 
175
 
MAKESETUP=      $(LIBPL)/makesetup
176
 
MAKEFILE=       $(LIBPL)/Makefile
177
 
CONFIGC=        $(LIBPL)/config.c
178
 
CONFIGCIN=      $(LIBPL)/config.c.in
179
 
SETUP=          $(LIBPL)/Setup
180
 
 
181
 
SYSLIBS=        $(LIBM) $(LIBC)
182
 
 
183
 
ADDOBJS=        $(LIBPL)/python.o config.o
184
 
 
185
 
# Portable install script (configure doesn't always guess right)
186
 
INSTALL=        $(LIBPL)/install-sh -c
187
 
# Shared libraries must be installed with executable mode on some systems;
188
 
# rather than figuring out exactly which, we always give them executable mode.
189
 
# Also, making them read-only seems to be a good idea...
190
 
INSTALL_SHARED= ${INSTALL} -m 555
191
 
 
192
 
# === Fixed rules ===
193
 
 
194
 
# Default target.  This builds shared libraries only
195
 
default:        sharedmods 
196
 
 
197
 
 
198
 
# Build everything
199
 
all:            sharedmods
200
 
 
201
 
# Build shared libraries from our extension modules
202
 
sharedmods:     $(SHAREDMODS)
203
 
 
204
 
# Build a static Python binary containing our extension modules
205
 
static:         $(TARGET)
206
 
$(TARGET):      $(ADDOBJS) lib.a $(PYTHONLIBS) Makefile $(BASELIB)
207
 
                $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) \
208
 
                 $(ADDOBJS) lib.a $(PYTHONLIBS) \
209
 
                 $(LINKPATH) $(BASELIB) $(MODLIBS) $(LIBS) $(SYSLIBS) \
210
 
                 -o $(TARGET) $(LDLAST)
211
 
 
212
 
# Build the library containing our extension modules
213
 
lib.a:          $(MODOBJS)
214
 
                -rm -f lib.a
215
 
                ar cr lib.a $(MODOBJS)
216
 
                -$(RANLIB) lib.a 
217
 
 
218
 
# This runs makesetup *twice* to use the BASESETUP definition from Setup
219
 
config.c Makefile:      Makefile.pre Setup $(BASESETUP) $(MAKESETUP)
220
 
                $(MAKESETUP) \
221
 
                 -m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
222
 
                $(MAKE) -f Makefile do-it-again
223
 
 
224
 
# Internal target to run makesetup for the second time
225
 
do-it-again:
226
 
                $(MAKESETUP) \
227
 
                 -m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
228
 
 
229
 
# Make config.o from the config.c created by makesetup
230
 
config.o:       config.c
231
 
                $(CC) $(CFLAGS) -c config.c
232
 
 
233
 
# Setup is copied from Setup.in *only* if it doesn't yet exist
234
 
Setup:
235
 
                cp $(srcdir)/Setup.in Setup
236
 
 
237
 
# Make the intermediate Makefile.pre from Makefile.pre.in
238
 
Makefile.pre: Makefile.pre.in sedscript
239
 
                sed -f sedscript $(srcdir)/Makefile.pre.in >Makefile.pre
240
 
 
241
 
# Shortcuts to make the sed arguments on one line
242
 
P=prefix
243
 
E=exec_prefix
244
 
H=Generated automatically from Makefile.pre.in by sedscript.
245
 
L=LINKFORSHARED
246
 
 
247
 
# Make the sed script used to create Makefile.pre from Makefile.pre.in
248
 
sedscript:      $(MAKEFILE)
249
 
        sed -n \
250
 
         -e '1s/.*/1i\\/p' \
251
 
         -e '2s%.*%# $H%p' \
252
 
         -e '/^VERSION=/s/^VERSION=[    ]*\(.*\)/s%@VERSION[@]%\1%/p' \
253
 
         -e '/^CC=/s/^CC=[      ]*\(.*\)/s%@CC[@]%\1%/p' \
254
 
         -e '/^CCC=/s/^CCC=[    ]*\(.*\)/s%#@SET_CCC[@]%CCC=\1%/p' \
255
 
         -e '/^LINKCC=/s/^LINKCC=[      ]*\(.*\)/s%@LINKCC[@]%\1%/p' \
256
 
         -e '/^SGI_ABI=/s/^SGI_ABI=[    ]*\(.*\)/s%@SGI_ABI[@]%\1%/p' \
257
 
         -e '/^OPT=/s/^OPT=[    ]*\(.*\)/s%@OPT[@]%\1%/p' \
258
 
         -e '/^LDFLAGS=/s/^LDFLAGS=[    ]*\(.*\)/s%@LDFLAGS[@]%\1%/p' \
259
 
         -e '/^LDLAST=/s/^LDLAST=[      ]*\(.*\)/s%@LDLAST[@]%\1%/p' \
260
 
         -e '/^DEFS=/s/^DEFS=[  ]*\(.*\)/s%@DEFS[@]%\1%/p' \
261
 
         -e '/^LIBS=/s/^LIBS=[  ]*\(.*\)/s%@LIBS[@]%\1%/p' \
262
 
         -e '/^LIBM=/s/^LIBM=[  ]*\(.*\)/s%@LIBM[@]%\1%/p' \
263
 
         -e '/^LIBC=/s/^LIBC=[  ]*\(.*\)/s%@LIBC[@]%\1%/p' \
264
 
         -e '/^RANLIB=/s/^RANLIB=[      ]*\(.*\)/s%@RANLIB[@]%\1%/p' \
265
 
         -e '/^MACHDEP=/s/^MACHDEP=[    ]*\(.*\)/s%@MACHDEP[@]%\1%/p' \
266
 
         -e '/^SO=/s/^SO=[      ]*\(.*\)/s%@SO[@]%\1%/p' \
267
 
         -e '/^LDSHARED=/s/^LDSHARED=[  ]*\(.*\)/s%@LDSHARED[@]%\1%/p' \
268
 
         -e '/^CCSHARED=/s/^CCSHARED=[  ]*\(.*\)/s%@CCSHARED[@]%\1%/p' \
269
 
         -e '/^$L=/s/^$L=[      ]*\(.*\)/s%@$L[@]%\1%/p' \
270
 
         -e '/^$P=/s/^$P=\(.*\)/s%^$P=.*%$P=\1%/p' \
271
 
         -e '/^$E=/s/^$E=\(.*\)/s%^$E=.*%$E=\1%/p' \
272
 
         $(MAKEFILE) >sedscript
273
 
        echo "/^#@SET_CCC@/d" >>sedscript
274
 
        echo "/^installdir=/s%=.*%=     $(installdir)%" >>sedscript
275
 
        echo "/^exec_installdir=/s%=.*%=$(exec_installdir)%" >>sedscript
276
 
        echo "/^srcdir=/s%=.*%=         $(srcdir)%" >>sedscript
277
 
        echo "/^VPATH=/s%=.*%=          $(VPATH)%" >>sedscript
278
 
        echo "/^LINKPATH=/s%=.*%=       $(LINKPATH)%" >>sedscript
279
 
        echo "/^BASELIB=/s%=.*%=        $(BASELIB)%" >>sedscript
280
 
        echo "/^BASESETUP=/s%=.*%=      $(BASESETUP)%" >>sedscript
281
 
 
282
 
# Bootstrap target
283
 
boot:   clobber
284
 
        VERSION=`$(PYTHON) -c "import sys; print sys.version[:3]"`; \
285
 
        installdir=`$(PYTHON) -c "import sys; print sys.prefix"`; \
286
 
        exec_installdir=`$(PYTHON) -c "import sys; print sys.exec_prefix"`; \
287
 
        $(MAKE) -f $(srcdir)/Makefile.pre.in VPATH=$(VPATH) srcdir=$(srcdir) \
288
 
                VERSION=$$VERSION \
289
 
                installdir=$$installdir \
290
 
                exec_installdir=$$exec_installdir \
291
 
                Makefile
292
 
 
293
 
# Handy target to remove intermediate files and backups
294
 
clean:
295
 
                -rm -f *.o *~
296
 
                rm -f `find . -name '*.pyc'`
297
 
                rm -f `find . -name '*.o'`
298
 
                rm -f `find . -name '*~'`
299
 
 
300
 
# Handy target to remove everything that is easily regenerated
301
 
clobber:        clean
302
 
                -rm -f *.a tags TAGS config.c Makefile.pre $(TARGET) sedscript
303
 
                -rm -f *.so *.sl so_locations
304
 
 
305
 
# Handy target to remove everything you don't want to distribute
306
 
distclean:      clobber
307
 
                -rm -f Setup
308
 
 
309
 
libinstall:     
310
 
# Create directories, if required
311
 
        if test ! -d $(DESTSHARED) ; then \
312
 
                mkdir $(DESTSHARED) ; else true ; fi