]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
Mark dist hooks as phony.
[cdecl99.git] / Makefile.am
index 1132d5af5b2c5d7ff72a6624760af2b580f31549..e40e69c84c23dc26106baadd941de20ce7276516 100644 (file)
@@ -17,6 +17,8 @@ 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
 
@@ -50,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
 
@@ -73,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 \
@@ -166,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.