chiark / gitweb /
src/method-aggregate.lisp: Let `custom' methods have weird return types.
[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###
e0808c47 10### This file is part of the Sensible Object Design, an object system for C.
97a9a385
MW
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 =
58a95090 30SYSDEFS =
97a9a385 31
dcb84c9f
MW
32ASDF_ENV = \
33 ASDF_OUTPUT_TRANSLATIONS=$$(cd $(srcdir); pwd):$(abs_builddir):
34
97a9a385
MW
35###--------------------------------------------------------------------------
36### The source files.
37
97a9a385 38## The package definition file.
6b5bf01a 39LISP_SOURCES += package.lisp
97a9a385
MW
40
41## General utilities.
6b5bf01a 42LISP_SOURCES += utilities.lisp
97a9a385
MW
43
44## The parser library.
6b5bf01a
MW
45LISP_SOURCES += parser/package.lisp
46LISP_SOURCES += parser/floc-proto.lisp parser/floc-impl.lisp
47LISP_SOURCES += parser/streams-proto.lisp parser/streams-impl.lisp
48LISP_SOURCES += parser/scanner-proto.lisp parser/scanner-impl.lisp
49LISP_SOURCES += parser/scanner-charbuf-impl.lisp
50LISP_SOURCES += parser/scanner-token-impl.lisp
51LISP_SOURCES += parser/parser-proto.lisp parser/parser-impl.lisp
52LISP_SOURCES += parser/parser-expr-proto.lisp \
97a9a385 53 parser/parser-expr-impl.lisp
6b5bf01a 54LISP_SOURCES += parser/scanner-context-impl.lisp
97a9a385
MW
55
56## Lexical analysis and translator-specific parser utilities.
6b5bf01a
MW
57LISP_SOURCES += lexer-proto.lisp lexer-impl.lisp
58LISP_SOURCES += fragment-parse.lisp
97a9a385
MW
59
60## C type representation.
6b5bf01a 61LISP_SOURCES += c-types-proto.lisp c-types-impl.lisp \
97a9a385
MW
62 c-types-parse.lisp
63
64## Property sets.
6b5bf01a 65LISP_SOURCES += pset-proto.lisp pset-impl.lisp pset-parse.lisp
97a9a385
MW
66
67## Code generation.
6b5bf01a 68LISP_SOURCES += codegen-proto.lisp codegen-impl.lisp
97a9a385
MW
69
70## Output machinery.
6b5bf01a 71LISP_SOURCES += output-proto.lisp output-impl.lisp
97a9a385
MW
72
73## Modules.
6b5bf01a
MW
74LISP_SOURCES += module-proto.lisp module-impl.lisp
75LISP_SOURCES += module-parse.lisp module-output.lisp
76LISP_SOURCES += builtin.lisp
97a9a385
MW
77
78## Class representation and layout.
6b5bf01a
MW
79LISP_SOURCES += classes.lisp c-types-class-impl.lisp
80LISP_SOURCES += class-utilities.lisp
81LISP_SOURCES += class-make-proto.lisp class-make-impl.lisp
82LISP_SOURCES += class-layout-proto.lisp class-layout-impl.lisp
83LISP_SOURCES += class-finalize-proto.lisp class-finalize-impl.lisp
84LISP_SOURCES += class-output.lisp
97a9a385
MW
85
86## Method generation.
6b5bf01a
MW
87LISP_SOURCES += method-proto.lisp method-impl.lisp
88LISP_SOURCES += method-aggregate.lisp
97a9a385
MW
89
90## User interface.
6b5bf01a 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
58a95090
MW
101## Autodetected configuration.
102EXTRA_DIST += auto.lisp.in
103CLEANFILES += auto.lisp
104auto.lisp: auto.lisp.in Makefile
105 $(SUBST) $(srcdir)/auto.lisp.in >$@.new $(SUBSTITUTIONS) && \
106 grep '^[^;]' $@.new >$@.strip && \
107 rm -f $@.new && mv $@.strip $@
108
109## Building a working-tree system definition.
110EXTRA_DIST += sod.asd.in
111CLEANFILES += sod.asd
112sod.asd: sod.asd.in Makefile
113 $(SUBST) $(srcdir)/sod.asd.in >$@.new $(SUBSTITUTIONS) && \
114 mv $@.new $@
115
116EXTRA_DIST += sod-frontend.asd.in
117CLEANFILES += sod-frontend.asd
118sod-frontend.asd: sod-frontend.asd.in Makefile
119 $(SUBST) $(srcdir)/sod-frontend.asd.in >$@.new $(SUBSTITUTIONS) && \
120 mv $@.new $@
121
b5d086c2 122## Building the executable image.
97a9a385
MW
123bin_PROGRAMS += sod
124sod_SOURCES =
58a95090 125sod: $(LISP_SOURCES) sod.asd sod-frontend.asd auto.lisp
dcb84c9f 126 $(V_DUMP)$(ASDF_ENV) $(CL_LAUNCH) -o sod -d ! -l $(LISPSYS) +I \
97a9a385
MW
127 -s sod-frontend -r sod-frontend:main
128
5e6bcea3
MW
129###--------------------------------------------------------------------------
130### Unit testing.
131
132## The system definition.
58a95090 133EXTRA_DIST += sod-test.asd.in
5e6bcea3
MW
134
135## Basic utilities.
136EXTRA_DIST += test-base.lisp
137
138## Parser tests.
139EXTRA_DIST += parser/parser-test.lisp
140EXTRA_DIST += parser/scanner-charbuf-test.lisp
141
142## Translator tests.
143EXTRA_DIST += c-types-test.lisp
144EXTRA_DIST += codegen-test.lisp
145EXTRA_DIST += lexer-test.lisp
146
58a95090
MW
147## The system definition.
148EXTRA_DIST += sod-test.asd.in
149CLEANFILES += sod-test.asd
150sod-test.asd: sod-test.asd.in Makefile
151 $(SUBST) $(srcdir)/sod-test.asd.in >$@.new $(SUBSTITUTIONS) && \
152 mv $@.new $@
153
5e6bcea3 154## Running the Lisp tests.
58a95090 155check-local: sod sod-test.asd
dcb84c9f 156 $(V_TEST)$(ASDF_ENV) $(CL_LAUNCH) -l $(LISPSYS) -s sod-test +I \
58a95090 157 -i '(handler-case (asdf:test-system "sod") ;\
1d7528b6
MW
158 (error (cond) ;\
159 (format *error-output* "ERR: ~A~%" cond) ;\
160 (cl-launch:quit 1)))'
5e6bcea3 161
9ed8eb2a
MW
162###--------------------------------------------------------------------------
163### Manual pages.
164
165dist_man_MANS += sod.1
166dist_man_MANS += sod-module.5
167
97a9a385
MW
168###--------------------------------------------------------------------------
169### Installation.
170
171## We want a symlink $(lispsysdir)/sod.asd -> $(lispsrcdir)/sod/sod.asd. It
172## would be nice if this were a sane relative symlink, but that involves
173## calculating the proper relative path from $(lispsrcdir)/sod to
174## $(lispsysdir). Oh, well, here we go. This assumes that the path names
175## don't have spaces in them; but that's generally a bad idea in Makefiles
176## anyway.
177install-data-local:
58a95090 178 $(MKDIR_P) $(DESTDIR)$(lispsysdir) $(DESTDIR)$(pkglispsrcdir)
97a9a385 179 @set -e; \
58a95090 180 from=$(lispsysdir) to=$(pkglispsrcdir); \
97a9a385
MW
181 set -- $$(echo $$from | tr "/" " "); fwd=$$*; \
182 set -- $$(echo $$to | tr "/" " "); twd=$$*; \
183 while :; do \
184 set -- $$fwd; fhd=$$1 fn=$$#; \
185 set -- $$twd; thd=$$1 tn=$$#; \
186 case :$$fn:$$tn: in *:0:*) break ;; esac; \
187 case "$$fhd" in "$$thd") ;; *) break ;; esac; \
188 set -- $$fwd; shift; fwd=$$*; \
189 set -- $$twd; shift; twd=$$*; \
190 done; \
191 dots=$$(echo $$fwd | sed 's/[^ ][^ ]*/../g'); \
192 rel=$$(echo $$dots $$twd | tr " " "/"); \
58a95090
MW
193 for i in sod.asd sod-frontend.asd; do \
194 echo >&2 "CREATE $$to/$$i"; \
195 sed -e '/#|@-auto-@|#/ { r auto.lisp' -e ' d; }' \
196 -e '/#|@-path-@|#/ d' \
197 $(srcdir)/$$i.in >$(DESTDIR)$(pkglispsrcdir)/$$i.new; \
198 mv $(DESTDIR)$(pkglispsrcdir)/$$i.new \
199 $(DESTDIR)$(pkglispsrcdir)/$$i; \
200 echo >&2 "LINK $$rel/$$i $$to/$$i"; \
201 ln -s $$rel/$$i $(DESTDIR)$$from/$$i.new; \
202 mv $(DESTDIR)$$from/$$i.new $(DESTDIR)$$from/$$i; \
203 done
204
205uninstall-local:
206 for i in sod.asd sod-frontend.asd; do \
207 rm -f $(DESTDIR)$(pkglispsrcdir)/$$i $(DESTDIR)$(lispsysdir)/$$i; \
208 done
97a9a385
MW
209
210###----- That's all, folks --------------------------------------------------