-
Notifications
You must be signed in to change notification settings - Fork 69
/
Makefile.in
409 lines (335 loc) · 14.5 KB
/
Makefile.in
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
### @configure_input@
.POSIX:
prefix = @prefix@
srcdir = @srcdir@
abs_srcdir = @abs_srcdir@
abs_builddir = @abs_builddir@
TARGET_PLATFORM = @OPEN_DYLAN_TARGET_PLATFORM@
RUNTIME_TARGET_PLATFORMS = $(TARGET_PLATFORM)
RUNTIME = sources/lib/run-time
BUILD_SUBDIRS = bin build databases logs
DYLAN_JOBS = 2
FDMAKE_OPTIONS =
FDMAKE = @PERL@ $(srcdir)/build/fdmake.pl $(FDMAKE_OPTIONS)
LLVM_RTGyes = llvm-runtime-generator
RTG = $(LLVM_RTG@SUPPORT_LLVM@)
BOOTSTRAP_1_COMPILER = @DYLANCOMPILER@
# These are "primitive" in the sense that most of them make use of the
# primitive-* functions.
BOOTSTRAP_1_PRIMITIVE_LIBS = \
dylan common-dylan collections io system \
generic-arithmetic big-integers
.PHONY: 3-stage-bootstrap \
bootstrap-stage-1 bootstrap-stage-1-dirs bootstrap-stage-1-compiler \
bootstrap-stage-1-runtime bootstrap-stage-1-jamfiles cli1 \
bootstrap-stage-2 bootstrap-stage-2-dirs bootstrap-stage-2-compiler \
bootstrap-stage-2-runtime bootstrap-stage-2-jamfiles cli2 \
bootstrap-stage-3 bootstrap-stage-3-dirs bootstrap-stage-3-libraries \
bootstrap-stage-3-runtime bootstrap-stage-3-jamfiles cli3 \
all install install-stage dist clean check \
check-submodules
all: @bootstrap_target@
check-submodules:
@if [ -z "$(SKIP_SUBMODULE_CHECK)" ]; then \
for sms in `cd $(srcdir) && git submodule status | grep -v "^ " | cut -c 1`; do \
if [ "$$sms" != "x" ]; then \
echo "**** ERROR ****"; \
echo "One or more submodules is not up to date."; \
echo "Please run 'git submodule update --init'."; \
echo "If you want to skip this check, pass SKIP_SUBMODULE_CHECK=1 to make."; \
exit 1; \
fi; \
done; \
fi
###
# 3-stage bootstrap includes stages 1 and 2 and 3: it rebuilds the compiler
# and libraries, then rebuilds them again to take advantage of new
# optimizations. The 3-stage bootstrap is useful to build Open Dylan locally
# without installing it; if you want to install it, do a 3-stage bootstrap and
# run make install
3-stage-bootstrap: check-submodules \
bootstrap-stage-1 \
bootstrap-stage-2 \
bootstrap-stage-3
########################################################################
# Stage 1 builds a compiler that can understand new primitives used in the
# BOOTSTRAP_1_PRIMITIVE_LIBS libraries. An existing compiler won't understand
# the new stuff, so until a new compiler is built, existing libs are used
# instead. Note that the stage 1 dylan-compiler loads a mix of existing and
# stage 1 libraries.
BOOTSTRAP_1_ROOT = $(abs_builddir)/Bootstrap.1
BOOTSTRAP_1_REGISTRY = $(abs_srcdir)/sources/bootstrap1-registry
BOOTSTRAP_1_ENV = \
OPEN_DYLAN_TARGET_PLATFORM=$(TARGET_PLATFORM) \
OPEN_DYLAN_USER_ROOT=$(BOOTSTRAP_1_ROOT) \
OPEN_DYLAN_USER_REGISTRIES=$(BOOTSTRAP_1_REGISTRY)
bootstrap-stage-1: bootstrap-stage-1-dirs \
$(BOOTSTRAP_1_REGISTRY) \
bootstrap-stage-1-compiler \
bootstrap-stage-1-runtime \
bootstrap-stage-1-jamfiles
bootstrap-stage-1-dirs:
@for d in $(BUILD_SUBDIRS); do mkdir -p Bootstrap.1/$$d; done
# BOOTSTRAP_1_PRIMITIVE_LIBS registry files are removed so those
# libraries are taken from the bootstrap compiler's system registries.
# The main point of stage 1 is to compile any changed compiler sources.
$(BOOTSTRAP_1_REGISTRY):
mkdir $(BOOTSTRAP_1_REGISTRY)
cp -r $(srcdir)/sources/registry/* $(BOOTSTRAP_1_REGISTRY)
for lib in $(BOOTSTRAP_1_PRIMITIVE_LIBS); do \
rm -f $(BOOTSTRAP_1_REGISTRY)/*/$$lib; \
done
bootstrap-stage-1-compiler:
@echo Building Open Dylan bootstrap stage 1...
@$(BOOTSTRAP_1_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_1_COMPILER)" \
dylan-compiler
BOOTSTRAP_1_LLVM_RTGVARSyes = \
OPEN_DYLAN_LLVM_RUNTIME_GENERATOR=$(BOOTSTRAP_1_ROOT)/bin/$(RTG)
BOOTSTRAP_1_RTGVARS = $(BOOTSTRAP_1_LLVM_RTGVARS@SUPPORT_LLVM@)
bootstrap-stage-1-runtime:
@$(BOOTSTRAP_1_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_1_COMPILER)" \
$(RTG)
@for target_platform in $(RUNTIME_TARGET_PLATFORMS); do \
$(MAKE) -C $(RUNTIME) \
OPEN_DYLAN_USER_INSTALL=$(BOOTSTRAP_1_ROOT) \
OPEN_DYLAN_TARGET_PLATFORM=$$target_platform \
$(BOOTSTRAP_1_RTGVARS) \
install; \
done
bootstrap-stage-1-jamfiles:
@OPEN_DYLAN_USER_INSTALL=$(BOOTSTRAP_1_ROOT) \
$(MAKE) -C sources/jamfiles install
cli1:
@$(BOOTSTRAP_1_ENV) $(BOOTSTRAP_1_COMPILER)
########################################################################
# Stage 2 bootstrap builds altered libraries and compiler and does not
# link to any existing or stage 1 libraries.
BOOTSTRAP_2_ROOT = $(abs_builddir)/Bootstrap.2
BOOTSTRAP_2_COMPILER = \
$(BOOTSTRAP_1_ROOT)/bin/dylan-compiler \
-build -verbose -jobs $(DYLAN_JOBS)
BOOTSTRAP_2_REGISTRY = $(abs_srcdir)/sources/registry
BOOTSTRAP_2_ENV = \
OPEN_DYLAN_TARGET_PLATFORM=$(TARGET_PLATFORM) \
OPEN_DYLAN_USER_ROOT=$(BOOTSTRAP_2_ROOT) \
OPEN_DYLAN_USER_REGISTRIES=$(BOOTSTRAP_2_REGISTRY)
bootstrap-stage-2: bootstrap-stage-2-dirs \
bootstrap-stage-2-compiler \
bootstrap-stage-2-runtime \
bootstrap-stage-2-jamfiles
bootstrap-stage-2-dirs:
@for d in $(BUILD_SUBDIRS); do mkdir -p Bootstrap.2/$$d; done
bootstrap-stage-2-compiler:
@echo Building Open Dylan bootstrap stage 2...
@$(BOOTSTRAP_2_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_2_COMPILER)" \
dylan-compiler
BOOTSTRAP_2_LLVM_RTGVARSyes = \
OPEN_DYLAN_LLVM_RUNTIME_GENERATOR=$(BOOTSTRAP_2_ROOT)/bin/$(RTG)
BOOTSTRAP_2_RTGVARS = $(BOOTSTRAP_2_LLVM_RTGVARS@SUPPORT_LLVM@)
bootstrap-stage-2-runtime:
@$(BOOTSTRAP_2_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_2_COMPILER)" \
$(RTG)
@for target_platform in $(RUNTIME_TARGET_PLATFORMS); do \
$(MAKE) -C $(RUNTIME) \
OPEN_DYLAN_USER_INSTALL=$(BOOTSTRAP_2_ROOT) \
OPEN_DYLAN_TARGET_PLATFORM=$$target_platform \
$(BOOTSTRAP_2_RTGVARS) \
install; \
done
bootstrap-stage-2-jamfiles:
@OPEN_DYLAN_USER_INSTALL=$(BOOTSTRAP_2_ROOT) \
$(MAKE) -C sources/jamfiles install
cli2:
@$(BOOTSTRAP_2_ENV) $(BOOTSTRAP_2_COMPILER)
########################################################################
# Stage 3 builds libraries and compiler using stage 2 products, taking
# advantage of any new optimizations etc. in this release. It basically builds
# an installation without actually installing it.
BOOTSTRAP_3_ROOT = $(abs_builddir)/Bootstrap.3
BOOTSTRAP_3_LIBRARIES = \
dylan-compiler dylan-environment parser-compiler dswank
BOOTSTRAP_3_STATICS = \
deft-app dylan-lsp-server
BOOTSTRAP_3_COMPILER = \
$(BOOTSTRAP_2_ROOT)/bin/dylan-compiler \
-build -verbose -jobs $(DYLAN_JOBS)
BOOTSTRAP_3_REGISTRY = $(abs_srcdir)/sources/registry
BOOTSTRAP_3_ENV = \
OPEN_DYLAN_TARGET_PLATFORM=$(TARGET_PLATFORM) \
OPEN_DYLAN_USER_ROOT=$(BOOTSTRAP_3_ROOT) \
OPEN_DYLAN_USER_REGISTRIES=$(BOOTSTRAP_3_REGISTRY)
bootstrap-stage-3: bootstrap-stage-3-dirs \
bootstrap-stage-3-libraries \
bootstrap-stage-3-statics \
bootstrap-stage-3-runtime \
bootstrap-stage-3-jamfiles
bootstrap-stage-3-dirs:
@for d in $(BUILD_SUBDIRS); do mkdir -p Bootstrap.3/$$d; done
bootstrap-stage-3-libraries:
@echo Building Open Dylan bootstrap stage 3...
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
$(BOOTSTRAP_3_LIBRARIES)
bootstrap-stage-3-statics:
@echo Building Open Dylan unified executables...
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
--unify $(BOOTSTRAP_3_STATICS)
BOOTSTRAP_3_LLVM_RTGVARSyes = \
OPEN_DYLAN_LLVM_RUNTIME_GENERATOR=$(BOOTSTRAP_3_ROOT)/bin/$(RTG)
BOOTSTRAP_3_RTGVARS = $(BOOTSTRAP_3_LLVM_RTGVARS@SUPPORT_LLVM@)
bootstrap-stage-3-runtime:
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
$(RTG)
@for target_platform in $(RUNTIME_TARGET_PLATFORMS); do \
$(MAKE) -C $(RUNTIME) \
OPEN_DYLAN_USER_INSTALL=$(BOOTSTRAP_3_ROOT) \
OPEN_DYLAN_TARGET_PLATFORM=$$target_platform \
$(BOOTSTRAP_3_RTGVARS) \
install; \
done
bootstrap-stage-3-jamfiles:
@OPEN_DYLAN_USER_INSTALL=$(BOOTSTRAP_3_ROOT) \
$(MAKE) -C sources/jamfiles install
cli3:
@$(BOOTSTRAP_3_ENV) $(BOOTSTRAP_3_COMPILER)
########################################################################
###
# Install stage installs stage 3 into prefix
install-stage:
@echo Preparing to install Open Dylan in $(DESTDIR)$(prefix)...
@install -d $(DESTDIR)$(prefix)
@echo Copying sources to $(DESTDIR)$(prefix)/sources...
@rm -rf $(DESTDIR)$(prefix)/sources
@cp -R $(srcdir)/sources $(DESTDIR)$(prefix)
@find $(DESTDIR)$(prefix)/sources -depth -name '.*' -exec rm -rf {} \;
@-rm -rf $(DESTDIR)$(prefix)/sources/bootstrap1-registry
@echo Installing Open Dylan in $(DESTDIR)$(prefix)
@install -d $(prefix)/bin $(prefix)/databases $(prefix)/lib $(DESTDIR)$(prefix)/lib/runtime
@install -d $(prefix)/share/opendylan $(DESTDIR)$(prefix)/include/opendylan
@cp -R $(abs_builddir)/Bootstrap.3/bin $(DESTDIR)$(prefix)
@cp -R $(abs_builddir)/Bootstrap.3/databases $(DESTDIR)$(prefix)
@-cp -R $(abs_builddir)/Bootstrap.3/include/opendylan $(DESTDIR)$(prefix)/include
@# We use force here because on macOS, the lib directory likely contains read-only
@# static libraries for the Boehm GC.
@cp -Rf $(abs_builddir)/Bootstrap.3/lib $(DESTDIR)$(prefix)
@cp -Rf $(abs_builddir)/Bootstrap.3/share/opendylan $(DESTDIR)$(prefix)/share
@cp -R $(srcdir)/tools/lldb $(DESTDIR)$(prefix)/share/opendylan
@cp -R $(srcdir)/tools/bash_completion $(DESTDIR)$(prefix)/share/opendylan
@cp $(srcdir)/tools/scripts/dylan-lldb $(DESTDIR)$(prefix)/bin
@cp $(srcdir)/License.txt $(DESTDIR)$(prefix)
@cp $(srcdir)/README.md $(DESTDIR)$(prefix)
@cp $(srcdir)/BUILDING.rst $(DESTDIR)$(prefix)
@echo Done!
install: 3-stage-bootstrap install-stage
#install-html:
#uninstall:
clean:
-rm -rf $(abs_builddir)/Bootstrap.1
-rm -rf $(abs_builddir)/Bootstrap.2
-rm -rf $(abs_builddir)/Bootstrap.3
-rm -rf $(abs_builddir)/release
-rm -rf $(abs_builddir)/opendylan-*.tar.bz2
-rm -rf $(BOOTSTRAP_1_REGISTRY)
@for target_platform in $(RUNTIME_TARGET_PLATFORMS); do \
$(MAKE) -C $(RUNTIME) \
OPEN_DYLAN_TARGET_PLATFORM=$$target_platform \
clean; \
done
rm -f $(srcdir)/sources/app/llvm-tablegen/tablegen-parser.dylan
rm -f $(srcdir)/sources/lib/llvm/llvm-asm-parser.dylan
rm -f $(srcdir)/sources/corba/scepter/front-end/file/parser.dylan
rm -rf $(srcdir)/sources/corba/orb/iop-protocol
rm -rf $(srcdir)/sources/corba/orb/ir-protocol
rm -rf $(srcdir)/sources/corba/orb/ir-stubs
rm -rf $(srcdir)/sources/corba/services/naming/naming-protocol
rm -rf $(srcdir)/sources/corba/services/naming/naming-skeletons
rm -rf $(srcdir)/sources/corba/services/naming/naming-stubs
rm -rf $(srcdir)/sources/corba/demos/bank/bank/protocol
rm -rf $(srcdir)/sources/corba/demos/bank/bank/skeletons
rm -rf $(srcdir)/sources/corba/demos/bank/bank/stubs
rm -rf $(srcdir)/sources/corba/demos/pente/protocol/
rm -rf $(srcdir)/sources/corba/demos/pente/skeletons/
rm -rf $(srcdir)/sources/corba/demos/pente/stubs/
rm -rf $(srcdir)/sources/corba/tests/idl/protocol/
rm -rf $(srcdir)/sources/corba/tests/idl/skeletons/
rm -rf $(srcdir)/sources/corba/tests/idl/stubs/
rm -rf $(srcdir)/sources/runtime-manager/debugger-nub/protocol
rm -rf $(srcdir)/sources/runtime-manager/debugger-nub/skeletons
rm -rf $(srcdir)/sources/runtime-manager/debugger-nub/stubs
distclean: clean
-find $(srcdir) -name '*~' -exec rm {} \;
-find $(srcdir) -name '*.pyc' -exec rm {} \;
-rm -f Makefile
-rm -f aclocal.m4
-rm -rf autom4te.cache
-rm -rf build-aux
-rm -f config.log
-rm -f config.status
-rm -f config.status.lineno
-rm -rf config/build-aux
-rm -f configure
-rm -rf documentation/*/build
-rm -f sources/jamfiles/Makefile sources/jamfiles/config.jam
-rm -f sources/lib/run-time/Makefile
mostlyclean:
maintainer-clean:
TAGS:
html:
version = @VERSION@
dist: 3-stage-bootstrap
mkdir -p release/opendylan-$(version)/bin
mkdir -p release/opendylan-$(version)/databases
mkdir -p release/opendylan-$(version)/include/opendylan
mkdir -p release/opendylan-$(version)/lib
mkdir -p release/opendylan-$(version)/sources
mkdir -p release/opendylan-$(version)/share/opendylan
@echo Copying sources...
cp -R $(srcdir)/sources release/opendylan-$(version)/
@echo Removing unnecessary directories...
find release/opendylan-$(version)/sources -depth -name '.*' -exec rm -rf {} \;
rm -rf release/opendylan-$(version)/sources/bootstrap1-registry
cp -R Bootstrap.3/bin release/opendylan-$(version)/
cp -R Bootstrap.3/sbin/* release/opendylan-$(version)/bin
ln -s deft-app release/opendylan-$(version)/bin/deft
ln -s deft-app release/opendylan-$(version)/bin/dylan # ease transition to "deft"
cp -R Bootstrap.3/databases release/opendylan-$(version)/
-cp -R Bootstrap.3/include/opendylan release/opendylan-$(version)/include
cp -R Bootstrap.3/lib release/opendylan-$(version)/
cp -R Bootstrap.3/share/opendylan release/opendylan-$(version)/share
cp -R $(srcdir)/tools/lldb release/opendylan-$(version)/share/opendylan
cp -R $(srcdir)/tools/bash_completion release/opendylan-$(version)/share/opendylan
cp $(srcdir)/License.txt release/opendylan-$(version)/
cp $(srcdir)/README.md release/opendylan-$(version)/
cp $(srcdir)/BUILDING.rst release/opendylan-$(version)/
cd release \
&& tar cjf opendylan-$(version)-$(TARGET_PLATFORM).tar.bz2 opendylan-$(version) \
&& ln -s opendylan-$(version)-$(TARGET_PLATFORM).tar.bz2 opendylan.tar.bz2
TEST_LIBS = \
libraries-test-suite \
dfmc-reader-test-suite \
strings-test-suite \
duim-test-suite \
deuce-test-suite \
jam-test-suite \
channels-test-suite \
variable-search-tests \
command-line-parser-test-suite \
logging-test-suite \
regular-expressions-test-suite \
hash-algorithms-test
TEST_LOADS = $(shell for lib in $(TEST_LIBS); do echo "--load lib$${lib}.@shrext@ "; done)
check: bootstrap-stage-3
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
testworks-run $(TEST_LIBS)
$(BOOTSTRAP_3_ROOT)/bin/testworks-run $(TEST_LOADS)
check-environment: bootstrap-stage-3
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
dfmc-environment-test-suite-app
@OPEN_DYLAN_USER_REGISTRIES=$(BOOTSTRAP_3_REGISTRY) \
OPEN_DYLAN_USER_SOURCES=$(srcdir)/sources \
OPEN_DYLAN_USER_ROOT=$(abs_builddir)/_testbuild \
$(BOOTSTRAP_3_ROOT)/bin/dfmc-environment-test-suite-app
installcheck:
installdirs:
Makefile: $(srcdir)/Makefile.in config.status
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=./$@ $(SHELL) ./config.status