blob: e15f9b7b683c2a2cbaa47d3dbb5946910efd8082 [file] [log] [blame]
Guido van Rossume8c0a151996-08-20 20:54:59 +00001# Generic Makefile for dynamically linked extension modules.
2#
3# Jim Fulton, Digital Creations, jim@digicool.com
4
5
6# Uncomment this line if you want to fix the location of the PYTHON
7# installation. Otherwise, set the environment variable before using this
8# Makefile.
9# $(PYTHONHOME)= /usr/local/
10
11# The following lines should be left as is:
12pyinstalldir= $(PYTHONHOME)
13installdir= $(PYTHONHOME)
14exec_installdir=$(pyinstalldir)
Guido van Rossumbe725fd1996-08-28 14:27:24 +000015INCLUDEPY= $(pyinstalldir)/include/python1.4
Guido van Rossume8c0a151996-08-20 20:54:59 +000016LIBP= $(exec_installdir)/lib/python
Guido van Rossumbe725fd1996-08-28 14:27:24 +000017LIBPL= $(LIBP)/config
Guido van Rossume8c0a151996-08-20 20:54:59 +000018PYMAKE= make -f $(LIBPL)/Makefile
19
20# LIBSO is the location of platform-dependent dynamically linked
21# extension libraries. This can be handy when you need to build
22# shared libraries that are not extensions but want to store them
23# with other extensions and need to know where they are.
24# Leave this line as it is.
25LIBSO= `$(PYMAKE) -s echodestshared`
26
27# Put your module name here:
28MODULE=your-module
29
30# Put the object files for your module here:
31OBS=$(MODULE).o
32
33# Put extra linker options, such as libraries here:
34EXTRA=
35
36# If you have any Python modules, include them here, so that they
37# can be installed.
38PYMODULES=
39
40build:
41 if [ "$(MODULE)" != your-module ]; then \
42 $(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \
43 ASHAREDMODULE=$(MODULE) \
44 'ASHAREDMODULESOBS=$(OBS)' \
45 'ASHAREDMODULESEXTRA=$(EXTRA)' \
46 asharedmodule; \
47 fi
48
49install: installso installpy
50
51installso: build
52 if [ "$(MODULE)" != your-module ]; then \
53 $(PYMAKE) exec_prefix=$(installdir) \
54 ASHAREDMODULE=$(MODULE) asharedinstall; \
55 fi
56
57installpy:
58 for m in $(PYMODULES) the-end; do \
59 if [ "$$m" != the-end ]; then \
60 python -c "import $$m"; \
61 cp $$m.pyc $(installdir)/lib/python/; \
62 fi; \
63 done
64
65clean::
66 -rm -f *.o *.so *~ *# so_locations