### -*-makefile-*- ### ### Build script for the SOD translator ### ### (c) 2015 Straylight/Edgeware ### ###----- Licensing notice --------------------------------------------------- ### ### This file is part of the Sensble 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 ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### SOD 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 SOD; if not, write to the Free Software Foundation, ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. include $(top_srcdir)/vars.am nobase_dist_pkglispsrc_DATA = $(LISP_SOURCES) LISP_SOURCES = ###-------------------------------------------------------------------------- ### The source files. ## The system definition file. LISP_SOURCES += sod.asd ## The package definition file. LISP_SOURCES += package.lisp ## General utilities. LISP_SOURCES += utilities.lisp ## The parser library. LISP_SOURCES += parser/package.lisp LISP_SOURCES += parser/floc-proto.lisp parser/floc-impl.lisp LISP_SOURCES += parser/streams-proto.lisp parser/streams-impl.lisp LISP_SOURCES += parser/scanner-proto.lisp parser/scanner-impl.lisp LISP_SOURCES += parser/scanner-charbuf-impl.lisp LISP_SOURCES += parser/scanner-token-impl.lisp LISP_SOURCES += parser/parser-proto.lisp parser/parser-impl.lisp LISP_SOURCES += parser/parser-expr-proto.lisp \ parser/parser-expr-impl.lisp LISP_SOURCES += parser/scanner-context-impl.lisp ## Lexical analysis and translator-specific parser utilities. LISP_SOURCES += lexer-proto.lisp lexer-impl.lisp LISP_SOURCES += fragment-parse.lisp ## C type representation. LISP_SOURCES += c-types-proto.lisp c-types-impl.lisp \ c-types-parse.lisp ## Property sets. LISP_SOURCES += pset-proto.lisp pset-impl.lisp pset-parse.lisp ## Code generation. LISP_SOURCES += codegen-proto.lisp codegen-impl.lisp ## Output machinery. LISP_SOURCES += output-proto.lisp output-impl.lisp ## Modules. LISP_SOURCES += module-proto.lisp module-impl.lisp LISP_SOURCES += module-parse.lisp module-output.lisp LISP_SOURCES += builtin.lisp ## Class representation and layout. LISP_SOURCES += classes.lisp c-types-class-impl.lisp LISP_SOURCES += class-utilities.lisp LISP_SOURCES += class-make-proto.lisp class-make-impl.lisp LISP_SOURCES += class-layout-proto.lisp class-layout-impl.lisp LISP_SOURCES += class-finalize-proto.lisp class-finalize-impl.lisp LISP_SOURCES += class-output.lisp ## Method generation. 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 ## Finishing touches. LISP_SOURCES += final.lisp ###-------------------------------------------------------------------------- ### Constructing an output image. CLEANFILES += *.$(fasl) parser/*.$(fasl) ## 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 ###-------------------------------------------------------------------------- ### Unit testing. ## The system definition. EXTRA_DIST += sod-test.asd ## Basic utilities. EXTRA_DIST += test-base.lisp ## Parser tests. EXTRA_DIST += parser/parser-test.lisp EXTRA_DIST += parser/scanner-charbuf-test.lisp ## Translator tests. EXTRA_DIST += c-types-test.lisp 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)))' ###-------------------------------------------------------------------------- ### Installation. ## We want a symlink $(lispsysdir)/sod.asd -> $(lispsrcdir)/sod/sod.asd. It ## would be nice if this were a sane relative symlink, but that involves ## calculating the proper relative path from $(lispsrcdir)/sod to ## $(lispsysdir). Oh, well, here we go. This assumes that the path names ## don't have spaces in them; but that's generally a bad idea in Makefiles ## anyway. install-data-local: $(MKDIR_P) $(DESTDIR)$(lispsysdir) @set -e; \ from=$(lispsysdir) to=$(pkglispsrcdir)/sod.asd; \ set -- $$(echo $$from | tr "/" " "); fwd=$$*; \ set -- $$(echo $$to | tr "/" " "); twd=$$*; \ while :; do \ set -- $$fwd; fhd=$$1 fn=$$#; \ set -- $$twd; thd=$$1 tn=$$#; \ case :$$fn:$$tn: in *:0:*) break ;; esac; \ case "$$fhd" in "$$thd") ;; *) break ;; esac; \ set -- $$fwd; shift; fwd=$$*; \ set -- $$twd; shift; twd=$$*; \ 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 ###----- That's all, folks --------------------------------------------------