Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1eec528

Browse files
committed
Build getbuildno.o here, to adequately update it every time a new
python executable is built. (It still won't reflect builds of the library only, but since the default make target builds the python executable, that's alright.)
1 parent 630924f commit 1eec528

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Makefile.in

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
VERSION= @VERSION@
8181
srcdir= @srcdir@
8282
VPATH= @srcdir@
83+
CC= @CC@
8384
RANLIB= @RANLIB@
85+
DEFS= @DEFS@
8486

8587
# Machine-dependent subdirectories
8688
MACHDEP= @MACHDEP@
@@ -139,17 +141,29 @@ DISTFILES= README ChangeLog $(CONFIGFILES)
139141
DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
140142
DIST= $(DISTFILES) $(DISTDIRS)
141143

144+
# Compilation flags for getbuildinfo.c only
145+
CFLAGS= $(OPT) -I. $(DEFS)
146+
142147
LIBRARY= libpython$(VERSION).a
143148

144149
# Default target
145150
all: $(LIBRARY) python
146151

147152
# Build the interpreter
148-
python: $(LIBRARY)
153+
python: $(LIBRARY) buildno
154+
expr `cat buildno` + 1 >@buildno
155+
mv @buildno buildno
156+
$(CC) -c $(CFLAGS) -DBUILD=`cat buildno` \
157+
$(srcdir)/Modules/getbuildinfo.c
158+
$(AR) cr $(LIBRARY) getbuildinfo.o
159+
$(RANLIB) $(LIBRARY)
149160
cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
150161
prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
151162
LIBRARY=../$(LIBRARY) link
152163

164+
buildno:
165+
echo 0 >buildno
166+
153167
# Build the library
154168
$(LIBRARY): $(SUBDIRS)
155169
if test ! -f $(LIBRARY); \

0 commit comments

Comments
 (0)