#################################################################
# To build the stack module and type into dynamically-loaded 
# shareable object files on Linux, type 'make -f makefile.stack'
#
# To add them statically instead, modify Modules/Setup in the 
# Python build tree, to include lines like:
#   stackmod  <path to stackmod.c>
#   stacktype <path to stacktyp.c>
# and run a 'make' at the top of the build tree to remake
# Python itself; static linking is more portable, but it
# requires access to Python's build/source tree (dynamic
# loading of .so's does not--you only need a python lib
# or executable for embedded and standalone programs). 
#
# If you use dynamic loading (and this makefile), be sure 
# to put this directory on PYTHONPATH (or copy the .so's 
# to a dir already on the path or to the Python build 
# tree), and add the build tree's Lib directory too to 
# get the correct standard libs (Python may guess the wrong
# standard libs, when the executable isn't python itself).
# The .so's name must match module init function's name;
# the name of the .c file is arbitrary.
#################################################################

PY = /home/mark/python1.5.2-ddjcd/Python-1.5.2

all: stackmod.so stacktype.so

stackmod.so: stackmod.c
	gcc stackmod.c -g -I$(PY)/Include -I$(PY) -fpic -shared -o stackmod.so

stacktype.so: stacktyp.c
	gcc stacktyp.c -g -I$(PY)/Include -I$(PY) -fpic -shared -o stacktype.so

clean:
	rm -f stackmod.so stacktype.so

