From a4efd9359e794b14e0930b0f35bbf19f02b2ad23 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Tue, 21 May 2019 19:46:44 -0400 Subject: [PATCH] Use Automake recipes from Guile. * build-aux/guile-rules.am: Delete file. * build-aux/guile.am: New file. * .gitignore: Do not ignore it. * Makefile.am: Adapt variable names to the new file. --- .gitignore | 2 +- Makefile.am | 8 +++--- build-aux/guile-rules.am | 26 ----------------- build-aux/guile.am | 60 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 31 deletions(-) delete mode 100644 build-aux/guile-rules.am create mode 100644 build-aux/guile.am diff --git a/.gitignore b/.gitignore index c7c3453..b12a926 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ !/build-aux/git-version-gen !/build-aux/gitlab-ci.yml !/build-aux/gitlog-to-changelog -!/build-aux/guile-rules.am +!/build-aux/guile.am !/build-aux/pre-inst-env.in /config.log /config.status diff --git a/Makefile.am b/Makefile.am index c4e4817..1664ec0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -include $(top_srcdir)/build-aux/guile-rules.am +include $(top_srcdir)/build-aux/guile.am EXTRA_DIST += \ .dir-locals.el \ @@ -11,7 +11,7 @@ EXTRA_DIST += \ # Modules and scripts ##################### -GUILE_MODULES = \ +SOURCES = \ gash/built-ins/break.scm \ gash/built-ins/cd.scm \ gash/built-ins/colon.scm \ @@ -57,8 +57,8 @@ bin_SCRIPTS = \ do_subst = sed \ -e 's,[@]GUILE[@],$(GUILE),g' \ - -e 's,[@]MODDIR[@],$(guilemoduledir),g' \ - -e 's,[@]GODIR[@],$(guileobjectdir),g' + -e 's,[@]MODDIR[@],$(moddir),g' \ + -e 's,[@]GODIR[@],$(ccachedir),g' scripts/gash: scripts/gash.in Makefile mkdir -p scripts diff --git a/build-aux/guile-rules.am b/build-aux/guile-rules.am deleted file mode 100644 index 5a103d1..0000000 --- a/build-aux/guile-rules.am +++ /dev/null @@ -1,26 +0,0 @@ -guilemoduledir=$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION) -guileobjectdir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache - -GUILE_OBJECTS = $(GUILE_MODULES:%.scm=%.go) - -nobase_guilemodule_DATA = $(GUILE_MODULES) -nobase_guileobject_DATA = $(GUILE_OBJECTS) - -# Make sure source files are installed first, so that the mtime of -# installed compiled files is greater than that of installed source -# files. See -# -# for details. -guile_install_go_files = install-nobase_nodist_guileobjectDATA -$(guile_install_go_files): install-nobase_dist_guilemoduleDATA - -GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat -SUFFIXES = .scm .go -.scm.go: - $(AM_V_GEN) GUILE_AUTO_COMPILE=0 \ - $(top_builddir)/pre-inst-env \ - $(GUILD) compile $(GUILE_WARNINGS) -o "$@" "$<" - -EXTRA_DIST = $(GUILE_MODULES) - -CLEANFILES = $(GUILE_OBJECTS) diff --git a/build-aux/guile.am b/build-aux/guile.am new file mode 100644 index 0000000..60125c3 --- /dev/null +++ b/build-aux/guile.am @@ -0,0 +1,60 @@ +# Gash --- Guile As SHell +# Copyright © 2019 Timothy Sample +# +# This file was adapted from the 'am/guilec' file shipped with GNU +# Guile version 2.2.4. Unfortunately that file does not contain a +# copyright notice. Looking at Guile's Git commit history, it looks +# like the notice should read: +# +# Copyright 2008-2012, 2016 Free Software Foundation, Inc. +# +# This file is part of Gash. +# +# Gash is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# Gash is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Gash. If not, see . + +GOBJECTS = $(SOURCES:%.scm=%.go) + +GUILE_WARNINGS = \ + -Wunbound-variable \ + -Wmacro-use-before-definition \ + -Warity-mismatch \ + -Wformat + +moddir = $(datadir)/guile/$(GUILE_EFFECTIVE_VERSION)/$(modpath) +nobase_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES) +ccachedir = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/ccache/$(modpath) +nobase_ccache_DATA = $(GOBJECTS) +EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES) + +CLEANFILES = $(GOBJECTS) + +# Make sure source files are installed first, so that the mtime of +# installed compiled files is greater than that of installed source +# files. See +# +# for details. +guile_install_go_files = install-nobase_ccacheDATA +$(guile_install_go_files): install-nobase_modDATA + +AM_V_GUILEC = $(AM_V_GUILEC_@AM_V@) +AM_V_GUILEC_ = $(AM_V_GUILEC_@AM_DEFAULT_V@) +AM_V_GUILEC_0 = @echo " GUILEC" $@; + +SUFFIXES = .scm .go + +.scm.go: + $(AM_V_GUILEC)GUILE_AUTO_COMPILE=0 \ + $(top_builddir)/pre-inst-env \ + $(GUILD) compile $(GUILE_WARNINGS) \ + -o "$@" "$<"