summaryrefslogtreecommitdiffstats
path: root/Modules/Makefile.pre.in
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-07-19 19:39:57 (GMT)
committerGuido van Rossum <guido@python.org>1997-07-19 19:39:57 (GMT)
commitf6ca6aa8696ff232d2c755fb97cf9264c753d036 (patch)
tree12c6a607a0bc7474fe6f1427fb3de8826026f706 /Modules/Makefile.pre.in
parent914fbd9ae67fd86cfe99e5e5139f2af82deb44e3 (diff)
downloadcpython-f6ca6aa8696ff232d2c755fb97cf9264c753d036.zip
cpython-f6ca6aa8696ff232d2c755fb97cf9264c753d036.tar.gz
cpython-f6ca6aa8696ff232d2c755fb97cf9264c753d036.tar.bz2
New build procedure.
Diffstat (limited to 'Modules/Makefile.pre.in')
-rw-r--r--Modules/Makefile.pre.in54
1 files changed, 28 insertions, 26 deletions
diff --git a/Modules/Makefile.pre.in b/Modules/Makefile.pre.in
index 6a3e5e5..4c6b315 100644
--- a/Modules/Makefile.pre.in
+++ b/Modules/Makefile.pre.in
@@ -6,9 +6,6 @@
# brought up to date by running "make Makefile". (The makesetup also
# creates config.c from config.c.in in the source directory.)
-# Interpreter version number, for library destination pathnames
-VERSION= 1.5
-
# === Variables set by makesetup ===
MODOBJS= _MODOBJS_
@@ -16,6 +13,7 @@ MODLIBS= _MODLIBS_
# === Variables set by configure ===
+VERSION= @VERSION@
srcdir= @srcdir@
VPATH= @srcdir@
@@ -92,51 +90,51 @@ MAKESETUP= $(srcdir)/makesetup
# === Fixed definitions ===
-OBJS= $(MODOBJS)
-
-# XXX Should getpath.o (and may be others) be added to OBJS?
-
-ADDOBJS= main.o config.o getpath.o getbuildinfo.o
+FIXOBJS= config.o getpath.o main.o getbuildinfo.o
+OBJS= $(MODOBJS) $(FIXOBJS)
-LIB= libModules.a
-
-MYLIBS= $(LIB) \
- ../Python/libPython.a \
- ../Objects/libObjects.a \
- ../Parser/libParser.a
+MAINOBJ= python.o
SYSLIBS= $(LIBM) $(LIBC)
+LIBRARY= ../libpython$(VERSION).a
# === Rules ===
-all: $(LIB) ../python sharedmods
+all: $(OBJS) sharedmods
+# Targets for Jim Fulton's extension Makefiles -- are these still needed?
asharedmodule: $(ASHAREDMODULE)$(SO)
$(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS)
$(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \
$(ASHAREDMODULESEXTRA)
-$(LIB): $& $(OBJS) Makefile
- -rm -f $(LIB)
- $(AR) cr $(LIB) $(OBJS)
- $(RANLIB) $(LIB)
-
-../python: $(MYLIBS) $(ADDOBJS) Makefile buildno
+# This target is used by the master Makefile to add the objects to the library.
+# To deal with the conflict between signalmodule.o and sigcheck.o,
+# we remove the latter if we have the former.
+add2lib: $(OBJS) buildno
expr `cat buildno` + 1 >@buildno
mv @buildno buildno
- $(CC) -c $(CFLAGS) -DBUILD=`cat buildno` $(srcdir)/getbuildinfo.c
- $(AR) r $(LIB) getbuildinfo.o
- $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
- $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
+ $(CC) -c $(CFLAGS) -DBUILD=`cat buildno` \
+ $(srcdir)/getbuildinfo.c
+ $(AR) cr $(LIBRARY) $(OBJS)
+ -if ar x $(LIBRARY) signalmodule.o 2>/dev/null; \
+ then ar d $(LIBRARY) sigcheck.o 2>/dev/null; true; \
+ else true; fi
+ touch add2lib
+
+# This target is used by the master Makefile to link the final binary.
+link: $(MAINOBJ)
+ $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(MAINOBJ) \
+ $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
mv python ../python
buildno:
echo 0 >buildno
clean:
- -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
+ -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej add2lib
clobber: clean
-rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
@@ -150,7 +148,11 @@ getpath.o: getpath.c Makefile
-DVPATH='"$(VPATH)"' \
$(srcdir)/getpath.c
+# When the configuration changes, we remove the library, so that it
+# gets remade from scratch; this ensures to remove modules that are no
+# longer pertinent (but that were in a previous configuration).
config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local
+ -rm -f $(LIBRARY)
$(SHELL) $(MAKESETUP) Setup Setup.local
Setup: