Skip to content

Commit

Permalink
chore(build): Work towards distcheck being functional
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Aug 20, 2024
1 parent 00abf9b commit d9c6011
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ build-aux/ltsugar.m4
build-aux/ltversion.m4
build-aux/lt~obsolete.m4
build-aux/missing
build-aux/list-dist-files.sh
build-aux/list-distfiles.sh
tests/regressions.pl

# Other autojunk
Expand Down
24 changes: 14 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ export DISABLEDSRCS ?= $(filter $(_DISABLEDSRCS),$(_TESTSRCS))
TESTSRCS ?= $(filter-out $(DISABLEDSRCS),$(_TESTSRCS))
TESTPREVIEWS ?= $(addsuffix .pdf,$(basename $(filter-out $(_DISABLEDSRCS),$(_TESTPREVIEWS))))

# Since we can't use $(wildcard ...) in automake file lists, we generate a file
# with a script that builds our dynamic file lists instead. This is tricky,
# because if we just include the file automake will flatten this include. By
# using $(wildcard ...) to include it (the very function we couldn't use because
# of the race condition it creates) we actually keep it from being flattened and
# hence evaluated when we want it to be. Since the file always exists (see
# BUILT_SOURCES) this doesn't induce a race.
include $(wildcard Makefile-distfiles)
# Since we can't use $(wildcard ...) while defining file lists automake, we
# generate a file with a script that builds our dynamic file lists ahead of
# time and stores them in a variable. Using an include here is tricky, because
# if we just include the file directly automake will flatten it. By using
# $(wildcard ...) to include it (the very function we couldn't use where we
# wanted to in the first place) we keep the include from being flattened and
# hence evaluated where we want it to be. Otherwise the flattening gets the
# variables set in all the wrong order. Since the file will be generated by
# a make (see BUILT_SOURCES) before make dist the source will exist in time.
include $(wildcard $(top_srcdir)/Makefile-distfiles)

FIGURES = documentation/fig-input-to-output.pdf
MANUAL := documentation/sile.pdf
Expand Down Expand Up @@ -69,7 +71,7 @@ dist_doc_DATA = README.md CHANGELOG.md
dist_pdf_DATA = $(_MANUAL)
dist_license_DATA = LICENSE.md
EXTRA_DIST = spec tests documentation sile-dev-1.rockspec fontconfig.conf
EXTRA_DIST += build-aux/action-updater.js build-aux/cargo-updater.js build-aux/config.ld build-aux/decore-automake.sh build-aux/git-version-gen build-aux/list-dist-files.sh
EXTRA_DIST += build-aux/action-updater.js build-aux/cargo-updater.js build-aux/config.ld build-aux/decore-automake.sh build-aux/git-version-gen
EXTRA_DIST += Dockerfile build-aux/docker-bootstrap.sh build-aux/docker-fontconfig.conf hooks/build
EXTRA_DIST += default.nix flake.nix flake.lock shell.nix build-aux/pkg.nix
EXTRA_DIST += package.json # imported by both Nix and Docker
Expand Down Expand Up @@ -106,7 +108,7 @@ export DOCKER_TAG ?= HEAD
include $(top_srcdir)/aminclude.am

Makefile-distfiles: $(wildcard .version .tarball-version) | $(LUAMODLOCK)
$(SHELL) build-aux/list-dist-files.sh > $@
$(SHELL) build-aux/list-distfiles.sh > $@

if EMBEDDED_RESOURCES
_EMBEDDED_SOURCES = src/embed.rs src/embed-includes.rs
Expand Down Expand Up @@ -183,6 +185,8 @@ CLEAN ?=

dist: sile-$(VERSION).pdf sile-$(VERSION).md

dist-local: $(BUILT_SOURCES)

sile-$(VERSION).pdf: $(MANUAL)
$(INSTALL) $(MANUAL) $@

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ alias sort="${SORT:-@SORT@}"
alias xargs="${XARGS:-@XARGS@}"

finder () {
test -d "$1" || return 1
test -d "$1" || return 0
find "$@" -type f | am_list
}

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ AC_SUBST([ROCKREV], [1])

QUE_SUBST_MAN_DATE

AC_CONFIG_FILES([build-aux/list-dist-files.sh], [chmod +x build-aux/list-dist-files.sh])
AC_CONFIG_FILES([build-aux/list-distfiles.sh], [chmod +x build-aux/list-distfiles.sh])
AC_CONFIG_FILES([Makefile justenough/Makefile sile-lua.1 core/features.lua core/pathsetup.lua core/version.lua])
AC_CONFIG_FILES([sile-lua:sile.in], [chmod +x sile-lua])
AC_CONFIG_FILES([tests/regressions.pl], [chmod +x tests/regressions.pl])
Expand Down

0 comments on commit d9c6011

Please sign in to comment.