src/final.lisp: Rename from `debug.lisp'.
[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 27
6b5bf01a
MW
28nobase_dist_pkglispsrc_DATA = $(LISP_SOURCES)
29LISP_SOURCES =
97a9a385
MW
30
31###--------------------------------------------------------------------------
32### The source files.
33
34## The system definition file.
6b5bf01a 35LISP_SOURCES += sod.asd
97a9a385
MW
36
37## The package definition file.
6b5bf01a 38LISP_SOURCES += package.lisp
97a9a385
MW
39
40## General utilities.
6b5bf01a 41LISP_SOURCES += utilities.lisp
97a9a385
MW
42
43## The parser library.
6b5bf01a
MW
44LISP_SOURCES += parser/package.lisp
45LISP_SOURCES += parser/floc-proto.lisp parser/floc-impl.lisp
46LISP_SOURCES += parser/streams-proto.lisp parser/streams-impl.lisp
47LISP_SOURCES += parser/scanner-proto.lisp parser/scanner-impl.lisp
48LISP_SOURCES += parser/scanner-charbuf-impl.lisp
49LISP_SOURCES += parser/scanner-token-impl.lisp
50LISP_SOURCES += parser/parser-proto.lisp parser/parser-impl.lisp
51LISP_SOURCES += parser/parser-expr-proto.lisp \
97a9a385 52 parser/parser-expr-impl.lisp
6b5bf01a 53LISP_SOURCES += parser/scanner-context-impl.lisp
97a9a385
MW
54
55## Lexical analysis and translator-specific parser utilities.
6b5bf01a
MW
56LISP_SOURCES += lexer-proto.lisp lexer-impl.lisp
57LISP_SOURCES += fragment-parse.lisp
97a9a385
MW
58
59## C type representation.
6b5bf01a 60LISP_SOURCES += c-types-proto.lisp c-types-impl.lisp \
97a9a385
MW
61 c-types-parse.lisp
62
63## Property sets.
6b5bf01a 64LISP_SOURCES += pset-proto.lisp pset-impl.lisp pset-parse.lisp
97a9a385
MW
65
66## Code generation.
6b5bf01a 67LISP_SOURCES += codegen-proto.lisp codegen-impl.lisp
97a9a385
MW
68
69## Output machinery.
6b5bf01a 70LISP_SOURCES += output-proto.lisp output-impl.lisp
97a9a385
MW
71
72## Modules.
6b5bf01a
MW
73LISP_SOURCES += module-proto.lisp module-impl.lisp
74LISP_SOURCES += module-parse.lisp module-output.lisp
75LISP_SOURCES += builtin.lisp
97a9a385
MW
76
77## Class representation and layout.
6b5bf01a
MW
78LISP_SOURCES += classes.lisp c-types-class-impl.lisp
79LISP_SOURCES += class-utilities.lisp
80LISP_SOURCES += class-make-proto.lisp class-make-impl.lisp
81LISP_SOURCES += class-layout-proto.lisp class-layout-impl.lisp
82LISP_SOURCES += class-finalize-proto.lisp class-finalize-impl.lisp
83LISP_SOURCES += class-output.lisp
97a9a385
MW
84
85## Method generation.
6b5bf01a
MW
86LISP_SOURCES += method-proto.lisp method-impl.lisp
87LISP_SOURCES += method-aggregate.lisp
97a9a385
MW
88
89## User interface.
6b5bf01a
MW
90LISP_SOURCES += sod-frontend.asd
91LISP_SOURCES += frontend.lisp optparse.lisp
97a9a385 92
a9cffac1
MW
93## Finishing touches.
94LISP_SOURCES += final.lisp
e33ea301 95
97a9a385
MW
96###--------------------------------------------------------------------------
97### Constructing an output image.
98
5e6bcea3 99CLEANFILES += *.$(fasl) parser/*.$(fasl)
97a9a385 100
b5d086c2 101## Building the executable image.
97a9a385
MW
102bin_PROGRAMS += sod
103sod_SOURCES =
6b5bf01a 104sod: $(LISP_SOURCES)
173090e6 105 $(V_DUMP)true_srcdir=$$(cd $(srcdir); pwd); \
97a9a385 106 ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
5e6bcea3 107 $(CL_LAUNCH) -o sod -d ! -l $(LISPSYS) +I -S $$true_srcdir/: \
97a9a385
MW
108 -s sod-frontend -r sod-frontend:main
109
110###--------------------------------------------------------------------------
5e6bcea3
MW
111### Unit testing.
112
113## The system definition.
114EXTRA_DIST += sod-test.asd
115
116## Basic utilities.
117EXTRA_DIST += test-base.lisp
118
119## Parser tests.
120EXTRA_DIST += parser/parser-test.lisp
121EXTRA_DIST += parser/scanner-charbuf-test.lisp
122
123## Translator tests.
124EXTRA_DIST += c-types-test.lisp
125EXTRA_DIST += codegen-test.lisp
126EXTRA_DIST += lexer-test.lisp
127
128## Running the Lisp tests.
129check-local:
173090e6 130 $(V_TEST)true_srcdir=$$(cd $(srcdir); pwd); \
5e6bcea3 131 ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
1d7528b6
MW
132 $(CL_LAUNCH) -l $(LISPSYS) -s sod-test +I -S $$true_srcdir/: \
133 -i '(handler-case ;\
19df3e00
MW
134 (progn ;\
135 (setf sod-test:*build-version* "$(VERSION)") ;\
136 (asdf:test-system "sod")) ;\
1d7528b6
MW
137 (error (cond) ;\
138 (format *error-output* "ERR: ~A~%" cond) ;\
139 (cl-launch:quit 1)))'
5e6bcea3
MW
140
141###--------------------------------------------------------------------------
97a9a385
MW
142### Installation.
143
144## We want a symlink $(lispsysdir)/sod.asd -> $(lispsrcdir)/sod/sod.asd. It
145## would be nice if this were a sane relative symlink, but that involves
146## calculating the proper relative path from $(lispsrcdir)/sod to
147## $(lispsysdir). Oh, well, here we go. This assumes that the path names
148## don't have spaces in them; but that's generally a bad idea in Makefiles
149## anyway.
150install-data-local:
151 $(MKDIR_P) $(DESTDIR)$(lispsysdir)
152 @set -e; \
153 from=$(lispsysdir) to=$(pkglispsrcdir)/sod.asd; \
154 set -- $$(echo $$from | tr "/" " "); fwd=$$*; \
155 set -- $$(echo $$to | tr "/" " "); twd=$$*; \
156 while :; do \
157 set -- $$fwd; fhd=$$1 fn=$$#; \
158 set -- $$twd; thd=$$1 tn=$$#; \
159 case :$$fn:$$tn: in *:0:*) break ;; esac; \
160 case "$$fhd" in "$$thd") ;; *) break ;; esac; \
161 set -- $$fwd; shift; fwd=$$*; \
162 set -- $$twd; shift; twd=$$*; \
163 done; \
164 dots=$$(echo $$fwd | sed 's/[^ ][^ ]*/../g'); \
165 rel=$$(echo $$dots $$twd | tr " " "/"); \
166 echo >&2 "ln -s $$rel $$to"; \
5e6bcea3
MW
167 ln -s $$rel $(DESTDIR)$$from/sod.asd.new; \
168 mv $(DESTDIR)$$from/sod.asd.new $(DESTDIR)$$from/sod.asd
97a9a385
MW
169
170###----- That's all, folks --------------------------------------------------