struct.pack has become picky about h (short) and H (unsigned short).
[python/dscho.git] / Modules / Makefile.pre.in
blob670868603db0602870aed0fdb3d6e93e4000fd06
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.)
9 # === Variables set by makesetup ===
11 MODOBJS=        _MODOBJS_
12 MODLIBS=        _MODLIBS_
14 # === Variables set by configure ===
16 VERSION=        @VERSION@
17 srcdir=         @srcdir@
18 VPATH=          @srcdir@
20 @SET_CXX@
21 CC=             @CC@
22 RANLIB=         @RANLIB@
23 AR=             @AR@
25 OPT=            @OPT@
26 LDFLAGS=        @LDFLAGS@
27 LDLAST=         @LDLAST@
28 SGI_ABI=        @SGI_ABI@
30 DEFS=           @DEFS@
31 LIBS=           @LIBS@
32 LIBM=           @LIBM@
33 LIBC=           @LIBC@
35 # Machine-dependent subdirectories
36 MACHDEP=        @MACHDEP@
38 # Install prefix for architecture-independent files
39 prefix=         @prefix@
41 # Install prefix for architecture-dependent files
42 exec_prefix=    @exec_prefix@
44 # Executable suffix (.exe on Windows and Mac OS X)
45 EXE=            @EXE@
47 # Expanded directories
48 BINDIR=         $(exec_prefix)/bin
49 LIBDIR=         $(exec_prefix)/lib
50 MANDIR=         $(prefix)/man
51 INCLUDEDIR=     $(prefix)/include
52 SCRIPTDIR=      $(prefix)/lib
54 # Detailed destination directories
55 BINLIBDEST=     $(LIBDIR)/python$(VERSION)
56 LIBDEST=        $(SCRIPTDIR)/python$(VERSION)
57 INCLUDEPY=      $(INCLUDEDIR)/python$(VERSION)
58 LIBP=           $(LIBDIR)/python$(VERSION)
60 # Symbols used for using shared libraries
61 SO=             @SO@
62 LDSHARED=       @LDSHARED@
63 CCSHARED=       @CCSHARED@
64 LINKFORSHARED=  @LINKFORSHARED@
65 DESTSHARED=     $(BINLIBDEST)/lib-dynload
67 # Portable install script (configure doesn't always guess right)
68 INSTALL=        @srcdir@/../install-sh -c
69 INSTALL_PROGRAM=${INSTALL} -m 755
70 INSTALL_DATA=   ${INSTALL} -m 644
71 # Shared libraries must be installed with executable mode on some systems;
72 # rather than figuring out exactly which, we always give them executable mode.
73 # Also, making them read-only seems to be a good idea...
74 INSTALL_SHARED= ${INSTALL} -m 555
76 # === Variables that are customizable by hand or by inclusion in Setup ===
78 LINKCC=         @LINKCC@
79 INCLDIR=        $(srcdir)/../Include
80 CONFIGINCLDIR=  ..
81 CFLAGS=         $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
83 MKDEP=          mkdep
84 SHELL=          /bin/sh
86 MAKESETUP=      $(srcdir)/makesetup
88 # (The makesetup script inserts all variable definitions
89 # found in the Setup file just below the following line.
90 # This means that the Setup file can override any of the definitions
91 # given before this point, but not any given below.
92 # The script insert the definitions in reverse order,
93 # for the benefits of independent extensions.)
94 # === Definitions added by makesetup ===
96 # === Fixed definitions ===
98 FIXOBJS=        config.o getpath.o main.o getbuildinfo.o
99 OBJS=           $(MODOBJS) $(FIXOBJS)
101 #MAINOBJ=       python.o
102 MAINOBJ=        @MAINOBJ@
104 SYSLIBS=        $(LIBM) $(LIBC)
106 LIBRARY=        ../libpython$(VERSION).a
107 LDLIBRARY=      ../@LDLIBRARY@
109 # === Rules ===
111 all:            $(OBJS)
113 # This target is used by the master Makefile to add the objects to the library.
114 # To deal with the conflict between signalmodule.o and
115 # sigcheck.o+intrcheck.o, we remove the latter two if we have the former.
116 add2lib:        $(OBJS)
117                 -if test -f hassignal; \
118                 then echo removing sigcheck.o intrcheck.o; \
119                      $(AR) d $(LIBRARY) sigcheck.o intrcheck.o 2>/dev/null; \
120                 else echo leaving sigcheck.o intrcheck.o in; fi
121                 $(AR) cr $(LIBRARY) $(OBJS)
122                 touch add2lib
124 # This target is used by the master Makefile to link the final binary.
125 link:           $(MAINOBJ)
126                 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
127                   $(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python$(EXE) $(LDLAST)
128                 mv python$(EXE) ../python$(EXE)
130 clean:
131                 -rm -f *.o python$(EXE) core *~ [@,#]* *.old *.orig *.rej
132                 -rm -f add2lib hassignal
134 clobber:        clean
135                 -rm -f *.a tags TAGS config.c Makefile.pre
136                 -rm -f *.so *.sl so_locations
138 getpath.o:      getpath.c Makefile
139                 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
140                       -DPREFIX='"$(prefix)"' \
141                       -DEXEC_PREFIX='"$(exec_prefix)"' \
142                       -DVERSION='"$(VERSION)"' \
143                       -DVPATH='"$(VPATH)"' \
144                       $(srcdir)/getpath.c
146 # When the configuration changes, we remove the library, so that it
147 # gets remade from scratch; this ensures to remove modules that are no
148 # longer pertinent (but that were in a previous configuration).
149 config.c Makefile: Makefile.pre config.c.in $(MAKESETUP)
150 config.c Makefile: Setup.config Setup Setup.local
151 config.c Makefile:
152                 -rm -rf $(LIBRARY)
153                 $(SHELL) $(MAKESETUP) Setup.config Setup.local Setup
155 hassignal:
156                 -rm -f hassignal
157                 -for i in $(OBJS); do \
158                     if test "$$i" = "signalmodule.o"; then \
159                        echo yes >hassignal; break; \
160                     fi; \
161                 done
163 Setup:          $(srcdir)/Setup.in
164                 @if [ -f Setup ] ; then \
165                     echo; \
166                     echo "----------------------------------------------"; \
167                     echo "Modules/Setup.in is newer than Modules/Setup;"; \
168                     echo "check to make sure you have all the updates"; \
169                     echo "you need in your Setup file."; \
170                     echo "----------------------------------------------"; \
171                     echo; \
172                 else (set -x; cp $(srcdir)/Setup.in Setup); fi
175 Setup.local:
176                 echo "# Edit this file for local setup changes" >Setup.local
178 Makefile.pre:   Makefile.pre.in ../config.status
179                 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
180                 $(SHELL) config.status)
182 depend:
183                 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
184                                         sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
186 .PRECIOUS:      ../python$(EXE)
188 glmodule.c:     $(srcdir)/cgen.py $(srcdir)/cstubs
189                 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
191 almodule.o: almodule.c
192 arraymodule.o: arraymodule.c
193 audioop.o: audioop.c
194 cdmodule.o: cdmodule.c
195 cgensupport.o: cgensupport.c
196 clmodule.o: clmodule.c
197 _codecsmodule.o: _codecsmodule.c
198 dbmmodule.o: dbmmodule.c
199 errnomodule.o: errnomodule.c
200 fcntlmodule.o: fcntlmodule.c
201 flmodule.o: flmodule.c
202 fmmodule.o: fmmodule.c
203 glmodule.o: glmodule.c
204 imageop.o: imageop.c
205 imgfile.o: imgfile.c
206 main.o: main.c
207 mathmodule.o: mathmodule.c
208 md5c.o: md5c.c
209 md5module.o: md5module.c
210 mpzmodule.o: mpzmodule.c
211 nismodule.o: nismodule.c
212 operator.o: operator.c
213 parsermodule.o: parsermodule.c
214 posixmodule.o: posixmodule.c
215 pwdmodule.o: pwdmodule.c
216 regexmodule.o: regexmodule.c
217 regexpr.o: regexpr.c
218 resource.o: resource.c
219 rgbimgmodule.o: rgbimgmodule.c
220 rotormodule.o: rotormodule.c
221 selectmodule.o: selectmodule.c
222 sgimodule.o: sgimodule.c
223 socketmodule.o: socketmodule.c
224 stdwinmodule.o: stdwinmodule.c
225 stropmodule.o: stropmodule.c
226 structmodule.o: structmodule.c
227 sunaudiodev.o: sunaudiodev.c
228 svmodule.o: svmodule.c
229 threadmodule.o: threadmodule.c
230 timemodule.o: timemodule.c
231 timingmodule.o: timingmodule.c
232 unicodedata.o: unicodedata.c unicodedatabase.o
233 unicodedatabase.o: unicodedatabase.c unicodedatabase.h
234 ucnhash.o: ucnhash.c
235 xxmodule.o: xxmodule.c
236 yuvconvert.o: yuvconvert.c
238 # Rules to build and install all shared modules
239 sharedmods:     $(SHAREDMODS)
240 sharedinstall:  $(DESTSHARED) $(SHAREDMODS)
241                 -for i in X $(SHAREDMODS); do \
242                         if test $$i != X; \
243                         then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
244                         fi; \
245                 done
247 DESTDIRS=       $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
249 $(DESTSHARED): 
250                 @for i in $(DESTDIRS); \
251                 do \
252                         if test ! -d $$i; then \
253                                 echo "Creating directory $$i"; \
254                                 mkdir $$i; \
255                                 chmod 755 $$i; \
256                         else    true; \
257                         fi; \
258                 done
260 ccpython.o: ccpython.cc
261         $(CXX) $(CFLAGS) -c $*.cc
263 # Stuff is appended here by makesetup and make depend