summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.rules.in9
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$<"