]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
Give better errors when flex/bison are unavailable.
[cdecl99.git] / Makefile.am
index 6a8f1efe617e3960f51e8b6c35dae4f5e99b4fea..620b37bf1af4aee3c969819616b152422a73402f 100644 (file)
@@ -193,10 +193,19 @@ FLEX_V   = $(FLEX_V_@AM_V@)
 FLEX_V_  = $(FLEX_V_@AM_DEFAULT_V@)
 FLEX_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'FLEX    ' $<;
 
-.y.c: ;
-.l.c: ;
+DEV_TOOL_ERROR = { \
+  echo "ERROR: *** $$tool is missing on your system."; \
+  echo "       *** Because of this, I cannot compile $$toolsrc, but"; \
+  echo "       *** (perhaps because you modified it) the sources appear out"; \
+  echo "       *** of date.  If $$tool is installed but was not detected by"; \
+  echo "       *** configure, consired setting $$toolvar and re-running configure."; \
+  echo "       *** See config.log for more details."; } >&2; false
 
+.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 \
@@ -206,7 +215,11 @@ FLEX_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'FLEX    ' $<;
        fi
        $(AM_V_at) mv -f $@.tmp $@
 
+.l.c: ;
 .l.stamp:
+if !HAVE_FLEX
+       $(FLEX_V)tool=flex toolvar=FLEX toolsrc=$<; $(DEV_TOOL_ERROR)
+endif
        $(AM_V_at) touch $@.tmp
        $(FLEX_V) $(FLEX) -o $*.c --header-file=$*.h.tmp $(FLEXFLAGS) $<
        $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \