summaryrefslogtreecommitdiffstats
path: root/siputils.py
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-01-09 20:30:09 +0100
committerSlávek Banko <slavek.banko@axis.cz>2022-01-10 01:10:25 +0100
commit123b20b74727a79a2dd84d8f90b3a47ce76a7ad6 (patch)
tree1a297cfcbb1a7249864b062556c5964ff4a66336 /siputils.py
parent32d72527ff6ddd27a823f0b68ff811daa5692719 (diff)
downloadsip4-tqt-123b20b74727a79a2dd84d8f90b3a47ce76a7ad6.tar.gz
sip4-tqt-123b20b74727a79a2dd84d8f90b3a47ce76a7ad6.zip
Add an explicit rule to generate parser.
Delete generated files from source code. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'siputils.py')
-rw-r--r--siputils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/siputils.py b/siputils.py
index fd48d94..ca3d92e 100644
--- a/siputils.py
+++ b/siputils.py
@@ -971,6 +971,10 @@ class Makefile:
root, discard = os.path.splitext(f)
mfile.write("\t-%s tqmoc_%s.cpp\n" % (self.rm, root))
+ # Cleanup generated parser files
+ if os.path.exists("%s/parser.y" % self._src_dir):
+ mfile.write("\t-%s parser.h parser.c\n" % self.rm)
+
def ready(self):
"""The Makefile is now ready to be used.
"""
@@ -1062,6 +1066,10 @@ class Makefile:
if self._src_dir != self.dir:
mfile.write("VPATH = %s\n\n" % self._src_dir)
+ # Add rule to generate parser
+ if os.path.exists("%s/parser.y" % self._src_dir):
+ mfile.write("parser.c parser.h: parser.y\n\t$(YACC) $(YFLAGS) -d -o $@ $<\n\n")
+
# These probably don't matter.
if self.generator == "MINGW":
mfile.write(".SUFFIXES: .cpp .cxx .cc .C .c\n\n")