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.
This commit is contained in:
Timothy Sample 2019-05-21 19:46:44 -04:00
parent 2162c40492
commit a4efd9359e
4 changed files with 65 additions and 31 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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
# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
# 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)

60
build-aux/guile.am Normal file
View File

@ -0,0 +1,60 @@
# Gash --- Guile As SHell
# Copyright © 2019 Timothy Sample <samplet@ngyro.com>
#
# 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 <http://www.gnu.org/licenses/>.
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
# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
# 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 "$@" "$<"