aboutsummaryrefslogtreecommitdiff
# SPDX-License-Identifier: CC0-1.0
#
# Copyright (C) 2023 Wojtek Kosior <koszko@koszko.org>

GUILE_SOURCE_FILES = \
	$(PACKAGE).scm \
	$(PACKAGE)/driver.scm

GUILE_OBJECT_FILES = $(GUILE_SOURCE_FILES:.scm=.go)

gobjdir = $(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache
nobase_gobj_DATA = $(GUILE_OBJECT_FILES)

scmdir = $(datarootdir)/guile/site/@GUILE_EFFECTIVE_VERSION@
nobase_dist_scm_DATA = $(GUILE_SOURCE_FILES)

.scm.go:
	$(top_builddir)/pre-inst-env $(GUILD) compile --output=$@ $<

changelogdir = $(docdir)
nobase_dist_changelog_DATA = \
	myra-test-utils/driver.scm.ChangeLog \
	myra-test-utils/driver.scm.ChangeLog.in.license

myra-test-utils/driver.scm.ChangeLog: myra-test-utils/driver.scm.ChangeLog.in
	test -d myra-test-utils || mkdir myra-test-utils
	(if test -d $(top_srcdir)/.git; then \
		cd $(srcdir) && git log \
			--grep='^Initial commit\.$$' --invert-grep \
			--after=2023-12-06T00+01:00 \
			--pretty='%as  %an  <%ae>%n%n%B' \
			myra-test-utils/driver.scm; \
	fi) | \
		$(AWK) '{line_prefix = "    "} \
		        /^(20[0-9]{2}(-[0-9]{2}){2}.*>)?$$/ {line_prefix = ""} \
		        {print line_prefix $$0}' > $@
	cat $< >> $@

dist-hook:
	cp $(distdir)/myra-test-utils/driver.scm.ChangeLog \
		$(distdir)/myra-test-utils/driver.scm.ChangeLog.in
	$(SED) --expression='s/^SPDX.*/!!! PLEASE UPDATE THIS FILEā€¦ \0 !!!/' \
		--in-place \
		$(distdir)/myra-test-utils/driver.scm.ChangeLog.in.license

MOSTLYCLEANFILES = $(GUILE_OBJECT_FILES) $(nobase_dist_changelog_DATA)