home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Nt / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-12-17  |  7.5 KB  |  258 lines  |  [TEXT/R*ch]

  1. ########################################################################
  2. # Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  3. # The Netherlands.
  4. #
  5. #                         All Rights Reserved
  6. #
  7. # Permission to use, copy, modify, and distribute this software and its
  8. # documentation for any purpose and without fee is hereby granted,
  9. # provided that the above copyright notice appear in all copies and that
  10. # both that copyright notice and this permission notice appear in
  11. # supporting documentation, and that the names of Stichting Mathematisch
  12. # Centrum or CWI not be used in advertising or publicity pertaining to
  13. # distribution of the software without specific, written prior permission.
  14. #
  15. # STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
  16. # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17. # FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
  18. # FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  20. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  21. # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22. ########################################################################
  23.  
  24. # Toplevel Makefile for Python
  25. # Note -- if recursive makes fail, try adding MAKE=make
  26.  
  27. # Substitutions by configure
  28. srcdir=        @srcdir@
  29. VPATH=        @srcdir@
  30. INSTALL=    @INSTALL@
  31.  
  32. # Install prefixes are treated specially by the configure script:
  33. # it only changes these lines if it has received a --prefix=... or
  34. # --exec-prefix=... command line option.  Note that $(prefix) is
  35. # also used when compiling config.c in Modules to set the default
  36. # module search path, so if you change it later be sure to change it
  37. # there too and rebuild.
  38.  
  39. # Install prefix for architecture-independent files
  40. prefix=        /usr/local
  41.  
  42. # Install prefix for architecture-dependent files
  43. exec_prefix=    $(prefix)
  44.  
  45. # Programs
  46. SHELL=        /bin/sh
  47.  
  48. # --with-PACKAGE options for configure script
  49. # e.g. --with-readline --with-svr5 --with-solaris --with-thread
  50. # (see README for an explanation)
  51. WITH=        
  52.  
  53. # Compiler options passed to subordinate makes
  54. OPT=        @OPT@
  55.  
  56. # Subdirectories where to run make recursively
  57. SUBDIRS=    Parser Objects Python Modules
  58.  
  59. # Other subdirectories
  60. SUBDIRSTOO=    Include Lib Doc Misc Demo readline Grammar
  61.  
  62. # Files and directories to be distributed
  63. CONFIGFILES=    configure configure.in acconfig.h config.h.in Makefile.in
  64. DISTFILES=    README ChangeLog $(CONFIGFILES)
  65. DISTDIRS=    $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
  66. DIST=        $(DISTFILES) $(DISTDIRS)
  67.  
  68. # Default target
  69. all:        python
  70.  
  71. # Build the interpreter
  72. python:        Makefiles
  73.         for i in $(SUBDIRS); do \
  74.             (echo $$i; cd $$i; $(MAKE) OPT="$(OPT)" all); \
  75.         done
  76.  
  77. # Test the interpreter (twice, once without .pyc files, once with)
  78. TESTPATH=    $(srcdir)/Lib:$(srcdir)/Lib/test
  79. test:        python
  80.         -rm -f $(srcdir)/Lib/test/*.pyc
  81.         PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
  82.         PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
  83.  
  84. # Install the interpreter
  85. install:    python
  86.         $(INSTALL) python $(exec_prefix)/bin/python
  87.         @echo If this is your first time, consider make libinstall...
  88.  
  89. # Install the library.
  90. # If your system does not support "cp -r", try "copy -r" or perhaps
  91. # something like find Lib -print | cpio -pacvdmu $(LIBDEST)
  92. LIBDEST=    $(prefix)/lib/python
  93. libinstall:
  94.         -if test ! -d $(LIBDEST); \
  95.         then mkdir $(LIBDEST); \
  96.         fi
  97.         cp -r $(srcdir)/Lib/* $(LIBDEST)
  98.         PYTHONPATH=$(LIBDEST) \
  99.             ./python $(LIBDEST)/compileall.py $(LIBDEST)
  100.  
  101. # install the manual page
  102. maninstall:
  103.         $(INSTALL) $(srcdir)/Misc/python.man \
  104.             $(prefix)/man/man1/python.1
  105.  
  106. # install the include files
  107. INCLUDEPY=    $(prefix)/include/Py
  108. inclinstall:
  109.         -if test ! -d $(INCLUDEPY); \
  110.         then mkdir $(INCLUDEPY); \
  111.         fi
  112.         cp $(srcdir)/Include/*.h $(INCLUDEPY)
  113.  
  114. # install the lib*.a files and miscellaneous stuff needed by extensions
  115. LIBP=        $(exec_prefix)/lib/python
  116. LIBPL=        $(LIBP)/lib
  117. libainstall:    all
  118.         -if test ! -d $(LIBP); \
  119.         then mkdir $(LIBP); \
  120.         fi
  121.         -if test ! -d $(LIBPL); \
  122.         then mkdir $(LIBPL); \
  123.         fi
  124.         for i in $(SUBDIRS); do \
  125.             echo $$i; $(INSTALL) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
  126.         done
  127.         $(INSTALL) Modules/config.c $(LIBPL)/config.c
  128.         $(INSTALL) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
  129.         $(INSTALL) Modules/Makefile $(LIBPL)/Makefile
  130.         $(INSTALL) Modules/Setup $(LIBPL)/Setup
  131.         $(INSTALL) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
  132.         $(INSTALL) config.h $(LIBPL)/config.h
  133.         $(INSTALL) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
  134.  
  135. # Build the sub-Makefiles
  136. Makefiles:    config.status
  137.         (cd Modules; $(MAKE) -f Makefile.pre Makefile)
  138.         for i in . $(SUBDIRS); do \
  139.             (echo $$i; cd $$i; $(MAKE) Makefile); \
  140.         done
  141.  
  142. # Build the toplevel Makefile
  143. Makefile:    Makefile.in config.status
  144.         CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
  145.  
  146. # Run the configure script.  If config.status already exists,
  147. # call it with the --recheck argument, which reruns configure with the
  148. # same options as it was run last time; otherwise run the configure
  149. # script with options taken from the $(WITH) variable
  150. config.status:    $(srcdir)/configure
  151.         if test -f config.status; \
  152.         then $(SHELL) config.status --recheck; \
  153.         else $(SHELL) $(srcdir)/configure $(WITH); \
  154.         fi
  155.  
  156. .PRECIOUS:    config.status python
  157.  
  158. # Rerun configure with the same options as it was run last time,
  159. # provided the config.status script exists
  160. recheck:
  161.         $(SHELL) config.status --recheck
  162.  
  163. # Rebuild the configure script from configure.in; also rebuild config.h.in
  164. autoconf:
  165.         (cd $(srcdir); autoconf; autoheader)
  166.  
  167. # Create a tags file for vi
  168. tags::
  169.         ctags -w -t Include/*.h
  170.         for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
  171.         sort tags -o tags
  172.  
  173. # Create a tags file for GNU Emacs
  174. TAGS::
  175.         etags Include/*.h
  176.         for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
  177.  
  178. # Add dependencies to sub-Makefiles
  179. depend:
  180.         for i in $(SUBDIRS); do \
  181.             (echo $$i; cd $$i; $(MAKE) depend); \
  182.         done
  183.  
  184. # Sanitation targets -- clean leaves libraries, executables and tags
  185. # files, which clobber removes those as well
  186.  
  187. localclean:
  188.         -rm -f core *~ [@,#]* *.old *.orig *.rej
  189.  
  190. clean:        localclean
  191.         -for i in $(SUBDIRS); do \
  192.             (echo $$i; cd $$i; \
  193.              if test -f Makefile; \
  194.              then $(MAKE) clean; \
  195.              else $(MAKE) -f Makefile.*in clean; \
  196.              fi); \
  197.         done
  198.  
  199. localclobber:    localclean
  200.         -rm -f tags TAGS python
  201.  
  202. clobber:    localclobber
  203.         -for i in $(SUBDIRS); do \
  204.             (echo $$i; cd $$i; \
  205.              if test -f Makefile; \
  206.              then $(MAKE) clobber; \
  207.              else $(MAKE) -f Makefile.in clobber; \
  208.              fi); \
  209.         done
  210.  
  211. # Make things extra clean, before making a distribution
  212. distclean:    clobber
  213.         -$(MAKE) SUBDIRS="$(SUBDIRSTOO)" clobber
  214.         -rm -f config.status config.h Makefile
  215.         -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
  216.              for f in $$i/*.in; do \
  217.                 f=`basename "$$f" .in`; \
  218.                  if test "$$f" != "*"; then \
  219.                     echo rm -f "$$i/$$f"; \
  220.                      rm -f "$$i/$$f"; \
  221.                 fi; \
  222.              done; \
  223.         done
  224.  
  225. # Find files with funny names
  226. find:
  227.         find $(DISTDIRS) -type d \
  228.             -o -name '*.[chs]' \
  229.             -o -name '*.py' \
  230.             -o -name '*.doc' \
  231.             -o -name '*.sty' \
  232.             -o -name '*.bib' \
  233.             -o -name '*.dat' \
  234.             -o -name '*.el' \
  235.             -o -name '*.fd' \
  236.             -o -name '*.in' \
  237.             -o -name '*.tex' \
  238.             -o -name '*,[vpt]' \
  239.             -o -name 'Setup' \
  240.             -o -name 'Setup.*' \
  241.             -o -name README \
  242.             -o -name Makefile \
  243.             -o -name ChangeLog \
  244.             -o -name RCS \
  245.             -o -name Repository \
  246.             -o -name Entries \
  247.             -o -name Tag \
  248.             -o -name tags \
  249.             -o -name TAGS \
  250.             -o -name .cvsignore \
  251.             -o -name MANIFEST \
  252.             -o -print
  253.  
  254. # Build a distribution tar file (run make distclean first)
  255. # (This leaves the RCS and CVS directories in :-( )
  256. tar:
  257.         tar cf - $(DIST) | gzip --best >dist.tar.gz
  258.