# Generated automatically from Makefile.pre by makesetup.
# Generated automatically from Makefile.pre.in by sedscript.
# 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

# The exec_prefix used by the same
exec_installdir=/usr/local

# 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

# Add more -I and -D options here
CFLAGS=		$(OPT) -I$(INCLUDEPY) -I$(LIBPL) $(DEFS)

# These two variables can be set in Setup to merge extensions.
# See example[23].
BASELIB=	
BASESETUP=	

# === Variables set by makesetup ===

MODOBJS=	  regexmodule.o regexpr.o  pcremodule.o pypcre.o  posixmodule.o  signalmodule.o  readline.o  arraymodule.o  cmathmodule.o  mathmodule.o  stropmodule.o  structmodule.o  timemodule.o  operator.o  _localemodule.o  fcntlmodule.o  pwdmodule.o  grpmodule.o  selectmodule.o  socketmodule.o  errnomodule.o  termios.o  resource.o  md5module.o md5c.o  shamodule.o  _tkinter.o tkappinit.o  rotormodule.o  cursesmodule.o  newmodule.o  gdbmmodule.o  binascii.o  parsermodule.o  cStringIO.o  cPickle.o  zlibmodule.o
MODLIBS=	$(LOCALMODLIBS) $(BASEMODLIBS)

# === Definitions added by makesetup ===

LOCALMODLIBS=      -lreadline -ltermcap                    -ltk8.0 -ltcl8.0 -L/usr/X11R6/lib -lX11   -lncurses -ltermcap   -L/usr/local/lib -lgdbm      -L$(exec_prefix)/lib -lz
BASEMODLIBS=      -lreadline -ltermcap                    -ltk8.0 -ltcl8.0 -L/usr/X11R6/lib -lX11    -L/usr/local/lib -lgdbm      -L$(exec_prefix)/lib -lz
TKPATH=:lib-tk
GLHACK=-Dclear=__GLclear
PYTHONPATH=$(COREPYTHONPATH)
COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(STDWINPATH)$(TKPATH)
MACHDEPPATH=:plat-$(MACHDEP)
TESTPATH=
SITEPATH=
DESTPATH=
MACHDESTLIB=$(BINLIBDEST)
DESTLIB=$(LIBDEST)
TKPATH=:lib-tk
GLHACK=-Dclear=__GLclear
PYTHONPATH=$(COREPYTHONPATH)
COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(STDWINPATH)$(TKPATH)
MACHDEPPATH=:plat-$(MACHDEP)
TESTPATH=
SITEPATH=
DESTPATH=
MACHDESTLIB=$(BINLIBDEST)
DESTLIB=$(LIBDEST)


# === Variables from configure (through sedscript) ===

VERSION=	1.5
CC=		gcc
OPT=		-g -O2
LDFLAGS=	
DEFS=		-DHAVE_CONFIG_H
LIBS=		-lieee -ldl  -lpthread
LIBM=		-lm
LIBC=		
RANLIB=		ranlib
MACHDEP=	linux2
SO=		.so
LDSHARED=	gcc -shared
CCSHARED=	-fpic
LINKFORSHARED=	-Xlinker -export-dynamic

# Install prefix for architecture-independent files
prefix=		/usr/local

# 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)

LIBPL=		$(LIBP)/config

PYTHONLIBS=	$(LIBPL)/libModules.a \
		$(LIBPL)/libPython.a \
		$(LIBPL)/libObjects.a \
		$(LIBPL)/libParser.a

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)

# Build the library containing our extension modules
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"

# This runs makesetup *twice* to use the BASESETUP definition from Setup
config.c Makefile:	Makefile.pre Setup $(BASESETUP) $(MAKESETUP)
		$(MAKESETUP) \
		 -m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
		$(MAKE) -f Makefile do-it-again

# Internal target to run makesetup for the second time
do-it-again:
		$(MAKESETUP) \
		 -m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)

# Make config.o from the config.c created by makesetup
config.o:	config.c
		$(CC) $(CFLAGS) -c config.c

# Make our own private getpath.o from the installed source and our PYTHONPATH
getpath.o:	$(LIBPL)/getpath.c Makefile
	$(CC) $(CFLAGS) -DPYTHONPATH=\"$(PYTHONPATH)\" -c $(LIBPL)/getpath.c

# Setup is copied from Setup.in *only* if it doesn't yet exist
Setup:
		cp $(srcdir)/Setup.in Setup

# Make the intermediate Makefile.pre from Makefile.pre.in
Makefile.pre: Makefile.pre.in sedscript
		sed -f sedscript $(srcdir)/Makefile.pre.in >Makefile.pre

# Shortcuts to make the sed arguments on one line
P=prefix
E=exec_prefix
H=Generated automatically from Makefile.pre.in by sedscript.
L=LINKFORSHARED

# Make the sed script used to create Makefile.pre from Makefile.pre.in
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

# Bootstrap target
boot:	clobber
	VERSION=`python -c "import sys; print sys.version[:3]"`; \
	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

# Handy target to remove intermediate files and backups
clean:
		-rm -f *.o *~

# Handy target to remove everything that is easily regenerated
clobber:	clean
		-rm -f *.a tags TAGS config.c Makefile.pre python sedscript
		-rm -f *.so *.sl so_locations


# Handy target to remove everything you don't want to distribute
distclean:	clobber
		-rm -f Makefile Setup

# Rules appended by makedepend

regexmodule.o: $(srcdir)/regexmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/regexmodule.c
regexpr.o: $(srcdir)/regexpr.c; $(CC)  $(CFLAGS) -c $(srcdir)/regexpr.c
regexmodule$(SO):  regexmodule.o regexpr.o; $(LDSHARED)  regexmodule.o regexpr.o  -o regexmodule$(SO)
pcremodule.o: $(srcdir)/pcremodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/pcremodule.c
pypcre.o: $(srcdir)/pypcre.c; $(CC)  $(CFLAGS) -c $(srcdir)/pypcre.c
pcre$(SO):  pcremodule.o pypcre.o; $(LDSHARED)  pcremodule.o pypcre.o  -o pcre$(SO)
posixmodule.o: $(srcdir)/posixmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/posixmodule.c
posixmodule$(SO):  posixmodule.o; $(LDSHARED)  posixmodule.o  -o posixmodule$(SO)
signalmodule.o: $(srcdir)/signalmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/signalmodule.c
signalmodule$(SO):  signalmodule.o; $(LDSHARED)  signalmodule.o  -o signalmodule$(SO)
readline.o: $(srcdir)/readline.c; $(CC)  $(CFLAGS) -c $(srcdir)/readline.c
readline$(SO):  readline.o; $(LDSHARED)  readline.o  -lreadline -ltermcap -o readline$(SO)
arraymodule.o: $(srcdir)/arraymodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/arraymodule.c
arraymodule$(SO):  arraymodule.o; $(LDSHARED)  arraymodule.o  -o arraymodule$(SO)
cmathmodule.o: $(srcdir)/cmathmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/cmathmodule.c
cmathmodule$(SO):  cmathmodule.o; $(LDSHARED)  cmathmodule.o  -o cmathmodule$(SO)
mathmodule.o: $(srcdir)/mathmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/mathmodule.c
mathmodule$(SO):  mathmodule.o; $(LDSHARED)  mathmodule.o  -o mathmodule$(SO)
stropmodule.o: $(srcdir)/stropmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/stropmodule.c
stropmodule$(SO):  stropmodule.o; $(LDSHARED)  stropmodule.o  -o stropmodule$(SO)
structmodule.o: $(srcdir)/structmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/structmodule.c
structmodule$(SO):  structmodule.o; $(LDSHARED)  structmodule.o  -o structmodule$(SO)
timemodule.o: $(srcdir)/timemodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/timemodule.c
timemodule$(SO):  timemodule.o; $(LDSHARED)  timemodule.o  -o timemodule$(SO)
operator.o: $(srcdir)/operator.c; $(CC)  $(CFLAGS) -c $(srcdir)/operator.c
operator$(SO):  operator.o; $(LDSHARED)  operator.o  -o operator$(SO)
_localemodule.o: $(srcdir)/_localemodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/_localemodule.c
_localemodule$(SO):  _localemodule.o; $(LDSHARED)  _localemodule.o  -o _localemodule$(SO)
fcntlmodule.o: $(srcdir)/fcntlmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/fcntlmodule.c
fcntlmodule$(SO):  fcntlmodule.o; $(LDSHARED)  fcntlmodule.o  -o fcntlmodule$(SO)
pwdmodule.o: $(srcdir)/pwdmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/pwdmodule.c
pwdmodule$(SO):  pwdmodule.o; $(LDSHARED)  pwdmodule.o  -o pwdmodule$(SO)
grpmodule.o: $(srcdir)/grpmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/grpmodule.c
grpmodule$(SO):  grpmodule.o; $(LDSHARED)  grpmodule.o  -o grpmodule$(SO)
selectmodule.o: $(srcdir)/selectmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/selectmodule.c
selectmodule$(SO):  selectmodule.o; $(LDSHARED)  selectmodule.o  -o selectmodule$(SO)
socketmodule.o: $(srcdir)/socketmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/socketmodule.c
socketmodule$(SO):  socketmodule.o; $(LDSHARED)  socketmodule.o  -o socketmodule$(SO)
errnomodule.o: $(srcdir)/errnomodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/errnomodule.c
errnomodule$(SO):  errnomodule.o; $(LDSHARED)  errnomodule.o  -o errnomodule$(SO)
termios.o: $(srcdir)/termios.c; $(CC)  $(CFLAGS) -c $(srcdir)/termios.c
termios$(SO):  termios.o; $(LDSHARED)  termios.o  -o termios$(SO)
resource.o: $(srcdir)/resource.c; $(CC)  $(CFLAGS) -c $(srcdir)/resource.c
resource$(SO):  resource.o; $(LDSHARED)  resource.o  -o resource$(SO)
md5module.o: $(srcdir)/md5module.c; $(CC)  $(CFLAGS) -c $(srcdir)/md5module.c
md5c.o: $(srcdir)/md5c.c; $(CC)  $(CFLAGS) -c $(srcdir)/md5c.c
md5module$(SO):  md5module.o md5c.o; $(LDSHARED)  md5module.o md5c.o  -o md5module$(SO)
shamodule.o: $(srcdir)/shamodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/shamodule.c
shamodule$(SO):  shamodule.o; $(LDSHARED)  shamodule.o  -o shamodule$(SO)
_tkinter.o: $(srcdir)/_tkinter.c; $(CC)  -DWITH_APPINIT $(CFLAGS) -c $(srcdir)/_tkinter.c
tkappinit.o: $(srcdir)/tkappinit.c; $(CC)  -DWITH_APPINIT $(CFLAGS) -c $(srcdir)/tkappinit.c
_tkinter$(SO):  _tkinter.o tkappinit.o; $(LDSHARED)  _tkinter.o tkappinit.o  -ltk8.0 -ltcl8.0 -L/usr/X11R6/lib -lX11 -o _tkinter$(SO)
rotormodule.o: $(srcdir)/rotormodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/rotormodule.c
rotormodule$(SO):  rotormodule.o; $(LDSHARED)  rotormodule.o  -o rotormodule$(SO)
cursesmodule.o: $(srcdir)/cursesmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/cursesmodule.c
cursesmodule$(SO):  cursesmodule.o; $(LDSHARED)  cursesmodule.o  -lncurses -ltermcap -o cursesmodule$(SO)
newmodule.o: $(srcdir)/newmodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/newmodule.c
newmodule$(SO):  newmodule.o; $(LDSHARED)  newmodule.o  -o newmodule$(SO)
gdbmmodule.o: $(srcdir)/gdbmmodule.c; $(CC)  -I/usr/local/include $(CFLAGS) -c $(srcdir)/gdbmmodule.c
gdbmmodule$(SO):  gdbmmodule.o; $(LDSHARED)  gdbmmodule.o  -L/usr/local/lib -lgdbm -o gdbmmodule$(SO)
binascii.o: $(srcdir)/binascii.c; $(CC)  $(CFLAGS) -c $(srcdir)/binascii.c
binascii$(SO):  binascii.o; $(LDSHARED)  binascii.o  -o binascii$(SO)
parsermodule.o: $(srcdir)/parsermodule.c; $(CC)  $(CFLAGS) -c $(srcdir)/parsermodule.c
parsermodule$(SO):  parsermodule.o; $(LDSHARED)  parsermodule.o  -o parsermodule$(SO)
cStringIO.o: $(srcdir)/cStringIO.c; $(CC)  $(CFLAGS) -c $(srcdir)/cStringIO.c
cStringIO$(SO):  cStringIO.o; $(LDSHARED)  cStringIO.o  -o cStringIO$(SO)
cPickle.o: $(srcdir)/cPickle.c; $(CC)  $(CFLAGS) -c $(srcdir)/cPickle.c
cPickle$(SO):  cPickle.o; $(LDSHARED)  cPickle.o  -o cPickle$(SO)
zlibmodule.o: $(srcdir)/zlibmodule.c; $(CC)  -I$(prefix)/include $(CFLAGS) -c $(srcdir)/zlibmodule.c
zlibmodule$(SO):  zlibmodule.o; $(LDSHARED)  zlibmodule.o  -L$(exec_prefix)/lib -lz -o zlibmodule$(SO)
