diff options
author | Patrick McHardy <kaber@trash.net> | 2014-01-16 18:12:06 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-01-16 18:12:06 +0000 |
commit | 998f010120cf91578717d3ed037bad16f80c963f (patch) | |
tree | cc7f1581da1c868925689b3027d3e5ebae5e2f3d /Makefile.rules.in | |
parent | 86b965bdab8dc8735c4a846ec09bfbbadfae780b (diff) |
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 <kaber@trash.net>
Diffstat (limited to 'Makefile.rules.in')
-rw-r--r-- | Makefile.rules.in | 9 |
1 files changed, 8 insertions, 1 deletions
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$<" |