summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorJanneke Nieuwenhuizen <janneke@gnu.org>2024-04-17 07:16:11 +0200
committerJanneke Nieuwenhuizen <janneke@gnu.org>2024-04-19 16:45:41 +0200
commit0cc0cf93671044ea67b9cf97f9ca1e936d5a7dc1 (patch)
treee0c9b774ef1d8f85c2ed71af6ee02cd177fb8667 /Makefile.am
parentf83b5274c8d67a9bccf8881cc4f87d76a3d172de (diff)
maint: Cater for running `make dist' from a tarball.
* Makefile.am: Use in_git_p conditional to disable Autotools' cache consistency assert and removal when bulding from tarball. (dist): Depend on doc-pot-update again when building from tarball. (dist-hook): Remove dependencies on gen-ChangeLog and gen-AUTHORS when building from tarball. (gen-ChangeLog, gen-AUTHORS): Remove guarding for building from tarball. Use set -e to avoid silently failing. (gen-tarball-version): Use $(SOURCE_DATE_EPOCH) instead of re-generating it using git; this also works running from a tarball. Change-Id: I9ebdd28a70837f6a4db610c4816bb283d176e2d9
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am60
1 files changed, 36 insertions, 24 deletions
diff --git a/Makefile.am b/Makefile.am
index ca3fa0a6930..af08bc546f5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -955,6 +955,20 @@ guix-binary.%.tar.xz:
955 guix` ; \ 955 guix` ; \
956 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" 956 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
957 957
958# The `dist' target has other dependencies when building from Git
959# to assert and achieve reproducibility.
960if in_git_p
961
962# The dependency on dist-doc-pot-update is to clean possibly stale doc and po
963# files and only then generate the .pot files, which are not checked in.
964dist: dist-doc-pot-update
965dist-doc-pot-update: auto-clean
966 $(MAKE) guile$(EXEEXT)
967 $(MAKE) -C po/guix all
968 $(MAKE) -C po/packages all
969 $(MAKE) doc-pot-update
970
971dist-hook: gen-ChangeLog gen-AUTHORS
958 972
959# Assert that Autotools cache is up to date with Git, by checking 973# Assert that Autotools cache is up to date with Git, by checking
960# PACKAGE_VERSION against HEAD. Indented to get past Automake. 974# PACKAGE_VERSION against HEAD. Indented to get past Automake.
@@ -969,20 +983,20 @@ guix-binary.%.tar.xz:
969 $(error Cannot create reproducible tarball) 983 $(error Cannot create reproducible tarball)
970 else 984 else
971 $(warning Tarball will be irreproducible; distdir will not get removed!) 985 $(warning Tarball will be irreproducible; distdir will not get removed!)
972 endif 986 endif # !GUIX_ALLOW_IRREPRODUCIBLE_TARBALL
973 endif 987 endif # PACKAGE_VERSION != git_version
974 endif 988 endif # MAKECMDGOALS dist
975 989
976# The dependency on dist-doc-pot-update is to clean possibly stale doc and po 990else # !in_git_p
977# files and only then generate the .pot files, which are not checked in. 991
978dist: dist-doc-pot-update 992dist: doc-pot-update
979dist-doc-pot-update: auto-clean
980 $(MAKE) guile$(EXEEXT)
981 $(MAKE) -C po/guix all
982 $(MAKE) -C po/packages all
983 $(MAKE) doc-pot-update
984 993
985dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version 994 ifeq ($(MAKECMDGOALS),dist)
995$(warning Not using Git, tarball will likely be irreproducible!)
996 endif # MAKECMDGOALS dist
997endif # !in_git_p
998
999dist-hook: gen-tarball-version
986dist-hook: assert-no-store-file-names 1000dist-hook: assert-no-store-file-names
987 1001
988distcheck-hook: assert-binaries-available assert-final-inputs-self-contained 1002distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
@@ -994,27 +1008,25 @@ $(top_srcdir)/.version: config.status
994 1008
995gen-tarball-version: 1009gen-tarball-version:
996 echo $(VERSION) > "$(distdir)/.tarball-version" 1010 echo $(VERSION) > "$(distdir)/.tarball-version"
997 git show HEAD --format=%ct --no-patch > $(distdir)/.tarball-timestamp 1011 echo $(SOURCE_DATE_EPOCH) > $(distdir)/.tarball-timestamp
998 1012
999gen-ChangeLog: 1013gen-ChangeLog:
1000 $(AM_V_GEN)if test -e .git; then \ 1014 $(AM_V_GEN)set -e; \
1001 export LC_ALL=en_US.UTF-8; \ 1015 export LC_ALL=en_US.UTF-8; \
1002 export TZ=UTC0; \ 1016 export TZ=UTC0; \
1003 $(top_srcdir)/build-aux/gitlog-to-changelog \ 1017 $(top_srcdir)/build-aux/gitlog-to-changelog \
1004 > $(distdir)/ChangeLog.tmp; \ 1018 > $(distdir)/ChangeLog.tmp; \
1005 rm -f $(distdir)/ChangeLog; \ 1019 rm -f $(distdir)/ChangeLog; \
1006 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \ 1020 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog;
1007 fi
1008 1021
1009gen-AUTHORS: 1022gen-AUTHORS:
1010 $(AM_V_GEN)if test -e .git; then \ 1023 $(AM_V_GEN)set -e; \
1011 rm -f "$(distdir)/AUTHORS"; \ 1024 rm -f "$(distdir)/AUTHORS"; \
1012 export LC_ALL=en_US.UTF-8; \ 1025 export LC_ALL=en_US.UTF-8; \
1013 export TZ=UTC0; \ 1026 export TZ=UTC0; \
1014 $(top_builddir)/pre-inst-env "$(GUILE)" \ 1027 $(top_builddir)/pre-inst-env "$(GUILE)" \
1015 "$(top_srcdir)/build-aux/generate-authors.scm" \ 1028 "$(top_srcdir)/build-aux/generate-authors.scm" \
1016 "$(top_srcdir)" "$(distdir)/AUTHORS"; \ 1029 "$(top_srcdir)" "$(distdir)/AUTHORS";
1017 fi
1018 1030
1019# Like 'dist', but regenerate 'configure' so we get an up-to-date 1031# Like 'dist', but regenerate 'configure' so we get an up-to-date
1020# 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to 1032# 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to