home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / Misc / gMakefile < prev    next >
Encoding:
Makefile  |  1997-01-17  |  2.2 KB  |  84 lines

  1. # Generic Makefile for dynamically linked extension modules.
  2. #
  3. # Jim Fulton, Digital Creations, jim@digicool.com
  4.  
  5.  
  6. # Uncomment and modify these lines if you want to fix the location of
  7. # the PYTHON installation and the python version.  Otherwise, set the
  8. # environment variables before using this Makefile.
  9.  
  10. # $(PYTHONHOME)=    /usr/local/
  11. # $(PYTHONVERSION)=    1.4
  12.  
  13. # The following lines should be left as is:
  14. VERSION=    $(PYTHONVERSION)
  15. pyinstalldir=    $(PYTHONHOME)
  16. installdir=    $(PYTHONHOME)
  17. exec_installdir=$(pyinstalldir)
  18. INCLUDEPY=    $(pyinstalldir)/include/python$(VERSION)
  19. LIBP=        $(exec_installdir)/lib/python$(VERSION)
  20. LIBPL=        $(LIBP)/config
  21. PYMAKE=        make -f $(LIBPL)/Makefile
  22.  
  23. # LIBSO is the location of platform-dependent dynamically linked 
  24. # extension libraries.  This can be handy when you need to build 
  25. # shared libraries that are not extensions but want to store them
  26. # with other extensions and need to know where they are.
  27. # Leave this line as it is.
  28. LIBSO=        `$(PYMAKE) -s echodestshared`
  29.  
  30. # Put your module name here:
  31. MODULE=your-module
  32.  
  33. # Put the object files for your module here:
  34. OBS=$(MODULE).o
  35.  
  36. # Put extra linker options, such as libraries here:
  37. EXTRALD=
  38.  
  39. # Put Extra compiler options, such as extra -I options, here
  40. CFLAGS=-O
  41.  
  42. # If you have any Python modules, include them here, so that they
  43. # can get installed.
  44. PYMODULES=
  45.  
  46. build:
  47.     if [ "$(MODULE)" != your-module ]; then \
  48.       $(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \
  49.         ASHAREDMODULE=$(MODULE) \
  50.         'ASHAREDMODULESOBS=$(OBS)' \
  51.         'ASHAREDMODULESEXTRA=$(EXTRALD)' \
  52.         'OPT=$(CFLAGS)' \
  53.         asharedmodule; \
  54.     fi
  55.  
  56. # Normally we don't install .py files:
  57. install: installso installpyc
  58.  
  59. # But sometimes we may want to:
  60. installpy: install
  61.     for m in $(PYMODULES) the-end; do \
  62.       if [ "$$m" != the-end ]; then \
  63.         cp $$m.py $(installdir)/lib/python$(VERSION)/; \
  64.       fi; \
  65.     done
  66.  
  67.  
  68. installso: build
  69.     if [ "$(MODULE)" != your-module ]; then \
  70.       $(PYMAKE) exec_prefix=$(installdir) \
  71.         ASHAREDMODULE=$(MODULE) asharedinstall; \
  72.     fi
  73.  
  74. installpyc:
  75.     for m in $(PYMODULES) the-end; do \
  76.       if [ "$$m" != the-end ]; then \
  77.         python -c "import $$m"; \
  78.         cp $$m.pyc $(installdir)/lib/python$(VERSION)/; \
  79.       fi; \
  80.     done
  81.  
  82. clean::
  83.     -rm -f *.o *.so *~ *# so_locations
  84.