1996-08-20 20:54:59 +00:00
|
|
|
# Generic Makefile for dynamically linked extension modules.
|
|
|
|
#
|
|
|
|
# Jim Fulton, Digital Creations, jim@digicool.com
|
|
|
|
|
|
|
|
|
1996-08-28 19:29:44 +00:00
|
|
|
# Uncomment and modify these lines if you want to fix the location of
|
|
|
|
# the PYTHON installation and the python version. Otherwise, set the
|
|
|
|
# environment variables before using this Makefile.
|
|
|
|
|
|
|
|
# $(PYTHONHOME)= /usr/local/
|
|
|
|
# $(PYTHONVERSION)= 1.4
|
1996-08-20 20:54:59 +00:00
|
|
|
|
|
|
|
# The following lines should be left as is:
|
1996-08-28 19:29:44 +00:00
|
|
|
VERSION= $(PYTHONVERSION)
|
1996-08-20 20:54:59 +00:00
|
|
|
pyinstalldir= $(PYTHONHOME)
|
|
|
|
installdir= $(PYTHONHOME)
|
|
|
|
exec_installdir=$(pyinstalldir)
|
1996-08-28 19:29:44 +00:00
|
|
|
INCLUDEPY= $(pyinstalldir)/include/python$(VERSION)
|
|
|
|
LIBP= $(exec_installdir)/lib/python$(VERSION)
|
1996-08-28 14:27:24 +00:00
|
|
|
LIBPL= $(LIBP)/config
|
1996-08-20 20:54:59 +00:00
|
|
|
PYMAKE= make -f $(LIBPL)/Makefile
|
|
|
|
|
|
|
|
# LIBSO is the location of platform-dependent dynamically linked
|
|
|
|
# extension libraries. This can be handy when you need to build
|
|
|
|
# shared libraries that are not extensions but want to store them
|
|
|
|
# with other extensions and need to know where they are.
|
|
|
|
# Leave this line as it is.
|
|
|
|
LIBSO= `$(PYMAKE) -s echodestshared`
|
|
|
|
|
|
|
|
# Put your module name here:
|
|
|
|
MODULE=your-module
|
|
|
|
|
|
|
|
# Put the object files for your module here:
|
|
|
|
OBS=$(MODULE).o
|
|
|
|
|
|
|
|
# Put extra linker options, such as libraries here:
|
1996-08-28 19:29:44 +00:00
|
|
|
EXTRALD=
|
|
|
|
|
|
|
|
# Put Extra compiler options, such as extra -I options, here
|
|
|
|
CFLAGS=-O
|
1996-08-20 20:54:59 +00:00
|
|
|
|
|
|
|
# If you have any Python modules, include them here, so that they
|
1996-08-28 19:29:44 +00:00
|
|
|
# can get installed.
|
1996-08-20 20:54:59 +00:00
|
|
|
PYMODULES=
|
|
|
|
|
|
|
|
build:
|
|
|
|
if [ "$(MODULE)" != your-module ]; then \
|
|
|
|
$(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \
|
|
|
|
ASHAREDMODULE=$(MODULE) \
|
|
|
|
'ASHAREDMODULESOBS=$(OBS)' \
|
1996-08-28 19:29:44 +00:00
|
|
|
'ASHAREDMODULESEXTRA=$(EXTRALD)' \
|
|
|
|
'OPT=$(CFLAGS)' \
|
1996-08-20 20:54:59 +00:00
|
|
|
asharedmodule; \
|
|
|
|
fi
|
|
|
|
|
1996-08-28 19:29:44 +00:00
|
|
|
# Normally we don't install .py files:
|
|
|
|
install: installso installpyc
|
|
|
|
|
|
|
|
# But sometimes we may want to:
|
|
|
|
installpy: install
|
|
|
|
for m in $(PYMODULES) the-end; do \
|
|
|
|
if [ "$$m" != the-end ]; then \
|
|
|
|
cp $$m.py $(installdir)/lib/python$(VERSION)/; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
1996-08-20 20:54:59 +00:00
|
|
|
|
|
|
|
installso: build
|
|
|
|
if [ "$(MODULE)" != your-module ]; then \
|
|
|
|
$(PYMAKE) exec_prefix=$(installdir) \
|
|
|
|
ASHAREDMODULE=$(MODULE) asharedinstall; \
|
|
|
|
fi
|
|
|
|
|
1996-08-28 19:29:44 +00:00
|
|
|
installpyc:
|
1996-08-20 20:54:59 +00:00
|
|
|
for m in $(PYMODULES) the-end; do \
|
|
|
|
if [ "$$m" != the-end ]; then \
|
|
|
|
python -c "import $$m"; \
|
1996-08-28 19:29:44 +00:00
|
|
|
cp $$m.pyc $(installdir)/lib/python$(VERSION)/; \
|
1996-08-20 20:54:59 +00:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
clean::
|
|
|
|
-rm -f *.o *.so *~ *# so_locations
|