summaryrefslogtreecommitdiff
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2005-12-18 22:46:35 +0000
committerBarry Warsaw <barry@python.org>2005-12-18 22:46:35 +0000
commit35fc3e934d679ea35171a6ed36c8257eaeeccc2f (patch)
tree4560cee12e4de81af494e309eb957f4c1b99d5ec /Makefile.pre.in
parent3e6e93c8a0cdbedeeef997302a6137d3ef4474ae (diff)
downloadcpython-35fc3e934d679ea35171a6ed36c8257eaeeccc2f.tar.gz
Handle a couple of use cases discussed in python-dev w.r.t. calculating the
Subversion revision number. First, in an svn export, there will be no .svn directory, so use an in-file $Revision$ keyword string with the keyword chrome stripped off. Also, use $(srcdir) in the Makefile.pre.in to handle the case where Python is build outside the source tree.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in15
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0ce2afa685..020c86ed39 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -349,12 +349,9 @@ buildno: $(PARSER_OBJS) \
$(SIGNAL_OBJS) \
$(MODOBJS) \
$(srcdir)/Modules/getbuildinfo.c
- if test -d .svn; then \
- svnversion . >buildno; \
- elif test -f buildno; then \
- expr `cat buildno` + 1 >buildno1; \
- mv -f buildno1 buildno; \
- else echo 1 >buildno; fi
+ if test -d $(srcdir)/.svn; then \
+ svnversion $(srcdir) >buildno; \
+ fi
# Build static library
# avoid long command lines, same as LIBRARY_OBJS
@@ -446,7 +443,11 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist
# Special rules for object files
Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
- $(CC) -c $(PY_CFLAGS) -DBUILD=\"`cat buildno`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
+ if test -f buildno; then \
+ $(CC) -c $(PY_CFLAGS) -DBUILD=\"`cat buildno`\" -o $@ $(srcdir)/Modules/getbuildinfo.c ;\
+ else \
+ $(CC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/getbuildinfo.c ;\
+ fi
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \