Commit bc152a2d authored by Jim Fulton's avatar Jim Fulton

renamed zlibmodule->zlib

parent 99c014b1
# Generic Makefile for dynamically linked extension modules. # Generated automatically from Makefile.pre by makesetup.
# # Generated automatically from Makefile.pre.in by sedscript.
# Jim Fulton, Digital Creations, jim@digicool.com # Universal Unix Makefile for Python extensions
# =============================================
# Short Instructions
# ------------------
# 1. Build and install Python (1.4 or newer).
# 2. "make -f Makefile.pre.in boot"
# 3. "make"
# You should now have a shared library.
# Long Instructions
# -----------------
# Build *and install* the basic Python 1.4 distribution. See the
# Python README for instructions.
# Create a file Setup.in for your extension. This file follows the
# format of the Modules/Setup.in file; see the instructions there.
# For a simple module called "spam" on file "spammodule.c", it can
# contain a single line:
# spam spammodule.c
# You can build as many modules as you want in the same directory --
# just have a separate line for each of them in the Setup.in file.
# If you want to build your extension as a shared library, insert a
# line containing just the string
# *shared*
# at the top of your Setup.in file.
# Note that the build process copies Setup.in to Setup, and then works
# with Setup. It doesn't overwrite Setup when Setup.in is changed, so
# while you're in the process of debugging your Setup.in file, you may
# want to edit Setup instead, and copy it back to Setup.in later.
# (All this is done so you can distribute your extension easily and
# someone else can select the modules they actually want to build by
# commenting out lines in the Setup file, without editing the
# original. Editing Setup is also used to specify nonstandard
# locations for include or library files.)
# Copy this file (Misc/Makefile.pre.in) to the directory containing
# your extension.
# Run "make -f Makefile.pre.in boot". This creates Makefile
# (producing Makefile.pre and sedscript as intermediate files) and
# config.c, incorporating the values for sys.prefix, sys.exec_prefix
# and sys.version from the installed Python binary. For this to work,
# the python binary must be on your path. If this fails, try
# make -f Makefile.pre.in Makefile VERSION=1.4 installdir=<prefix>
# where <prefix> is the prefix used to install Python for installdir
# (and possibly similar for exec_installdir=<exec_prefix>).
# If you are building your extension as a shared library (your
# Setup.in file starts with *shared*), run "make" or "make sharedmods"
# to build the shared library files. If you are building a statically
# linked Python binary (the only solution of your platform doesn't
# support shared libraries, and sometimes handy if you want to
# distribute or install the resulting Python binary), run "make
# python".
# Note: Each time you edit Makefile.pre.in or Setup, you must run
# "make Makefile" before running "make".
# Hint: if you want to use VPATH, you can start in an empty
# subdirectory and say (e.g.):
# make -f ../Makefile.pre.in boot srcdir=.. VPATH=..
# === Bootstrap variables (edited through "make boot") ===
# The prefix used by "make inclinstall libainstall" of core python
installdir= /usr/local/python-1.4
# The exec_prefix used by the same
exec_installdir=/usr/local/python-1.4
# Source directory and VPATH in case you want to use VPATH.
# (You will have to edit these two lines yourself -- there is no
# automatic support as the Makefile is not generated by
# config.status.)
srcdir= .
VPATH= .
# === Variables that you may want to customize (rarely) ===
# (Static) build target
TARGET= python
PYTHON= python1.4 PYTHON= python1.4
PYTHONHOME= `$(PYTHON) -c "import sys; print sys.prefix"`
PYTHONVERSION= `$(PYTHON) -c "import sys; print sys.version[:3]"` # Add more -I and -D options here
CFLAGS= $(OPT) -I$(INCLUDEPY) -I$(LIBPL) $(DEFS)
# The following lines should be left as is:
VERSION= $(PYTHONVERSION) # These two variables can be set in Setup to merge extensions.
pyinstalldir= $(PYTHONHOME) # See example[23].
installdir= $(PYTHONHOME) BASELIB=
exec_installdir=$(pyinstalldir) BASESETUP=
INCLUDEPY= $(pyinstalldir)/include/python$(VERSION)
# === Variables set by makesetup ===
MODOBJS=
MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS)
# === Definitions added by makesetup ===
LOCALMODLIBS=
BASEMODLIBS=
SHAREDMODS= zlibmodule$(SO)
TKPATH=:$(DESTLIB)/tkinter
PYTHONPATH=$(COREPYTHONPATH)
COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(STDWINPATH)$(TKPATH)
MACHDEPPATH=:$(DESTLIB)/$(MACHDEP):$(MACHDESTLIB)/sharedmodules
TESTPATH=:$(DESTLIB)/test
SITEPATH=
DESTPATH=$(DESTLIB)
MACHDESTLIB=$(BINLIBDEST)
DESTLIB=$(LIBDEST)
# === Variables from configure (through sedscript) ===
VERSION= 1.4
CC= cc
OPT= -O2000
LDFLAGS= -L/ext/dev/python/src/readline-2.0
DEFS= -DHAVE_CONFIG_H
LIBS= -lreadline -ltermcap -lpthreads
LIBM= -lm
LIBC=
RANLIB= ranlib
MACHDEP= osf1V3
SO= .so
LDSHARED= ld -shared -expect_unresolved "*"
CCSHARED=
LINKFORSHARED=
# Install prefix for architecture-independent files
prefix= /usr/local/python-1.4
# Install prefix for architecture-dependent files
exec_prefix= ${prefix}
# === Fixed definitions ===
# Shell used by make (some versions default to the login shell, which is bad)
SHELL= /bin/sh
# Expanded directories
BINDIR= $(exec_installdir)/bin
LIBDIR= $(exec_prefix)/lib
MANDIR= $(installdir)/man
INCLUDEDIR= $(installdir)/include
SCRIPTDIR= $(prefix)/lib
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
LIBP= $(exec_installdir)/lib/python$(VERSION) LIBP= $(exec_installdir)/lib/python$(VERSION)
LIBPL= $(LIBP)/config LIBPL= $(LIBP)/config
PYMAKE= make -f $(LIBPL)/Makefile
PLATFORM= `$(PYTHON) -c 'import sys; print sys.platform'`
# LIBSO is the location of platform-dependent dynamically linked PYTHONLIBS= $(LIBPL)/libModules.a \
# extension libraries. This can be handy when you need to build $(LIBPL)/libPython.a \
# shared libraries that are not extensions but want to store them $(LIBPL)/libObjects.a \
# with other extensions and need to know where they are. $(LIBPL)/libParser.a
# Leave this line as it is.
LIBSO= `$(PYMAKE) -s echodestshared` MAKESETUP= $(LIBPL)/makesetup
MAKEFILE= $(LIBPL)/Makefile
CONFIGC= $(LIBPL)/config.c
CONFIGCIN= $(LIBPL)/config.c.in
SETUP= $(LIBPL)/Setup
SYSLIBS= $(LIBM) $(LIBC)
ADDOBJS= $(LIBPL)/main.o getpath.o config.o
# === Fixed rules ===
# Default target. This builds shared libraries only
default: sharedmods
# Build everything
all: static sharedmods
# Build shared libraries from our extension modules
sharedmods: $(SHAREDMODS)
# Build a static Python binary containing our extension modules
static: $(TARGET)
$(TARGET): $(ADDOBJS) lib.a $(PYTHONLIBS) Makefile $(BASELIB)
$(CC) $(LDFLAGS) $(ADDOBJS) lib.a $(PYTHONLIBS) \
$(LINKPATH) $(BASELIB) $(MODLIBS) $(LIBS) $(SYSLIBS) \
-o $(TARGET)
# Put your module name here: # Build the library containing our extension modules
MODULE=zlibmodule lib.a: $(MODOBJS)
-rm -f lib.a
ar cr lib.a $(MODOBJS)
-$(RANLIB) lib.a || \
echo "don't worry if ranlib fails -- probably SYSV or equiv"
# Put the object files for your module here: # This runs makesetup *twice* to use the BASESETUP definition from Setup
OBS=$(MODULE).o zlib/libz.a config.c Makefile: Makefile.pre Setup $(BASESETUP) $(MAKESETUP)
$(MAKESETUP) \
-m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
$(MAKE) -f Makefile do-it-again
# Put extra linker options, such as libraries here: # Internal target to run makesetup for the second time
EXTRALD= do-it-again:
$(MAKESETUP) \
-m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
# Put Extra compiler options, such as extra -I options, here # Make config.o from the config.c created by makesetup
CFLAGS=-O -Izlib config.o: config.c
$(CC) $(CFLAGS) -c config.c
# If you have any Python modules, include them here, so that they # Make our own private getpath.o from the installed source and our PYTHONPATH
# can get installed. getpath.o: $(LIBPL)/getpath.c Makefile
PYMODULES= $(CC) $(CFLAGS) -DPYTHONPATH=\"$(PYTHONPATH)\" -c $(LIBPL)/getpath.c
bld: # Setup is copied from Setup.in *only* if it doesn't yet exist
make bldp PLAT=$(PLATFORM) Setup:
cp $(srcdir)/Setup.in Setup
bldp: bin bin/$(PLAT) bin/$(PLAT)/$(MODULE).so # Make the intermediate Makefile.pre from Makefile.pre.in
Makefile.pre: Makefile.pre.in sedscript
sed -f sedscript $(srcdir)/Makefile.pre.in >Makefile.pre
bin: # Shortcuts to make the sed arguments on one line
mkdir bin P=prefix
E=exec_prefix
H=Generated automatically from Makefile.pre.in by sedscript.
L=LINKFORSHARED
bin/$(PLAT): # Make the sed script used to create Makefile.pre from Makefile.pre.in
mkdir bin/$(PLAT) sedscript: $(MAKEFILE)
sed -n \
-e '1s/.*/1i\\/p' \
-e '2s%.*%# $H%p' \
-e '/^VERSION=/s/^VERSION=[ ]*\(.*\)/s%@VERSION[@]%\1%/p' \
-e '/^CC=/s/^CC=[ ]*\(.*\)/s%@CC[@]%\1%/p' \
-e '/^OPT=/s/^OPT=[ ]*\(.*\)/s%@OPT[@]%\1%/p' \
-e '/^LDFLAGS=/s/^LDFLAGS=[ ]*\(.*\)/s%@LDFLAGS[@]%\1%/p' \
-e '/^DEFS=/s/^DEFS=[ ]*\(.*\)/s%@DEFS[@]%\1%/p' \
-e '/^LIBS=/s/^LIBS=[ ]*\(.*\)/s%@LIBS[@]%\1%/p' \
-e '/^LIBM=/s/^LIBM=[ ]*\(.*\)/s%@LIBM[@]%\1%/p' \
-e '/^LIBC=/s/^LIBC=[ ]*\(.*\)/s%@LIBC[@]%\1%/p' \
-e '/^RANLIB=/s/^RANLIB=[ ]*\(.*\)/s%@RANLIB[@]%\1%/p' \
-e '/^MACHDEP=/s/^MACHDEP=[ ]*\(.*\)/s%@MACHDEP[@]%\1%/p' \
-e '/^SO=/s/^SO=[ ]*\(.*\)/s%@SO[@]%\1%/p' \
-e '/^LDSHARED=/s/^LDSHARED=[ ]*\(.*\)/s%@LDSHARED[@]%\1%/p' \
-e '/^CCSHARED=/s/^CCSHARED=[ ]*\(.*\)/s%@CCSHARED[@]%\1%/p' \
-e '/^$L=/s/^$L=[ ]*\(.*\)/s%@$L[@]%\1%/p' \
-e '/^$P=/s/^$P=\(.*\)/s%^$P=.*%$P=\1%/p' \
-e '/^$E=/s/^$E=\(.*\)/s%^$E=.*%$E=\1%/p' \
$(MAKEFILE) >sedscript
echo "/^installdir=/s%=.*%= $(installdir)%" >>sedscript
echo "/^exec_installdir=/s%=.*%=$(exec_installdir)%" >>sedscript
echo "/^srcdir=/s%=.*%= $(srcdir)%" >>sedscript
echo "/^VPATH=/s%=.*%= $(VPATH)%" >>sedscript
echo "/^LINKPATH=/s%=.*%= $(LINKPATH)%" >>sedscript
echo "/^BASELIB=/s%=.*%= $(BASELIB)%" >>sedscript
echo "/^BASESETUP=/s%=.*%= $(BASESETUP)%" >>sedscript
bin/$(PLAT)/$(MODULE).so: $(MODULE).c # Bootstrap target
make clean boot: clobber
make build VERSION=`$(PYTHON) -c "import sys; print sys.version[:3]"`; \
cp $(MODULE).so bin/$(PLAT)/ installdir=`$(PYTHON) -c "import sys; print sys.prefix"`; \
exec_installdir=`$(PYTHON) -c "import sys; print sys.exec_prefix"`; \
$(MAKE) -f $(srcdir)/Makefile.pre.in VPATH=$(VPATH) srcdir=$(srcdir) \
VERSION=$$VERSION \
installdir=$$installdir \
exec_installdir=$$exec_installdir \
Makefile
build: # Handy target to remove intermediate files and backups
if [ "$(MODULE)" != your-module ]; then \ clean:
$(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \ -rm -f *.o *~
ASHAREDMODULE=$(MODULE) \
'ASHAREDMODULESOBS=$(OBS)' \
'ASHAREDMODULESEXTRA=$(EXTRALD)' \
'OPT=$(CFLAGS)' \
asharedmodule; \
fi
# Normally we don't install .py files: # Handy target to remove everything that is easily regenerated
install: installso clobber: clean
-rm -f *.a tags TAGS config.c Makefile.pre python sedscript
-rm -f *.so *.sl so_locations
# But sometimes we may want to:
installpy: install
installso: # Handy target to remove everything you don't want to distribute
cp bin/$(PLATFORM)/$(MODULE).so \ distclean: clobber
$(installdir)/lib/python/Components/$(PLATFORM) -rm -f Makefile Setup
clean:: # Rules appended by makedepend
-rm -f *.o *.so *~ *# so_locations
zlibmodule.o: $(srcdir)/zlibmodule.c; $(CC) $(CCSHARED) $(CFLAGS) -Izlib -c $(srcdir)/zlibmodule.c
zlibmodule$(SO): zlibmodule.o; $(LDSHARED) zlibmodule.o -Lzlib -lz -o zlibmodule$(SO)
*shared* *shared*
zlib zlibmodule.c -Izlib -Lzlib -lz zlib zlib.c -Izlib -Lzlib -lz
...@@ -665,7 +665,7 @@ PyInit_zlib() ...@@ -665,7 +665,7 @@ PyInit_zlib()
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
ZlibError = Py_BuildValue("s", "zlib.error"); ZlibError = Py_BuildValue("s", "zlib.error");
PyDict_SetItemString(d, "error", ZlibError); PyDict_SetItemString(d, "error", ZlibError);
PyDict_SetItemString(d, "IDString", "$Id: zlibmodule.c,v 1.2 1997/06/30 17:02:18 jim Exp $"); PyDict_SetItemString(d, "IDString", "$Id: zlib.c,v 1.1 1997/07/17 13:34:04 jim Exp $");
insint(d, "MAX_WBITS", MAX_WBITS); insint(d, "MAX_WBITS", MAX_WBITS);
insint(d, "DEFLATED", DEFLATED); insint(d, "DEFLATED", DEFLATED);
insint(d, "DEF_MEM_LEVEL", DEF_MEM_LEVEL); insint(d, "DEF_MEM_LEVEL", DEF_MEM_LEVEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment