home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / Modules / Makefile.pre.in < prev    next >
Encoding:
Makefile  |  1997-01-17  |  6.0 KB  |  237 lines

  1. # META-NOTE: this note is different from the note in the other Makefiles!
  2. # NOTE: Makefile.pre.in is converted into Makefile.pre by the configure
  3. # script in the toplevel directory or by ../config.status.
  4. # Makefile.pre is converted into Makefile by running the makesetup
  5. # script in the source directory.  Once Makefile exists, it can be
  6. # brought up to date by running "make Makefile".  (The makesetup also
  7. # creates config.c from config.c.in in the source directory.)
  8.  
  9. # Interpreter version number, for library destination pathnames
  10. VERSION=    1.4
  11.  
  12. # === Variables set by makesetup ===
  13.  
  14. MODOBJS=    _MODOBJS_
  15. MODLIBS=    _MODLIBS_
  16.  
  17. # === Variables set by configure ===
  18.  
  19. srcdir=        @srcdir@
  20. VPATH=        @srcdir@
  21.  
  22. CC=        @CC@
  23. RANLIB=        @RANLIB@
  24. AR=        @AR@
  25.  
  26. OPT=        @OPT@
  27. LDFLAGS=    @LDFLAGS@
  28.  
  29. DEFS=        @DEFS@
  30. LIBS=        @LIBS@
  31. LIBM=        @LIBM@
  32. LIBC=        @LIBC@
  33. PYRL_LIBS=    @PYRL_LIBS@
  34.  
  35. # Machine-dependent subdirectories
  36. MACHDEP=    @MACHDEP@
  37.  
  38. # Install prefix for architecture-independent files
  39. prefix=        @prefix@
  40.  
  41. # Install prefix for architecture-dependent files
  42. exec_prefix=    @exec_prefix@
  43.  
  44. # Expanded directories
  45. BINDIR=        $(exec_prefix)/bin
  46. LIBDIR=        $(exec_prefix)/lib
  47. MANDIR=        $(prefix)/man
  48. INCLUDEDIR=    $(prefix)/include
  49. SCRIPTDIR=    $(prefix)/lib
  50.  
  51. # Detailed destination directories
  52. BINLIBDEST=    $(LIBDIR)/python$(VERSION)
  53. LIBDEST=    $(SCRIPTDIR)/python$(VERSION)
  54. INCLUDEPY=    $(INCLUDEDIR)/python$(VERSION)
  55. LIBP=        $(LIBDIR)/python$(VERSION)
  56.  
  57. # Symbols used for using shared libraries
  58. SO=        @SO@
  59. LDSHARED=    @LDSHARED@
  60. CCSHARED=    @CCSHARED@
  61. LINKFORSHARED=    @LINKFORSHARED@
  62. DESTSHARED=    $(BINLIBDEST)/sharedmodules
  63.  
  64. # Programs used by install targets
  65. INSTALL=    @INSTALL@
  66. INSTALL_PROGRAM=@INSTALL_PROGRAM@
  67. INSTALL_DATA=    @INSTALL_DATA@
  68. # Shared libraries must be installed with executable mode on some systems;
  69. # rather than figuring out exactly which, we always give them executable mode.
  70. # Also, making them read-only seems to be a good idea...
  71. INSTALL_SHARED=    ${INSTALL} -m 555
  72.  
  73. # === Variables that are customizable by hand or by inclusion in Setup ===
  74.  
  75. LINKCC=        $(CC)
  76. INCLDIR=    $(srcdir)/../Include
  77. CONFIGINCLDIR=    ..
  78. CFLAGS=        $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
  79.  
  80. MKDEP=        mkdep
  81. SHELL=        /bin/sh
  82.  
  83. MAKESETUP=    $(srcdir)/makesetup
  84.  
  85. # (The makesetup script inserts all variable definitions found
  86. # found in the Setup file just below the following line.
  87. # This means that the Setup file can override any of the definitions
  88. # given before this point, but not any given below.
  89. # The script insert the definitions in reverse order,
  90. # for the benefits of independent extensions.)
  91. # === Definitions added by makesetup ===
  92.  
  93. # === Fixed definitions ===
  94.  
  95. OBJS=        $(MODOBJS)
  96.  
  97. ADDOBJS=    main.o config.o getpath.o 
  98.  
  99. LIB=        libModules.a
  100.  
  101. MYLIBS=        $(LIB) \
  102.         ../Python/libPython.a \
  103.         ../Objects/libObjects.a \
  104.         ../Parser/libParser.a
  105.  
  106. SYSLIBS=    $(LIBM) $(LIBC)
  107.  
  108.  
  109. # === Rules ===
  110.  
  111. all:        $(LIB) ../python sharedmods
  112.  
  113. asharedmodule:    $(ASHAREDMODULE)$(SO)
  114.  
  115. $(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS)
  116.     $(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \
  117.     $(ASHAREDMODULESEXTRA)
  118.  
  119. $(LIB):        $& $(OBJS) Makefile
  120.         -rm -f $(LIB)
  121.         $(AR) cr $(LIB) $(OBJS)
  122.         $(RANLIB) $(LIB)
  123.  
  124. ../python:    $(MYLIBS) $(ADDOBJS) Makefile
  125.         $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
  126.               $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
  127.         mv python ../python
  128.  
  129. clean:
  130.         -rm -f *.o *$(SO) python core *~ [@,#]* *.old *.orig *.rej
  131.  
  132. clobber:    clean
  133.         -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
  134.         -rm -f *.so *.sl so_locations
  135.  
  136. getpath.o:    getpath.c Makefile
  137.         $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
  138.               -DPREFIX='"$(prefix)"' \
  139.               -DEXEC_PREFIX='"$(exec_prefix)"' \
  140.               $(srcdir)/getpath.c
  141.  
  142. config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local
  143.         $(SHELL) $(MAKESETUP) Setup Setup.local
  144.  
  145. Setup:
  146.         cp $(srcdir)/Setup.in Setup
  147.  
  148. Setup.local:
  149.         echo "# Edit this file for local setup changes" >Setup.local
  150.  
  151. Makefile.pre:    Makefile.pre.in ../config.status
  152.         (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
  153.         $(SHELL) config.status)
  154.  
  155. depend:
  156.         $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
  157.                     sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
  158.  
  159. .PRECIOUS:    ../python
  160.  
  161. glmodule.c:    $(srcdir)/cgen.py $(srcdir)/cstubs
  162.         python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
  163.  
  164. almodule.o: almodule.c
  165. arraymodule.o: arraymodule.c
  166. audioop.o: audioop.c
  167. cdmodule.o: cdmodule.c
  168. clmodule.o: clmodule.c
  169. dbmmodule.o: dbmmodule.c
  170. errnomodule.o: errnomodule.c
  171. fcntlmodule.o: fcntlmodule.c
  172. flmodule.o: flmodule.c
  173. fmmodule.o: fmmodule.c
  174. glmodule.o: glmodule.c
  175. imageop.o: imageop.c
  176. imgfile.o: imgfile.c
  177. main.o: main.c
  178. mathmodule.o: mathmodule.c
  179. md5c.o: md5c.c
  180. md5module.o: md5module.c
  181. mpzmodule.o: mpzmodule.c
  182. nismodule.o: nismodule.c
  183. operator.o: operator.c
  184. parsermodule.o: parsermodule.c
  185. posixmodule.o: posixmodule.c
  186. pwdmodule.o: pwdmodule.c
  187. regexmodule.o: regexmodule.c
  188. regexpr.o: regexpr.c
  189. rgbimgmodule.o: rgbimgmodule.c
  190. rotormodule.o: rotormodule.c
  191. selectmodule.o: selectmodule.c
  192. sgimodule.o: sgimodule.c
  193. socketmodule.o: socketmodule.c
  194. stdwinmodule.o: stdwinmodule.c
  195. stropmodule.o: stropmodule.c
  196. structmodule.o: structmodule.c
  197. sunaudiodev.o: sunaudiodev.c
  198. svmodule.o: svmodule.c
  199. threadmodule.o: threadmodule.c
  200. timemodule.o: timemodule.c
  201. timingmodule.o: timingmodule.c
  202. xxmodule.o: xxmodule.c
  203. yuvconvert.o: yuvconvert.c
  204.  
  205. # Rules to build and install all shared modules
  206. sharedmods:    $(SHAREDMODS)
  207. sharedinstall:    $(DESTSHARED) $(SHAREDMODS)
  208.         -for i in X $(SHAREDMODS); do \
  209.             if test $$i != X; \
  210.             then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
  211.             fi; \
  212.         done
  213.  
  214. # Install a shared module from outside of setup
  215. asharedinstall:    $(DESTSHARED) $(ASHAREDMODULE)$(SO)
  216.         -for i in dummy $(ASHAREDMODULE)$(SO); do \
  217.             if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done
  218.  
  219. # This is handy when modules need to know where the destination directory is:
  220. echodestshared: $(DESTSHARED)
  221.     echo     $(DESTSHARED)
  222.  
  223. DESTDIRS=    $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
  224.  
  225. $(DESTSHARED): 
  226.         @for i in $(DESTDIRS); \
  227.         do \
  228.             if test ! -d $$i; then \
  229.                 echo "Creating directory $$i"; \
  230.                 mkdir $$i; \
  231.                 chmod 755 $$i; \
  232.             else    true; \
  233.             fi; \
  234.         done
  235.  
  236. # Stuff is appended here by makesetup and make depend
  237.