aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 41bae540011ff8217366628cab639f6d9c8a57f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# Copyright (C) 2012-2013, Gabriel Dos Reis.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     - Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#
#     - Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in
#       the documentation and/or other materials provided with the
#       distribution.
#
#     - Neither the name of The Numerical Algorithms Group Ltd. nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

DIST_SUBDIRS = \
	algebra boot clef doc \
	driver etc graph hyper \
	include input interp lib \
	lisp scripts share sman \
	testsuite utils io syntax rt

subdirs = \
	algebra boot clef doc driver \
	etc graph hyper input interp \
	lib io lisp share sman utils

oa_targetdir = $(top_builddir)/$(target)

## Where do we put installed include header files?
oa_incdir = $(oa_targetdir)/include/open-axiom

oa_src_include_headers = \
	defaults.H \
	structure.H \
	iterator.H \
	storage.H \
	Charset.H \
	FileMapping.H \
	SourceFile.H \
	Input.H    \
	diagnostics.H \
	dialect.H \
	vm.H \
	token.H \
	sexpr.H \
	Lisp.H \
	Constructor.H \
	Database.H

if OA_BUILD_SMAN
OA_SMAN_TARGETS = all-sman all-clef
endif

if OA_BUILD_GRAPHICS
OA_GRAPHICS_GRAPH_TARGET = all-graph
endif

if OA_BUILD_GUI
OA_GRAPHICS_GUI_TARGET = all-gui
endif

OA_GRAPHICS_TARGETS = $(OA_GRAPHICS_GRAPH_TARGET)  $(OA_GRAPHICS_GUI_TARGET)

all-local: all-src

.PHONY: all-src all-io all-headers all-syntax $(OA_GRAPHICS_TARGETS)
all-src: all-lib all-utils all-driver all-lisp all-boot all-io all-syntax \
	all-rt all-interpsys all-algebra all-axiomsys all-share \
	all-asq all-input all-doc $(OA_SMAN_TARGETS) $(OA_GRAPHICS_TARGETS)

stamp-subdirs:
	rm -f stamp-subdirs
	$(MKDIR_P) $(oa_targetdir)/bin
	$(MKDIR_P) $(oa_targetdir)/lib
	$(MKDIR_P) $(oa_targetdir)/share
	$(MKDIR_P) $(oa_targetdir)/doc
	$(MKDIR_P) $(oa_targetdir)/doc/help
	$(MKDIR_P) $(oa_targetdir)/src/algebra
	touch stamp-subdirs

.PHONY: $(oa_all_targets)

all-driver: all-utils all-lib
	cd driver && $(MAKE) $(AM_MAKEFLAGS) $@

all-utils: stamp-subdirs all-headers
	cd utils && $(MAKE) $(AM_MAKEFLAGS) $@

all-io: all-utils
	cd io && $(MAKE) $(AM_MAKEFLAGS) $@

all-syntax: all-io
	cd syntax && $(MAKE) $(AM_MAKEFLAGS) $@

all-rt: all-utils
	cd rt && $(MAKE) $(AM_MAKEFLAGS) $@

all-clef: all-lib
	cd clef && $(MAKE) $(AM_MAKEFLAGS) $@

all-sman: all-lib all-driver
	cd sman && $(MAKE) $(AM_MAKEFLAGS) $@

all-gui: all-driver all-io all-rt all-syntax
	cd gui && $(MAKE) $(AM_MAKEFLAGS)

all-hyper: all-lib all-io
	cd hyper && $(MAKE) $(AM_MAKEFLAGS) $@

all-share:
	cd share && $(MAKE) $(AM_MAKEFLAGS) $@

.PHONY: all-doc
all-doc: stamp-subdirs
	cd doc && $(MAKE) $(AM_MAKEFLAGS) $@

all-lib: stamp-subdirs all-utils
	cd lib && $(MAKE) $(AM_MAKEFLAGS) $@

all-lisp: all-lib all-driver
	cd lisp && $(MAKE) $(AM_MAKEFLAGS) $@

all-boot: all-lisp
	cd boot && $(MAKE) $(AM_MAKEFLAGS) $@

all-interpsys: all-boot all-hyper-pre all-utils
	cd interp && ${MAKE} $(AM_MAKEFLAGS) all-interpsys

all-axiomsys: all-asq
	cd interp && $(MAKE) $(AM_MAKEFLAGS) all-axiomsys

all-algebra: all-driver all-interpsys all-share all-hyper-pre
	cd algebra && $(MAKE) -f Makefile -f extract.mk $(AM_MAKEFLAGS) $@

.PHONY: all-algstrap
all-algstrap: all-driver all-interpsys
	cd algebra && $(MAKE) $(AM_MAKEFLAGS) $@

.PHONY: all-layer-%
all-layer-%: all-driver all-interpsys
	cd algebra && $(MAKE) $(AM_MAKEFLAGS) $@

.PHONY: all-initdb
all-initdb: all-driver all-interpsys
	cd algebra && $(MAKE) $(AM_MAKEFLAGS) $@

.PHONY: all-hyper-pre
all-hyper-pre: all-lib
	cd hyper && $(MAKE) $(AM_MAKEFLAGS) all-hyper-pre

all-input: all-axiomsys all-doc
	cd input && $(MAKE) $(AM_MAKEFLAGS) $@

all-asq: all-hyper-post all-utils
	cd etc && $(MAKE) $(AM_MAKEFLAGS) $@

.PHONY: all-databases
all-databases:  all-interpsys all-doc
	cd etc && $(MAKE) $(AM_MAKEFLAGS) $@

.PHONY: all-hyper-post
all-hyper-post: all-algebra  all-doc
	cd hyper && $(MAKE) $(AM_MAKEFLAGS) all-hyper-post

all-graph: all-lib all-utils
	cd graph && $(MAKE) $(AM_MAKEFLAGS) $@

## Install include headers
.PHONY: all-headers
all-headers: $(patsubst %.H,$(oa_incdir)/%,$(oa_src_include_headers))

$(oa_incdir)/%: $(srcdir)/include/%.H | $(oa_incdir)
	$(RM) $@ && cp -p $< $@

$(oa_incdir):
	$(MKDIR_P) $@

.PHONY: all-check
all-check:
	cd input && $(MAKE) $(AM_MAKEFLAGS) all-check

mostlyclean-local:
	rm -fr $(oa_incdir)
	for d in $(subdirs); do \
	  (cd $$d && $(MAKE) $(AM_MAKEFLAGS) mostlyclean); \
	done
	-rm -f stamp-subdirs

clean-local:
	for d in $(subdirs); do \
	  (cd $$d && $(MAKE) $(AM_MAKEFLAGS) clean); \
	done

distclean-local:
	for d in $(subdirs); do \
	  (cd $$d && $(MAKE) $(AM_MAKEFLAGS) distclean); \
	done