]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
libcdecl: Replace yytname array in the Bison parser.
[cdecl99.git] / Makefile.am
index 031c0a83ec9629ad74060a637bd2fea29f723abe..b8136eb3b6e65f85a0c9436baba9f2c962f9677c 100644 (file)
@@ -261,19 +261,22 @@ DEV_TOOL_ERROR = { \
   echo "       *** configure, consired setting $$toolvar and re-running configure."; \
   echo "       *** See config.log for more details."; } >&2; false
 
+DO_BISON = $(BISON) $(BISON_COMPAT) $(BISONFLAGS)
+
 .y.c: ;
 .y.stamp:
 if !HAVE_BISON
        $(BISON_V)tool=bison toolvar=BISON toolsrc=$<; $(DEV_TOOL_ERROR)
 endif
-       $(AM_V_at) touch $@.tmp
-       $(BISON_V) $(BISON) $(BISON_COMPAT) -o $*.c --defines=$*.h.tmp $(BISONFLAGS) $<
-       $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
-               rm -f $*.h.tmp; \
-       else \
-               mv -f $*.h.tmp $*.h; \
-       fi
+       $(BISON_V) : >$@.tmp
+       $(AM_V_at) $(DO_BISON) -o $*.c.tmp --defines=$*.h.tmp $<
+       $(AM_V_at) $(AWK) -f $(srcdir)/src/fix-yytname.awk $*.c.tmp >$*.c.t2
+       $(AM_V_at) mv -f $*.c.t2 $*.c
+       $(AM_V_at) cmp $*.h.tmp $*.h >/dev/null 2>&1 || mv -f $*.h.tmp $*.h
+       $(AM_V_at) rm -f $*.c.tmp $*.h.tmp
        $(AM_V_at) mv -f $@.tmp $@
+src/parse.stamp: $(srcdir)/src/fix-yytname.awk
+EXTRA_DIST += src/fix-yytname.awk
 
 .l.c: ;
 .l.stamp: