mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
New build procedure.
This commit is contained in:
parent
914fbd9ae6
commit
f6ca6aa869
4 changed files with 66 additions and 58 deletions
|
@ -6,9 +6,6 @@
|
||||||
# brought up to date by running "make Makefile". (The makesetup also
|
# brought up to date by running "make Makefile". (The makesetup also
|
||||||
# creates config.c from config.c.in in the source directory.)
|
# 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 ===
|
# === Variables set by makesetup ===
|
||||||
|
|
||||||
MODOBJS= _MODOBJS_
|
MODOBJS= _MODOBJS_
|
||||||
|
@ -16,6 +13,7 @@ MODLIBS= _MODLIBS_
|
||||||
|
|
||||||
# === Variables set by configure ===
|
# === Variables set by configure ===
|
||||||
|
|
||||||
|
VERSION= @VERSION@
|
||||||
srcdir= @srcdir@
|
srcdir= @srcdir@
|
||||||
VPATH= @srcdir@
|
VPATH= @srcdir@
|
||||||
|
|
||||||
|
@ -92,51 +90,51 @@ MAKESETUP= $(srcdir)/makesetup
|
||||||
|
|
||||||
# === Fixed definitions ===
|
# === Fixed definitions ===
|
||||||
|
|
||||||
OBJS= $(MODOBJS)
|
FIXOBJS= config.o getpath.o main.o getbuildinfo.o
|
||||||
|
OBJS= $(MODOBJS) $(FIXOBJS)
|
||||||
|
|
||||||
# XXX Should getpath.o (and may be others) be added to OBJS?
|
MAINOBJ= python.o
|
||||||
|
|
||||||
ADDOBJS= main.o config.o getpath.o getbuildinfo.o
|
|
||||||
|
|
||||||
LIB= libModules.a
|
|
||||||
|
|
||||||
MYLIBS= $(LIB) \
|
|
||||||
../Python/libPython.a \
|
|
||||||
../Objects/libObjects.a \
|
|
||||||
../Parser/libParser.a
|
|
||||||
|
|
||||||
SYSLIBS= $(LIBM) $(LIBC)
|
SYSLIBS= $(LIBM) $(LIBC)
|
||||||
|
|
||||||
|
LIBRARY= ../libpython$(VERSION).a
|
||||||
|
|
||||||
# === Rules ===
|
# === Rules ===
|
||||||
|
|
||||||
all: $(LIB) ../python sharedmods
|
all: $(OBJS) sharedmods
|
||||||
|
|
||||||
|
# Targets for Jim Fulton's extension Makefiles -- are these still needed?
|
||||||
asharedmodule: $(ASHAREDMODULE)$(SO)
|
asharedmodule: $(ASHAREDMODULE)$(SO)
|
||||||
|
|
||||||
$(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS)
|
$(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS)
|
||||||
$(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \
|
$(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \
|
||||||
$(ASHAREDMODULESEXTRA)
|
$(ASHAREDMODULESEXTRA)
|
||||||
|
|
||||||
$(LIB): $& $(OBJS) Makefile
|
# This target is used by the master Makefile to add the objects to the library.
|
||||||
-rm -f $(LIB)
|
# To deal with the conflict between signalmodule.o and sigcheck.o,
|
||||||
$(AR) cr $(LIB) $(OBJS)
|
# we remove the latter if we have the former.
|
||||||
$(RANLIB) $(LIB)
|
add2lib: $(OBJS) buildno
|
||||||
|
|
||||||
../python: $(MYLIBS) $(ADDOBJS) Makefile buildno
|
|
||||||
expr `cat buildno` + 1 >@buildno
|
expr `cat buildno` + 1 >@buildno
|
||||||
mv @buildno buildno
|
mv @buildno buildno
|
||||||
$(CC) -c $(CFLAGS) -DBUILD=`cat buildno` $(srcdir)/getbuildinfo.c
|
$(CC) -c $(CFLAGS) -DBUILD=`cat buildno` \
|
||||||
$(AR) r $(LIB) getbuildinfo.o
|
$(srcdir)/getbuildinfo.c
|
||||||
$(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
|
$(AR) cr $(LIBRARY) $(OBJS)
|
||||||
$(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
|
-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
|
mv python ../python
|
||||||
|
|
||||||
buildno:
|
buildno:
|
||||||
echo 0 >buildno
|
echo 0 >buildno
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
|
-rm -f *.o python core *~ [@,#]* *.old *.orig *.rej add2lib
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
-rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
|
-rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
|
||||||
|
@ -150,7 +148,11 @@ getpath.o: getpath.c Makefile
|
||||||
-DVPATH='"$(VPATH)"' \
|
-DVPATH='"$(VPATH)"' \
|
||||||
$(srcdir)/getpath.c
|
$(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
|
config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local
|
||||||
|
-rm -f $(LIBRARY)
|
||||||
$(SHELL) $(MAKESETUP) Setup Setup.local
|
$(SHELL) $(MAKESETUP) Setup Setup.local
|
||||||
|
|
||||||
Setup:
|
Setup:
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
# === Variables set by config.stat ===
|
# === Variables set by config.stat ===
|
||||||
|
|
||||||
|
VERSION= @VERSION@
|
||||||
|
|
||||||
srcdir= @srcdir@
|
srcdir= @srcdir@
|
||||||
VPATH= @srcdir@
|
VPATH= @srcdir@
|
||||||
|
|
||||||
|
@ -44,20 +46,19 @@ SRCS= abstract.c \
|
||||||
sliceobject.c stringobject.c \
|
sliceobject.c stringobject.c \
|
||||||
tupleobject.c typeobject.c
|
tupleobject.c typeobject.c
|
||||||
|
|
||||||
LIB= libObjects.a
|
LIBRARY= ../libpython$(VERSION).a
|
||||||
|
|
||||||
|
|
||||||
# === Rules ===
|
# === Rules ===
|
||||||
|
|
||||||
all: $(LIB)
|
all: $(OBJS)
|
||||||
|
|
||||||
$(LIB): $& $(OBJS)
|
# This target is used by the master Makefile to add the objects to the library
|
||||||
-rm -f $(LIB)
|
add2lib: $(OBJS)
|
||||||
$(AR) cr $(LIB) $(OBJS)
|
$(AR) cr $(LIBRARY) $(OBJS)
|
||||||
$(RANLIB) $(LIB)
|
touch add2lib
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o core *~ [@,#]* *.old *.orig *.rej
|
-rm -f *.o core *~ [@,#]* *.old *.orig *.rej add2lib
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
-rm -f *.a tags TAGS
|
-rm -f *.a tags TAGS
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
# === Variables set by config.stat ===
|
# === Variables set by config.stat ===
|
||||||
|
|
||||||
|
VERSION= @VERSION@
|
||||||
|
|
||||||
srcdir= @srcdir@
|
srcdir= @srcdir@
|
||||||
VPATH= @srcdir@
|
VPATH= @srcdir@
|
||||||
|
|
||||||
|
@ -26,35 +28,38 @@ SHELL= /bin/sh
|
||||||
|
|
||||||
# === Fixed definitions ===
|
# === Fixed definitions ===
|
||||||
|
|
||||||
PARSEROBJS= acceler.o grammar1.o \
|
POBJS= acceler.o grammar1.o \
|
||||||
intrcheck.o listnode.o myreadline.o node.o parser.o \
|
listnode.o node.o parser.o \
|
||||||
parsetok.o tokenizer.o bitset.o \
|
parsetok.o tokenizer.o bitset.o \
|
||||||
firstsets.o grammar.o metagrammar.o pgen.o \
|
firstsets.o grammar.o metagrammar.o pgen.o \
|
||||||
printgrammar.o
|
printgrammar.o
|
||||||
|
|
||||||
PGENOBJS= pgenmain.o
|
OBJS= $(POBJS) intrcheck.o myreadline.o
|
||||||
|
|
||||||
OBJS= $(PGENOBJS) $(PARSEROBJS)
|
PGENMAIN= pgenmain.o
|
||||||
|
|
||||||
|
PGENOBJS= $(PGENMAIN) $(POBJS)
|
||||||
|
|
||||||
|
DOBJS= $(PGENMAIN) $(OBJS)
|
||||||
|
|
||||||
PGEN= pgen
|
PGEN= pgen
|
||||||
|
|
||||||
LIB= libParser.a
|
LIBRARY= ../libpython$(VERSION).a
|
||||||
|
|
||||||
|
|
||||||
# === Rules ===
|
# === Rules ===
|
||||||
|
|
||||||
all: $(LIB) $(PGEN)
|
all: $(PGEN) $(OBJS)
|
||||||
|
|
||||||
$(LIB): $& $(PARSEROBJS)
|
# This target is used by the master Makefile to add the objects to the library
|
||||||
-rm -f $(LIB)
|
add2lib: $(OBJS)
|
||||||
$(AR) cr $(LIB) $(PARSEROBJS)
|
$(AR) cr $(LIBRARY) $(OBJS)
|
||||||
$(RANLIB) $(LIB)
|
touch add2lib
|
||||||
|
|
||||||
$(PGEN): $(PGENOBJS) $(LIB)
|
$(PGEN): $(PGENOBJS)
|
||||||
$(CC) $(OPT) $(PGENOBJS) $(LIB) -o $(PGEN)
|
$(CC) $(OPT) $(PGENOBJS) -o $(PGEN)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o core *~ [@,#]* *.old *.orig *.rej
|
-rm -f *.o core *~ [@,#]* *.old *.orig *.rej add2lib
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
-rm -f $(PGEN) *.a tags TAGS
|
-rm -f $(PGEN) *.a tags TAGS
|
||||||
|
@ -64,7 +69,7 @@ Makefile: $(srcdir)/Makefile.in ../config.status
|
||||||
$(SHELL) config.status)
|
$(SHELL) config.status)
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
$(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
|
$(MKDEP) $(CFLAGS) `echo $(DOBJS) | tr ' ' '\012' | \
|
||||||
sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
|
sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
.PRECIOUS: Makefile
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
# === Variables set by config.stat ===
|
# === Variables set by config.stat ===
|
||||||
|
|
||||||
|
VERSION= @VERSION@
|
||||||
|
|
||||||
srcdir= @srcdir@
|
srcdir= @srcdir@
|
||||||
VPATH= @srcdir@
|
VPATH= @srcdir@
|
||||||
|
|
||||||
|
@ -46,22 +48,20 @@ OBJS= \
|
||||||
traceback.o \
|
traceback.o \
|
||||||
$(LIBOBJS)
|
$(LIBOBJS)
|
||||||
|
|
||||||
LIB= libPython.a
|
LIBRARY= ../libpython$(VERSION).a
|
||||||
|
|
||||||
SYSLIBS= -lm
|
|
||||||
|
|
||||||
|
|
||||||
# === Rules ===
|
# === Rules ===
|
||||||
|
|
||||||
all: $(LIB)
|
all: $(OBJS)
|
||||||
|
|
||||||
$(LIB): $& $(OBJS)
|
# This target is used by the master Makefile to add the objects to the library
|
||||||
-rm -f $(LIB)
|
add2lib: $(OBJS)
|
||||||
$(AR) cr $(LIB) $(OBJS)
|
$(AR) cr $(LIBRARY) $(OBJS)
|
||||||
$(RANLIB) $(LIB)
|
touch add2lib
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o core *~ [@,#]* *.old *.orig *.rej
|
-rm -f *.o core *~ [@,#]* *.old *.orig *.rej add2lib
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
-rm -f *.a tags TAGS
|
-rm -f *.a tags TAGS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue