summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 108cdcc6..b2815e9c 100644
--- a/Makefile
+++ b/Makefile
@@ -241,6 +241,8 @@ define NL
endef
+CM := ,
+
define DEP
$(1): $(2)
@@ -259,6 +261,9 @@ $(eval $(foreach item,lex.yy.o txr.o match.o parser.o,\
$(eval $(foreach item,y.tab.c y.tab.h lex.yy.c,\
$(call DEP,$(item),config.make config.h)))
+BS_LIC_FROM := ^[/][*] Bison impl
+BS_LIC_TO := Bison. [*][/]
+
lex.yy.c: $(top_srcdir)parser.l
$(call ABBREV,LEX)
$(call SH,rm -f $@)
@@ -286,6 +291,11 @@ y.tab.c: $(top_srcdir)parser.y
$(call SH,rm -f y.tab.c)
$(call SH, \
if $(TXR_YACC) -v -d $< ; then \
+ grep -qs '$(BS_LIC_FROM)' y.tab.c && \
+ grep -qs '$(BS_LIC_TO)' y.tab.c && \
+ sed -e '/$(BS_LIC_FROM)/$(CM)/$(BS_LIC_TO)/d' \
+ < y.tab.c > y.tab.c.tmp && \
+ mv y.tab.c.tmp y.tab.c ; \
chmod a-w y.tab.c ; \
sed -e '/yyparse/d' < y.tab.h > y.tab.h.tmp && \
mv y.tab.h.tmp y.tab.h ; \