]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
Fix "make dist" permissions when using a read-only srcdir.
[cdecl99.git] / Makefile.am
index 1132d5af5b2c5d7ff72a6624760af2b580f31549..535eff8630ef1f5ecc4c8a12313b1a3bb0a686d4 100644 (file)
@@ -166,10 +166,19 @@ 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'
 
+# 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 {} +
+
 # Supporting rules for bison/flex.
 
 BISON_V   = $(BISON_V_$(V))