chiark / gitweb /
src/test-base.lisp: Actually signal an error if the tests fail.
[sod] / src / Makefile.am
CommitLineData
97a9a385
MW
1### -*-makefile-*-
2###
3### Build script for the SOD translator
4###
5### (c) 2015 Straylight/Edgeware
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This file is part of the Sensble Object Design, an object system for C.
11###
12### SOD is free software; you can redistribute it and/or modify
13### it under the terms of the GNU General Public License as published by
14### the Free Software Foundation; either version 2 of the License, or
15### (at your option) any later version.
16###
17### SOD is distributed in the hope that it will be useful,
18### but WITHOUT ANY WARRANTY; without even the implied warranty of
19### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20### GNU General Public License for more details.
21###
22### You should have received a copy of the GNU General Public License
23### along with SOD; if not, write to the Free Software Foundation,
24### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
b5d086c2 26include $(top_srcdir)/vars.am
97a9a385
MW
27
28dist_pkglispsrc_DATA =
29
30###--------------------------------------------------------------------------
31### The source files.
32
33## The system definition file.
34dist_pkglispsrc_DATA += sod.asd
35
36## The package definition file.
37dist_pkglispsrc_DATA += package.lisp
38
39## General utilities.
40dist_pkglispsrc_DATA += utilities.lisp
41
42## The parser library.
43dist_pkglispsrc_DATA += parser/floc-proto.lisp parser/floc-impl.lisp
44dist_pkglispsrc_DATA += parser/streams-proto.lisp parser/streams-impl.lisp
45dist_pkglispsrc_DATA += parser/scanner-proto.lisp parser/scanner-impl.lisp
46dist_pkglispsrc_DATA += parser/scanner-charbuf-impl.lisp
47dist_pkglispsrc_DATA += parser/scanner-token-impl.lisp
48dist_pkglispsrc_DATA += parser/parser-proto.lisp parser/parser-impl.lisp
49dist_pkglispsrc_DATA += parser/parser-expr-proto.lisp \
50 parser/parser-expr-impl.lisp
51dist_pkglispsrc_DATA += parser/scanner-context-impl.lisp
52
53## Lexical analysis and translator-specific parser utilities.
54dist_pkglispsrc_DATA += lexer-proto.lisp lexer-impl.lisp
55dist_pkglispsrc_DATA += fragment-parse.lisp
56
57## C type representation.
58dist_pkglispsrc_DATA += c-types-proto.lisp c-types-impl.lisp \
59 c-types-parse.lisp
60
61## Property sets.
62dist_pkglispsrc_DATA += pset-proto.lisp pset-impl.lisp pset-parse.lisp
63
64## Code generation.
65dist_pkglispsrc_DATA += codegen-proto.lisp codegen-impl.lisp
66
67## Output machinery.
68dist_pkglispsrc_DATA += output-proto.lisp output-impl.lisp
69
70## Modules.
71dist_pkglispsrc_DATA += module-proto.lisp module-impl.lisp
72dist_pkglispsrc_DATA += module-parse.lisp module-output.lisp
73dist_pkglispsrc_DATA += builtin.lisp
74
75## Class representation and layout.
76dist_pkglispsrc_DATA += classes.lisp c-types-class-impl.lisp
77dist_pkglispsrc_DATA += class-utilities.lisp
78dist_pkglispsrc_DATA += class-make-proto.lisp class-make-impl.lisp
79dist_pkglispsrc_DATA += class-layout-proto.lisp class-layout-impl.lisp
80dist_pkglispsrc_DATA += class-finalize-proto.lisp class-finalize-impl.lisp
81dist_pkglispsrc_DATA += class-output.lisp
82
83## Method generation.
84dist_pkglispsrc_DATA += method-proto.lisp method-impl.lisp
e75eb63d 85dist_pkglispsrc_DATA += method-aggregate.lisp
97a9a385
MW
86
87## User interface.
88dist_pkglispsrc_DATA += sod-frontend.asd
89dist_pkglispsrc_DATA += frontend.lisp optparse.lisp
90
e33ea301
MW
91## Interactive testing.
92dist_pkglispsrc_DATA += debug.lisp
93
97a9a385
MW
94###--------------------------------------------------------------------------
95### Constructing an output image.
96
5e6bcea3 97CLEANFILES += *.$(fasl) parser/*.$(fasl)
97a9a385 98
b5d086c2 99## Building the executable image.
97a9a385
MW
100bin_PROGRAMS += sod
101sod_SOURCES =
102sod: $(dist_pkglispsrc_DATA)
173090e6 103 $(V_DUMP)true_srcdir=$$(cd $(srcdir); pwd); \
97a9a385 104 ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
5e6bcea3 105 $(CL_LAUNCH) -o sod -d ! -l $(LISPSYS) +I -S $$true_srcdir/: \
97a9a385
MW
106 -s sod-frontend -r sod-frontend:main
107
5e6bcea3
MW
108###--------------------------------------------------------------------------
109### Unit testing.
110
111## The system definition.
112EXTRA_DIST += sod-test.asd
113
114## Basic utilities.
115EXTRA_DIST += test-base.lisp
116
117## Parser tests.
118EXTRA_DIST += parser/parser-test.lisp
119EXTRA_DIST += parser/scanner-charbuf-test.lisp
120
121## Translator tests.
122EXTRA_DIST += c-types-test.lisp
123EXTRA_DIST += codegen-test.lisp
124EXTRA_DIST += lexer-test.lisp
125
126## Running the Lisp tests.
127check-local:
173090e6 128 $(V_TEST)true_srcdir=$$(cd $(srcdir); pwd); \
5e6bcea3
MW
129 ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
130 $(CL_LAUNCH) -l $(LISPSYS) +I -S $$true_srcdir/: \
131 -i '(asdf:test-system "sod")'
132
97a9a385
MW
133###--------------------------------------------------------------------------
134### Installation.
135
136## We want a symlink $(lispsysdir)/sod.asd -> $(lispsrcdir)/sod/sod.asd. It
137## would be nice if this were a sane relative symlink, but that involves
138## calculating the proper relative path from $(lispsrcdir)/sod to
139## $(lispsysdir). Oh, well, here we go. This assumes that the path names
140## don't have spaces in them; but that's generally a bad idea in Makefiles
141## anyway.
142install-data-local:
143 $(MKDIR_P) $(DESTDIR)$(lispsysdir)
144 @set -e; \
145 from=$(lispsysdir) to=$(pkglispsrcdir)/sod.asd; \
146 set -- $$(echo $$from | tr "/" " "); fwd=$$*; \
147 set -- $$(echo $$to | tr "/" " "); twd=$$*; \
148 while :; do \
149 set -- $$fwd; fhd=$$1 fn=$$#; \
150 set -- $$twd; thd=$$1 tn=$$#; \
151 case :$$fn:$$tn: in *:0:*) break ;; esac; \
152 case "$$fhd" in "$$thd") ;; *) break ;; esac; \
153 set -- $$fwd; shift; fwd=$$*; \
154 set -- $$twd; shift; twd=$$*; \
155 done; \
156 dots=$$(echo $$fwd | sed 's/[^ ][^ ]*/../g'); \
157 rel=$$(echo $$dots $$twd | tr " " "/"); \
158 echo >&2 "ln -s $$rel $$to"; \
5e6bcea3
MW
159 ln -s $$rel $(DESTDIR)$$from/sod.asd.new; \
160 mv $(DESTDIR)$$from/sod.asd.new $(DESTDIR)$$from/sod.asd
97a9a385
MW
161
162###----- That's all, folks --------------------------------------------------