7676#
7777# See also the section "Build instructions" in the README file.
7878
79- # Interpreter version number, for library destination pathnames
80- VERSION = 1.5
81-
8279# Substitutions by configure
80+ VERSION = @VERSION@
8381srcdir = @srcdir@
8482VPATH = @srcdir@
8583RANLIB = @RANLIB@
@@ -141,11 +139,24 @@ DISTFILES= README ChangeLog $(CONFIGFILES)
141139DISTDIRS = $(SUBDIRS ) $(SUBDIRSTOO ) Ext-dummy
142140DIST = $(DISTFILES ) $(DISTDIRS )
143141
142+ LIBRARY = libpython$(VERSION ) .a
143+
144144# Default target
145- all : python
145+ all : $( LIBRARY ) python
146146
147147# Build the interpreter
148- python : $(SUBDIRS )
148+ python : $(LIBRARY )
149+ cd Modules; $(MAKE ) OPT=" $( OPT) " VERSION=" $( VERSION) " \
150+ prefix=" $( prefix) " exec_prefix=" $( exec_prefix) " \
151+ LIBRARY=../$(LIBRARY ) link
152+
153+ # Build the library
154+ $(LIBRARY ) : $(SUBDIRS )
155+ if test ! -f $( LIBRARY) ; \
156+ then for i in $( SUBDIRS) ; do rm -f $$ i/add2lib; done ; true ; \
157+ else true ; fi
158+ for i in $( SUBDIRS) ; do \
159+ (cd $$ i; $( MAKE) VERSION=" $( VERSION) " add2lib); done
149160
150161$(SUBDIRS ) : Makefiles
151162
@@ -161,7 +172,7 @@ Objects:
161172 cd Objects ; $(MAKE ) OPT=" $( OPT) " VERSION=" $( VERSION) " \
162173 prefix=" $( prefix) " exec_prefix=" $( exec_prefix) " all
163174
164- Modules : Parser Python Objects
175+ Modules : Parser Python Objects
165176 cd Modules ; $(MAKE ) OPT=" $( OPT) " VERSION=" $( VERSION) " \
166177 prefix=" $( prefix) " exec_prefix=" $( exec_prefix) " all
167178
@@ -302,7 +313,7 @@ inclinstall:
302313 $(INSTALL_DATA ) $$ i $(INCLUDEPY ) ; \
303314 done
304315
305- # Install the lib*.a files and miscellaneous stuff needed by extensions
316+ # Install the library and miscellaneous stuff needed for extending/embedding
306317# This goes into $(exec_prefix)
307318LIBPL = $(LIBP ) /config
308319libainstall : all
@@ -315,11 +326,8 @@ libainstall: all
315326 else true ; \
316327 fi ; \
317328 done
318- @for i in $(SUBDIRS ) ; do \
319- echo Installing in subdirectory $$ i; \
320- $(INSTALL_DATA ) $$ i/lib$$ i.a $(LIBPL ) /lib$$ i.a; \
321- $(RANLIB ) $(LIBPL ) /lib$$ i.a; \
322- done
329+ $(INSTALL_DATA ) $(LIBRARY ) $(LIBPL ) /$(LIBRARY )
330+ $(RANLIB ) $(LIBPL ) /$(LIBRARY )
323331 $(INSTALL_DATA ) Modules/config.c $(LIBPL ) /config.c
324332 $(INSTALL_DATA ) $(srcdir ) /Modules/getpath.c $(LIBPL ) /getpath.c
325333 $(INSTALL_DATA ) $(srcdir ) /Modules/getbuildinfo.c $(LIBPL ) /getbuildinfo.c
@@ -420,7 +428,7 @@ clean: localclean
420428 done
421429
422430localclobber : localclean
423- -rm -f tags TAGS python
431+ -rm -f tags TAGS python $( LIBRARY )
424432 -rm -f config.log config.cache config.h
425433
426434clobber : localclobber
0 commit comments