X-Git-Url: https://git.distorted.org.uk/~mdw/runlisp/blobdiff_plain/ba4d97a46a046f5170b58a29c8f1c0524c63694c..fe28ef9d3cbbf7aefd42af24532267bb82e2067a:/Makefile.am diff --git a/Makefile.am b/Makefile.am index 3f87396..b13d107 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,127 +1,204 @@ ### -*-makefile-*- ### -### Building the distribution +### Build script for `runlisp' ### -### (c) 1997 Mark Wooding +### (c) 2020 Mark Wooding ### ###----- Licensing notice --------------------------------------------------- ### -### This file is part of the Common Files Distribution (`common') -### -### `Common' 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 2 of the License, or -### (at your option) any later version. -### -### `Common' 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. -### +### This file is part of Runlisp, a tool for invoking Common Lisp scripts. +### +### Runlisp 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. +### +### Runlisp 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 `common'; if not, write to the Free Software Foundation, -### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +### along with Runlisp. If not, see . -bin_SCRIPTS = -pkgdata_SCRIPTS = -pkgdata_DATA = +include $(top_srcdir)/vars.am -EXTRA_DIST = -CLEANFILES = +SUBDIRS = -###-------------------------------------------------------------------------- -### Handy variables. +image_DATA = +image_SCRIPTS = + +SUBDIRS += . -confsubst = $(srcdir)/confsubst -mkdir_p = $(srcdir)/config/install-sh -d +ACLOCAL_AMFLAGS = -Im4 ###-------------------------------------------------------------------------- -### Main scripts. - -## mklinks -bin_SCRIPTS += mklinks -CLEANFILES += mklinks -EXTRA_DIST += mklinks.in - -mklinks: mklinks.in Makefile - $(confsubst) $(srcdir)/mklinks.in >$@.new \ - pkgdatadir=$(pkgdatadir) VERSION=$(VERSION) - chmod +x $@.new - mv $@.new $@ - -## findlinks -bin_SCRIPTS += findlinks -CLEANFILES += findlinks -EXTRA_DIST += findlinks.in - -findlinks: findlinks.in Makefile - $(confsubst) $(srcdir)/findlinks.in >$@.new \ - pkgdatadir=$(pkgdatadir) VERSION=$(VERSION) - chmod +x $@.new - mv $@.new $@ - -## mdw-setup -bin_SCRIPTS += mdw-setup -EXTRA_DIST += mdw-setup +### A library of common code. + +noinst_LIBRARIES += librunlisp.a +librunlisp_a_SOURCES = + +librunlisp_a_SOURCES += common.c common.h +librunlisp_a_SOURCES += lib.c lib.h +librunlisp_a_SOURCES += mdwopt.c mdwopt.h +librunlisp_a_SOURCES += sha256.c sha256.h ###-------------------------------------------------------------------------- -### Files to install. +### The main driver program. -## Licences. -pkgdata_DATA += COPYING COPYING.LIB -pkgdata_DATA += gpl.tex lgpl.tex gpl.texi lgpl.texi +bin_PROGRAMS += runlisp +runlisp_SOURCES = runlisp.c +runlisp_LDADD = librunlisp.a +man_MANS += runlisp.1 +doc_DATA += runlisp.pdf +EXTRA_DIST += runlisp.1.in -## Documentation. -pkgdata_DATA += INSTALL -pkgdata_DATA += texinice.tex +###-------------------------------------------------------------------------- +### Additional machinery. -## Useful code. -pkgdata_DATA += mdwopt.c mdwopt.h -pkgdata_DATA += getdate.y getdate.h +pkgdata_DATA += eval.lisp +EXTRA_DIST += eval.lisp -## Scripts. -pkgdata_SCRIPTS += install-ac -pkgdata_SCRIPTS += maninst -pkgdata_SCRIPTS += confsubst +pkgdata_SCRIPTS += dump-ecl +EXTRA_DIST += dump-ecl -EXTRA_DIST += $(pkgdata_DATA) -EXTRA_DIST += $(pkgdata_SCRIPTS) +bin_PROGRAMS += query-runlisp-config +query_runlisp_config_SOURCES = query-runlisp-config.c +query_runlisp_config_LDADD = librunlisp.a +man_MANS += query-runlisp-config.1 +doc_DATA += query-runlisp-config.pdf +EXTRA_DIST += query-runlisp-config.1.in -## Autoconf snippets. -EXTRA_DIST += aclocal.glob +man_MANS += runlisp.conf.5 +doc_DATA += runlisp.conf.pdf +EXTRA_DIST += runlisp.conf.5.in +EXTRA_DIST += runlisp-base.conf install-data-hook:: - $(mkdir_p) $(DESTDIR)$(aclocaldir) - $(srcdir)/install-ac install \ - $(srcdir)/aclocal.glob $(DESTDIR)$(aclocaldir) + $(MKDIR_P) $(DESTDIR)$(pkgconfdir)/runlisp.d + cp $(srcdir)/runlisp-base.conf \ + $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf +uninstall-hook:: + rm -f $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf +EXTRA_DIST += runlisp.conf +install-data-hook:: + $(MKDIR_P) $(DESTDIR)$(pkgconfdir) + if ! [ -f $(DESTDIR)$(pkgconfdir)/runlisp.conf ]; then \ + cp $(srcdir)/runlisp.conf $(DESTDIR)$(pkgconfdir)/; \ + fi uninstall-hook:: - $(srcdir)/install-ac rm \ - $(srcdir)/aclocal.glob $(DESTDIR)$(aclocaldir) + rm -f $(DESTDIR)$(pkgconfdir)/runlisp.conf ###-------------------------------------------------------------------------- -### Documentation. +### Image dumping. + +bin_PROGRAMS += dump-runlisp-image +dump_runlisp_image_SOURCES = dump-runlisp-image.c +dump_runlisp_image_LDADD = librunlisp.a +man_MANS += dump-runlisp-image.1 +doc_DATA += dump-runlisp-image.pdf +EXTRA_DIST += dump-runlisp-image.1.in + +DUMP_RUNLISP_IMAGE = $(v_dump)\ + ASDF_OUTPUT_TRANSLATIONS='( \ + :output-translations \ + :ignore-inherited-configuration \ + (t ("$(abs_builddir)/" "fasl/" \ + :implementation-type :**/ :*.*.*)))' \ + ./dump-runlisp-image -f -O$@ \ + -c$(srcdir)/runlisp-base.conf \ + -odata-dir=$(srcdir) +clean-local::; rm -fr fasl + +v_dump = $(v_dump_@AM_V@) +v_dump_ = $(v_dump_@AM_DEFAULT_V@) +v_dump_0 = @echo " DUMP $@"; + +IMAGES = +noinst_DATA += $(IMAGES) + +if DUMP_SBCL +IMAGES += sbcl+asdf.core +CLEANFILES += sbcl+asdf.core sbcl+asdf.core-* +sbcl+asdf.core: dump-runlisp-image runlisp-base.conf + $(DUMP_RUNLISP_IMAGE) sbcl +endif + +if DUMP_CCL +IMAGES += ccl+asdf.image +CLEANFILES += ccl+asdf.image ccl+asdf.image-* +ccl+asdf.image: dump-runlisp-image runlisp-base.conf + $(DUMP_RUNLISP_IMAGE) ccl +endif + +if DUMP_CLISP +IMAGES += clisp+asdf.mem +CLEANFILES += clisp+asdf.mem clisp+asdf.mem-* +clisp+asdf.mem: dump-runlisp-image runlisp-base.conf + $(DUMP_RUNLISP_IMAGE) clisp +endif + +if DUMP_ECL +IMAGES += ecl+asdf +CLEANFILES += ecl+asdf ecl+asdf-* +ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl + $(DUMP_RUNLISP_IMAGE) -odata-dir=$(srcdir) ecl +endif + +if DUMP_CMUCL +IMAGES += cmucl+asdf.core +CLEANFILES += cmucl+asdf.core cmucl+asdf.core-* +cmucl+asdf.core: dump-runlisp-image runlisp-base.conf + $(DUMP_RUNLISP_IMAGE) cmucl +endif -info_TEXINFOS = common.texi +install-data-hook:: + mkdir -p $(DESTDIR)$(imagedir) + set -e; for i in $(IMAGES); do \ + j=$$(readlink $$i); \ + cp $$j $(DESTDIR)$(imagedir)/$$j.new && \ + mv $(DESTDIR)$(imagedir)/$$j.new \ + $(DESTDIR)$(imagedir)/$$j; \ + ln -sf $$j $(DESTDIR)$(imagedir)/$$i; \ + done + +uninstall-hook:: + set -e; for i in $(IMAGES); do \ + if j=$$(readlink $(DESTDIR)$(imagedir)/$$i); then \ + case $$j in \ + $$i-*[!0-9a-f]) ;; \ + $$i-*) rm -f $(DESTDIR)$(imagedir)/$$j ;; \ + esac; \ + fi; \ + rm -f $(DESTDIR)$(imagedir)/$$i; \ + done ###-------------------------------------------------------------------------- -### Other special tweaks. +### Other subdirectories. -## Make `make distcheck' work. -DISTCHECK_CONFIGURE_FLAGS = \ - --with-aclocaldir='$${prefix}/share/aclocal' +## Documentation. +SUBDIRS += doc +EXTRA_DIST += README.org -## Distribute the release number. -dist-hook:: - echo $(VERSION) >$(distdir)/RELEASE +## Testing. +SUBDIRS += t + +## Benchmarking. +if BENCHMARK +SUBDIRS += bench +endif ###-------------------------------------------------------------------------- -### Debian. +### Distribution. + +## Release number. +dist-hook:: + echo $(VERSION) >$(distdir)/RELEASE -EXTRA_DIST += debian/control -EXTRA_DIST += debian/copyright -EXTRA_DIST += debian/rules -EXTRA_DIST += debian/changelog +## Additional build tools. +EXTRA_DIST += config/auto-version +EXTRA_DIST += config/confsubst ###----- That's all, folks --------------------------------------------------