]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
Mark dist hooks as phony.
[cdecl99.git] / Makefile.am
index 1ef288bfef58f1b2027534e91ba3543223ff43ce..e40e69c84c23dc26106baadd941de20ce7276516 100644 (file)
@@ -17,12 +17,16 @@ AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
        -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
        -DLOCALEDIR=\"$(localedir)\"
 
+AM_CFLAGS = $(GSL_CFLAGS)
+
 MAINTAINERCLEANFILES = src/scan.c src/scan.h src/scan.stamp \
        src/parse.c src/parse.h src/parse.stamp
 
-CLEANFILES = src/validtypes.h src/errtab.h test/typegen.h
+CLEANFILES = src/validtypes.h src/errtab.h src/namespecs.h src/ordspecs.h \
+       test/typegen.h
 
 EXTRA_DIST = m4/gnulib-cache.m4 src/types.lst src/validtypes.sed \
+       src/specs.lst src/namespecs.sed src/ordspecs.sed \
        src/errors.lst src/strtab.sed \
        src/parse.stamp src/scan.stamp \
        COPYING.WTFPL2
@@ -31,7 +35,7 @@ dist_man_MANS = doc/man/cdecl99.1 doc/man/libcdecl.3
 
 include_HEADERS = src/cdecl.h
 noinst_HEADERS = conf_post.h src/typemap.h src/output.h src/scan.h \
-       src/parse.h src/i18n.h src/error.h
+       src/parse.h src/i18n.h src/normalize.h src/error.h
 
 noinst_DATA = $(MOFILES)
 
@@ -48,7 +52,6 @@ bin_PROGRAMS = cdecl99
 
 check_PROGRAMS =
 EXTRA_LTLIBRARIES = libtest.la
-libtest_la_CFLAGS = $(AM_CFLAGS) $(GSL_CFLAGS)
 libtest_la_LIBADD = $(GSL_LIBS)
 libtest_la_SOURCES = test/testlib.c
 
@@ -71,10 +74,7 @@ src/typemap.lo: src/validtypes.h
 src/error.lo: src/errtab.h
 src/normalize.lo: src/ordspecs.h
 src/output.lo: src/namespecs.h
-
-# This is gross.
-declgen_o = test/libtest_la-declgen.lo
-$(declgen_o): test/typegen.h
+test/declgen.lo: test/typegen.h
 
 src/validtypes.h: $(srcdir)/src/types.lst $(srcdir)/src/validtypes.sed
        $(AM_V_GEN)sed -f $(srcdir)/src/validtypes.sed \
@@ -164,9 +164,20 @@ src/parse.c src/parse.h: src/parse.stamp
 # up-to-date timestamps, otherwise make will try to update them in a fresh
 # VPATH build.
 dist-hook: update-headers
-update-headers:
+update-headers: unfuck-distdir
        touch -c '$(distdir)/src/scan.h'
        touch -c '$(distdir)/src/parse.h'
+.PHONY: update-headers
+
+# When running "make dist" in a VPATH build with a read-only srcdir, Automake
+# will produce a distribution with all files read-only.  Moreover, the files
+# are read-only in distdir when the dist hooks are run.  This hook will
+# manually fix up the permissions.  All dist hooks that modify files in distdir
+# should list unfuck-distdir as a prerequisite.
+dist-hook: unfuck-distdir
+unfuck-distdir:
+       find '$(distdir)' -type f -exec chmod u+w {} +
+.PHONY: unfuck-distdir
 
 # Supporting rules for bison/flex.