X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/6b5bf01af14c3be7f528fdac531f9188d4c4f3da..684d95c7eb6ec755d38efacbc377e9e60ba7044e:/src/Makefile.am diff --git a/src/Makefile.am b/src/Makefile.am index 53880d8..8a23b69 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,7 @@ ###----- Licensing notice --------------------------------------------------- ### -### This file is part of the Sensble Object Design, an object system for C. +### This file is part of the Sensible Object Design, an object system for C. ### ### SOD is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by @@ -27,13 +27,11 @@ include $(top_srcdir)/vars.am nobase_dist_pkglispsrc_DATA = $(LISP_SOURCES) LISP_SOURCES = +SYSDEFS = ###-------------------------------------------------------------------------- ### The source files. -## The system definition file. -LISP_SOURCES += sod.asd - ## The package definition file. LISP_SOURCES += package.lisp @@ -87,32 +85,45 @@ LISP_SOURCES += method-proto.lisp method-impl.lisp LISP_SOURCES += method-aggregate.lisp ## User interface. -LISP_SOURCES += sod-frontend.asd LISP_SOURCES += frontend.lisp optparse.lisp -## Interactive testing. -LISP_SOURCES += debug.lisp +## Finishing touches. +LISP_SOURCES += final.lisp ###-------------------------------------------------------------------------- ### Constructing an output image. CLEANFILES += *.$(fasl) parser/*.$(fasl) +## Autodetected configuration. +EXTRA_DIST += auto.lisp.in +CLEANFILES += auto.lisp +auto.lisp: auto.lisp.in Makefile + $(SUBST) $(srcdir)/auto.lisp.in >$@.new $(SUBSTITUTIONS) && \ + grep '^[^;]' $@.new >$@.strip && \ + rm -f $@.new && mv $@.strip $@ + +## Building a working-tree system definition. +EXTRA_DIST += sod.asd.in +CLEANFILES += sod.asd +sod.asd: sod.asd.in Makefile + $(SUBST) $(srcdir)/sod.asd.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ + ## Building the executable image. bin_PROGRAMS += sod sod_SOURCES = -sod: $(LISP_SOURCES) - $(V_DUMP)true_srcdir=$$(cd $(srcdir); pwd); \ - ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \ - $(CL_LAUNCH) -o sod -d ! -l $(LISPSYS) +I -S $$true_srcdir/: \ - -s sod-frontend -r sod-frontend:main +sod$(EXEEXT): $(LISP_SOURCES) sod.asd auto.lisp + $(V_DUMP)$(ASDF_ENV) $(RUNLISP) -L$(WORKING_LISPS) \ + -e "(asdf:clear-configuration)" \ + -e "(asdf:operate 'asdf:program-op \"sod/frontend\")" + +## The executable is needed if we're just distributing. +dist-hook: sod$(EXEEXT) ###-------------------------------------------------------------------------- ### Unit testing. -## The system definition. -EXTRA_DIST += sod-test.asd - ## Basic utilities. EXTRA_DIST += test-base.lisp @@ -126,17 +137,20 @@ EXTRA_DIST += codegen-test.lisp EXTRA_DIST += lexer-test.lisp ## Running the Lisp tests. -check-local: - $(V_TEST)true_srcdir=$$(cd $(srcdir); pwd); \ - ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \ - $(CL_LAUNCH) -l $(LISPSYS) -s sod-test +I -S $$true_srcdir/: \ - -i '(handler-case ;\ - (progn ;\ - (setf sod-test:*build-version* "$(VERSION)") ;\ - (asdf:test-system "sod")) ;\ - (error (cond) ;\ - (format *error-output* "ERR: ~A~%" cond) ;\ - (cl-launch:quit 1)))' +check-local: sod sod.asd + $(V_TEST)$(ASDF_ENV) $(RUNLISP) -L$(WORKING_LISPS) -e \ + '(asdf:clear-configuration) ;\ + (handler-case (asdf:test-system "sod") ;\ + (error (cond) ;\ + (format *error-output* "ERR: ~A~%" cond) ;\ + (uiop:quit 1)))' + +###-------------------------------------------------------------------------- +### Manual pages. + +man_MANS += sod.1 sod-module.5 +CLEANFILES += sod.1 sod-module.5 +EXTRA_DIST += sod.1.in sod-module.5.in ###-------------------------------------------------------------------------- ### Installation. @@ -148,9 +162,9 @@ check-local: ## don't have spaces in them; but that's generally a bad idea in Makefiles ## anyway. install-data-local: - $(MKDIR_P) $(DESTDIR)$(lispsysdir) + $(MKDIR_P) $(DESTDIR)$(lispsysdir) $(DESTDIR)$(pkglispsrcdir) @set -e; \ - from=$(lispsysdir) to=$(pkglispsrcdir)/sod.asd; \ + from=$(lispsysdir) to=$(pkglispsrcdir); \ set -- $$(echo $$from | tr "/" " "); fwd=$$*; \ set -- $$(echo $$to | tr "/" " "); twd=$$*; \ while :; do \ @@ -163,8 +177,36 @@ install-data-local: done; \ dots=$$(echo $$fwd | sed 's/[^ ][^ ]*/../g'); \ rel=$$(echo $$dots $$twd | tr " " "/"); \ - echo >&2 "ln -s $$rel $$to"; \ - ln -s $$rel $(DESTDIR)$$from/sod.asd.new; \ - mv $(DESTDIR)$$from/sod.asd.new $(DESTDIR)$$from/sod.asd + for i in sod.asd; do \ + echo >&2 "CREATE $$to/$$i"; \ + sed -e '/#|@-auto-@|#/ { r auto.lisp' -e ' d; }' \ + -e '/#|@-del-@|#/ d' \ + -e '/#|@-path-@|#/ d' \ + $(srcdir)/$$i.in >$(DESTDIR)$(pkglispsrcdir)/$$i.new; \ + mv $(DESTDIR)$(pkglispsrcdir)/$$i.new \ + $(DESTDIR)$(pkglispsrcdir)/$$i; \ + echo >&2 "LINK $$rel/$$i $$to/$$i"; \ + ln -s $$rel/$$i $(DESTDIR)$$from/$$i.new; \ + mv $(DESTDIR)$$from/$$i.new $(DESTDIR)$$from/$$i; \ + done + +uninstall-local: + for i in sod.asd sod-frontend.asd; do \ + rm -f $(DESTDIR)$(pkglispsrcdir)/$$i $(DESTDIR)$(lispsysdir)/$$i; \ + done + +###-------------------------------------------------------------------------- +### Additional random things useful during development. + +## ASDF hacking for finding the system definitions. +EXTRA_DIST += asdf-hack.lisp.in +noinst_DATA += asdf-hack.lisp +asdf-hack.lisp: asdf-hack.lisp.in Makefile + $(SUBST) $(srcdir)/asdf-hack.lisp.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ +CLEANFILES += asdf-hack.lisp + +## Emacs hacking for indentation. +EXTRA_DIST += emacs-hacks.el ###----- That's all, folks --------------------------------------------------