+# Ensure that any generated headers, which may be left unchanged to improve
+# incremental build performance, are fully up-to-date in the distribution.
+dist-hook: update-headers
+update-headers: unfuck-distdir
+ touch -c $(distdir)/src/lexer.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 fix
+# up the permission. 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
+