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>
%.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$<"