]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
libcdecl: Prefer memchr over strchr in the scanner.
[cdecl99.git] / Makefile.am
index 031c0a83ec9629ad74060a637bd2fea29f723abe..336e4439ba82f760cb776d09d7ef32fb8894cafd 100644 (file)
@@ -43,7 +43,7 @@ libcdecl_la_LDFLAGS = -export-symbols-regex '^cdecl_([[:lower:]]|_gl_)' \
                       -no-undefined -version-info 1:0:0
 libcdecl_la_SOURCES = src/scan.c src/parse.c src/parse-decl.c src/output.c \
                       src/explain.c src/declare.c src/error.c src/normalize.c \
-                      src/cdecl-internal.h src/errmsg.h
+                      src/keywords.c src/cdecl-internal.h src/errmsg.h
 libcdecl_la_LIBADD = $(shared_gl_objects) $(LTLIBINTL) $(LIBTHREAD)
 EXTRA_libcdecl_la_DEPENDENCIES = $(shared_gl_objects)
 $(libcdecl_la_OBJECTS): $(gnulib_headers)
@@ -100,17 +100,22 @@ t_rng_test_LDADD = $(TEST_LIBS)
 $(t_rng_test_OBJECTS): $(gnulib_headers)
 EXTRA_DIST += t/xos256p.c
 
+check_PROGRAMS += t/rendertest
+t_rendertest_LDADD = $(TEST_LIBS)
+$(t_rendertest_OBJECTS): $(gnulib_headers)
+
+src/error.lo: src/errmsg.h
+src/keywords.lo: src/parse.h
+src/output.lo: src/parse.h src/specstr.h
+src/parse-decl.lo: src/scan.h src/parse.h src/typemap.h src/errmsg.h
 src/parse.lo: src/scan.h src/errmsg.h
 src/scan.lo: src/parse.h src/errmsg.h
-src/parse-decl.lo: src/scan.h src/parse.h src/typemap.h src/errmsg.h
-src/output.lo: src/specstr.h
-src/error.lo: src/errmsg.h
 t/declgen.$(OBJEXT): t/typegen.h
 t/cdeclerr.$(OBJEXT): src/errmsg.h
 
 check_PROGRAMS += t/cdeclerr
 t_cdeclerr_SOURCES = common/src/tap.c t/cdeclerr.c
-EXTRA_t_cdeclerr_DEPENDENCIES = src/error.lo $(shared_gl_objects)
+EXTRA_t_cdeclerr_DEPENDENCIES = src/error.lo src/output.lo $(shared_gl_objects)
 t_cdeclerr_LDADD = $(EXTRA_t_cdeclerr_DEPENDENCIES) $(LIBTHREAD)
 $(t_cdeclerr_OBJECTS): $(gnulib_headers)
 
@@ -261,19 +266,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:
@@ -306,12 +314,15 @@ V_GPERF   = $(V_GPERF_@AM_V@)
 V_GPERF_  = $(V_GPERF_@AM_DEFAULT_V@)
 V_GPERF_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'GPERF   ' $@;
 
-GPERFFILES = src/execute.gperf
+GPERFFILES = src/execute.gperf src/keywords.gperf
 .gperf.c:
        $(V_GPERF) $(GPERF) $< >$@.tmp
-       $(AM_V_at) mv $@.tmp $@
+       $(AM_V_at) $(AWK) -f $(srcdir)/src/gperf-wordwrap.awk $@.tmp >$@.t2
+       $(AM_V_at) mv $@.t2 $@
+       $(AM_V_at) rm -f $@.tmp
 MAINTAINERCLEANFILES += $(GPERFFILES:.gperf=.c)
-EXTRA_DIST += $(GPERFFILES)
+EXTRA_DIST += $(GPERFFILES) src/gperf-wordwrap.awk
+$(GPERFFILES:.gperf=.c): $(srcdir)/src/gperf-wordwrap.awk
 
 atlocal: config.status
        $(AM_V_GEN) :; { \