From 998f010120cf91578717d3ed037bad16f80c963f Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 16 Jan 2014 18:12:06 +0000 Subject: build: fix recursive parser.h inclusion Ocassionally when regenerating the scanner or parser (not sure which), recursive inclusion of the parser.h file occurs. The reason is that bison doesn't generate a header sandwich to protect against this (*sigh*). Change the makefile to do this manually. Signed-off-by: Patrick McHardy --- Makefile.rules.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Makefile.rules.in') diff --git a/Makefile.rules.in b/Makefile.rules.in index 25988dd7..ae563a54 100644 --- a/Makefile.rules.in +++ b/Makefile.rules.in @@ -22,7 +22,14 @@ configure: configure.ac %.c %.h: %.y $(makedeps) @echo -e " YACC\t\t$<" - $(YACC) $(YACCFLAGS) -d -o $@ $< + $(YACC) $(YACCFLAGS) --defines=$*.h.tmp -o $@ $< + ( \ + echo "#ifndef __$(*F)_H"; \ + echo "#define __$(*F)_H"; \ + cat $*.h.tmp; \ + echo "#endif /* __$(*F)_H */" \ + ) > $*.h + $(RM) $*.h.tmp %.c %.h: %.l $(makedeps) @echo -e " LEX\t\t$<" -- cgit v1.2.3