[Python-modules-commits] [sip4] 05/05: Regenerate lexer and parser source files during build.

Dmitry Shachnev mitya57 at moszumanska.debian.org
Wed Jul 27 17:50:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

mitya57 pushed a commit to branch master
in repository sip4.

commit 6910efffac79db667f605c303f8d4986515ac779
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Jul 27 20:48:51 2016 +0300

    Regenerate lexer and parser source files during build.
    
    Add a bison build-dependency for this.
---
 debian/changelog |  2 ++
 debian/control   |  3 ++-
 debian/rules     | 11 +++++++++--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1c035ec..c53a295 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ sip4 (4.18.1+dfsg-1) UNRELEASED; urgency=medium
 
   * New upstream release.
   * Document two new options in sip.1 manpage.
+  * Regenerate lexer and parser source files during build, using flex
+    and bison.
 
  -- Dmitry Shachnev <mitya57 at debian.org>  Tue, 26 Apr 2016 15:58:52 +0300
 
diff --git a/debian/control b/debian/control
index 45d81ad..f735370 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,8 @@ Uploaders: Torsten Marek <shlomme at debian.org>,
            Michael Casadevall <mcasadevall at debian.org>,
            Scott Kitterman <scott at kitterman.com>,
            Dmitry Shachnev <mitya57 at debian.org>
-Build-Depends: debhelper (>= 9),
+Build-Depends: bison,
+               debhelper (>= 9),
                dh-python,
                dpkg-dev (>= 1.16.1~),
                flex,
diff --git a/debian/rules b/debian/rules
index d88998c..715d8c3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,7 +27,13 @@ PYTHON3S := $(shell py3versions -vr)
 
 configure: $(PYTHONS:%=build-%/configure-stamp) $(PYTHONS:%=dbg-build-%/configure-stamp)
 
-build-%/configure-stamp: $(PYTHON3S:%=sipconfig-%)
+sipgen/lexer.c: sipgen/metasrc/lexer.l
+	flex --outfile=sipgen/lexer.c sipgen/metasrc/lexer.l
+
+sipgen/parser.c: sipgen/metasrc/parser.y
+	bison --yacc --defines=sipgen/parser.h --output=sipgen/parser.c sipgen/metasrc/parser.y
+
+build-%/configure-stamp: $(PYTHON3S:%=sipconfig-%) sipgen/lexer.c sipgen/parser.c
 	dh_testdir
 	mkdir -p build-$*
 	cp $(CURDIR)/sip.pyi $(CURDIR)/build-$*
@@ -39,7 +45,7 @@ build-%/configure-stamp: $(PYTHON3S:%=sipconfig-%)
 			LFLAGS="${LDFLAGS}" LFLAGS_RELEASE=""
 	touch $@
 
-dbg-build-%/configure-stamp:
+dbg-build-%/configure-stamp: sipgen/lexer.c sipgen/parser.c
 	dh_testdir
 	mkdir -p dbg-build-$*
 	cp $(CURDIR)/sip.pyi $(CURDIR)/dbg-build-$*
@@ -81,6 +87,7 @@ clean:
 	cp $(CURDIR)/debian/sipconfig_py3.header $(CURDIR)/debian/sipconfig_py3.py
 	rm -rf $(CURDIR)/debian/sipconfig_py3.py.tmp
 	rm -rf $(CURDIR)/sipconfig-3.*
+	rm -f sipgen/lexer.c sipgen/parser.h sipgen/parser.c sipgen/parser.output
 	dh_clean debian/python3-sip.pydist
 
 install-arch: build

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sip4.git



More information about the Python-modules-commits mailing list