aboutsummaryrefslogtreecommitdiff
path: root/src/interp/Makefile.pamphlet
blob: 9cbe7046e0340b3789d10a6e3512cbbc0ad12d23 (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
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
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
%% Oh Emacs, this is a -*- Makefile -*-, so give me tabs.
\documentclass{article}
\usepackage{axiom}

\title{\File{src/interp/Makefile} Pamphlet}
\author{Timothy Daly \and Gabriel Dos~Reis}

\begin{document}
\maketitle

\begin{abstract}
\end{abstract}

\tableofcontents
\eject

\begin{verbatim}
notes for understanding this makefile:
re: postpar.clisp and parse.clisp stanzas: 
NOTE: the .clisp file is copies back into the src directory so that
it is possible to create a new obootsys system from scratch for a 
new platform. parse.clisp needs to be compiled in a depsys.
one thing need to be done to create an obootsys by hand:
  parse and postpar must be loaded along with the depsys files
     into a bare lisp system.
if these two things are done then a obootsys image can be bootstrapped
to a new platform.

IMPORTANT: all source file names in this Makefile must be lowercase
  This is for cross-platform compatibility and also makes getting
  them into Lisp much easier at the Makefile level.

\end{verbatim}


\section{The Environment}

We define 3 directories for this build. The first two are
the traditional {\bf IN}, which is where the source pamphlets are,
and {\bf OUT} which is where we will put the binaries.

In this case the {\bf IN} files are usually written in Boot \cite{2}.
These will be compiled in a \Tool{bootsys} image to translate from
Boot to Common Lisp. 

\subsection{Documentation}

The dvi files will be generated from the pamphlet files in the
final ship \File{doc/src/} directory. Since they are system independent 
but machine generated and part of the final ship they will exist 
in the [[\$(axiom_target_docdir)/src/interp/]] directory.

<<environment>>=
IN=$(srcdir)
DOC=$(axiom_target_docdir)/src/interp
BOOK=$(axiom_target_docdir)

# Command to translate Boot to Common Lisp
BOOT_TO_LISP = $(BOOTSYS) -- --translate --output=$@ $< 

# Command to translate Common Lisp to native object code
COMPILE_LISP = $(DEPSYS) -- --compile --output=$@ $<
@


\subsection{Autloload}

In order to minimize the size of the OpenAxiom image at load time
we put some of the compiled files into a separate directory
that will be autoloaded on demand. This directory of code
will be shipped with the final system and so it belongs in
the [[$(axiom_targetdir)]] subtree.
<<environment>>=
AUTO=$(axiom_targetdir)/autoload

autoload_objects =

@


\subsection{Initial Lisp image}

We need a raw Lisp image --- running on the build platform ---
that we can use as a base to construct
the other images. This is called {\bf LISPSYS} and is located in the
build platform sub-directory.
<<environment>>=
# Build platform-dependent Lisp image, at the base of other
# derived Lisp images (depsys, interpsys, AXIOMsys)
LISPSYS= $(axiom_build_bindir)/lisp

@

\subsection{Boot translator}

Most of the interpreter is written in the Boot programming language. 
Thus we need a program to translate Boot to Common
Lisp.  That program is called the {\bf BOOTSYS} image (because the
translator is written in {\bf boot} and needs to translate
itself to bootstrap the system).  This image is assumed to
have been built (on the build platform) by a previous step in the
make process.
<<environment>>=
BOOTSYS= $(axiom_build_bindir)/bootsys    

@

Note also that another translator (built into [[depsys]]) translates
a variant og Boot (called ``old Boot'') to Common Lisp.


\subsection{The old Boot translator}

<<environment>>=
DEPSYS = ./depsys
@

Some of the Common Lisp code we compile uses macros which
are assumed to be available at compile time. The [[DEPSYS]]
image is created to contain the compile time environment
and saved.  Furthermore, it is also used to translate codes written
in ``old Boot'' to Common Lisp.  That translator is in the process of
being phased out in favor of the ``new Boot'' translator found in
\File{src/boot/}.

\subsubsection{Structure of [[depsys]]}

The [[depsys]] image is made of the following Lisp source files

\begin{description}
\item[Interpreted Lisp source files]
  The following files are currently part of [[depsys]] in interpreted
  form.  The exact reasons for that are not well articulated.

  \begin{description}
    \item[\File{nocompil.lisp}]  This file defines obscure functions
    that seem to be there only for obscure reasons.  Most of them are not
    really needed for translating Boot codes.
  
    \item[\File{bookvol5.lisp}]  This file defines functions for
    the Spad interpreter.  None of which seems relevant for translating
    Boot codes to Common Lisp.

    \item[\File{util.lisp}] This file defines various ``system-level''
    helper functions, for building [[depsys]], [[interpsys]], etc.

    \item[\File{vmlisp.lisp}]  This is a collection of various utility
    functions, encapsulations of variabilities of Lisp implementations.
    All those symbols are defined in the package [[VMLISP]].
    It needs some strip down, and possibly have its contents moved
    to the package [[BOOT]].

    \item[\File{ggreater.lisp}]  This file defines various orderings 
    on collections and other aggregates.  Its content is defined in the
    package [[VMLISP]].

    \item[\File{hash.lisp}]  This file defines a ``hash table'' module.
    Its content is defined in package [[VMLISP]].

    \item[\File{union.lisp}]  This file defines functions that
    compute set-theoretic operations (union, difference, intersection, etc.).
    Its content is in package [[VMLISP]].

    \item[\File{nlib.lisp}]  This file defines to work around problems
    with GCL when compiling Spad files.  It is not necessary for
    translating Boot codes to Common Lisp.  Its content is in package
    [[VMLISP]].

    \item[\File{macros.lisp}]  This file collects various helper macros
    and functions for Boot and Spad codes.

    \item[\File{comp.lisp}]  This file defines several functions that
    desugar Boot and Spad codes; in particular, they infer local
    variables from their position in assignment expressions.  Its
    content is defined in package [[BOOT]].

    \item[\File{spaderror.lisp}]  This file defines error handling functions
    that are useful only for Spad codes -- not for translating Boot codes.
    Its content is defined in package [[BOOT]].

    \item[\File{debug.lisp}] This file defines debug utilities for
    essentially Spad codes.  Its content is defined in package [[BOOT]].

    \item[\File{spad.lisp}]  This files defines the entry points for
    processing Spad and Boot codes.  Its content is defined in package
    [[BOOT]].

    \item[\File{bits.lisp}]  This file implements a ``bit vector''
    data type.  Its content is in package [[BOOT]].

    \item[\File{setq.lisp}]  This file defines several global
    variables.  Its content is defined in package [[BOOT]].

    \item[\File{property.lisp}]  This file defines properties of
     Spad and Boot tokens, as well as several constructors.  Its
    content is defined in package [[BOOT]].
 
    \item[\File{unlisp.lisp}]  This file attempts to define interfaces
    to the Operating System, that are not found in strict ANSI 
    Common Lisp (though they may be present as extensions with
    varying spellings.).  Its content is defined in package [[BOOT]].

    \item[\File{foam\_l.lisp}]  This file defines the FOAM functions.
    The packages [[FOAM]] and [[FOAM-USER]] are defined here.
    It is not needed for translating Boot codes to Common Lisp.

    \item[\File{axext\_l.lisp}]  This file defines various macros and
    functions for interoperability between Aldor and OpenAxiom.  Not needed
    for translating Boot codes to Common Lisp.
  \end{description}

\item[Compiled Lisp source files]
  \begin{description}
    \item[\File{parsing.lisp}]
   
    \item[\File{metalex.lisp}]

    \item[\File{bootlex.lisp}]

    \item[\File{newaux.lisp}]

    \item[\File{preparse.lisp}]

    \item[\File{postprop.lisp}]

    \item[\File{def.lisp}]

    \item[\File{fnewmeta.lisp}]
  \end{description}

\item[Compiled Boot source files]
  \begin{description}
    \item[\File{postpar.boot}]

    \item[\File{parse.boot}]

    \item[\File{clam.boot}]

    \item[\File{slam.boot}]

    \item[\File{g-boot.boot}]

    \item[\File{c-util.boot}]

    \item[\File{g-util.boot}]
  \end{description}

\end{description}

The {\bf DEP} variable contains the list of files that
will be loaded into {\bf DEPSYS}. Notice that these files
are loaded in interpreted form. We are not concerned about
the compile time performance so we can use interpreted code.
We do, however, care about the macros as these will be
expanded in later compiles. All macros are assumed to be
in this list of files.
<<environment>>=
DEP=	$(srcdir)/spaderror.lisp	$(srcdir)/debug.lisp	\
	$(srcdir)/spad.lisp	\
	$(srcdir)/setq.lisp	$(srcdir)/property.lisp	\
	$(srcdir)/unlisp.lisp     $(srcdir)/foam_l.lisp      \
	$(srcdir)/axext_l.lisp
@

Once we've compile all of the Common Lisp files we fire up
a clean lisp image called {\bf LOADSYS} (from the build platform), load all 
of the
final executable code and save it out as {\bf SAVESYS}.  This image
is used to bootstrap the Algebra files and generate the
databases.  
The {\bf SAVESYS} image is copied to the [[$(axiom_target_bindir)]]
subdirectory and becomes the axiom executable image.  Technically, that is
not right because the host plaform may not be the same as the build
platform.  However, we don't yet support cross compilation, so that
is alright for the time being.
<<environment>>=
LOADSYS= $(axiom_build_bindir)/lisp$(EXEEXT)
SAVESYS= interpsys$(EXEEXT)
AXIOMSYS= $(axiom_target_bindir)/AXIOMsys$(EXEEXT)

@

These are the files that need to be compiled (in {\bf BOOTSYS}),
loaded into a clean lisp image ({\bf LOADSYS}) and saved as
a runnable \Tool{OpenAxiom} interpreter ({\bf SAVESYS}) usually named
\Tool{interpsys}. Most of these files
are translated from Boot to Common Lisp and then 
compiled.  The \File{setq.lisp}
file contains constant initialization code which gains nothing
by being compiled.

\subsection{The Spad interpreter and compiler}

The value of the variable [[AXIOMsys_boot_sources]] is the (currently
partial) list of Boot source files that make up the interpreter.
Similarly, the value of the variable [[AXIOMsys_compiled_lisp_sources]]
is the list of Common Lisp source files that are compiled into
the interpreter.  Notice that some of these files are loaded (\eg{},
interpreted) in [[depsys]].

<<environment>>=
OBJS=	vmlisp.$(FASLEXT)	hash.$(FASLEXT)	\
	diagnostics.$(FASLEXT)	sys-driver.$(FASLEXT) \
	macros.$(FASLEXT)	\
	unlisp.$(FASLEXT)	setq.$(FASLEXT)	\
	astr.$(FASLEXT)	bits.$(FASLEXT)	\
	alql.$(FASLEXT)	buildom.$(FASLEXT)	\
	cattable.$(FASLEXT)				\
	cformat.$(FASLEXT)	cfuns.$(FASLEXT)	\
	clam.$(FASLEXT)	clammed.$(FASLEXT)	\
	comp.$(FASLEXT)	        foam_l.$(FASLEXT) \
	compat.$(FASLEXT)	compress.$(FASLEXT)	\
	cparse.$(FASLEXT)	cstream.$(FASLEXT)	\
	database.$(FASLEXT)	\
	debug.$(FASLEXT)	dq.$(FASLEXT)		\
	fname.$(FASLEXT)	format.$(FASLEXT)	\
	g-boot.$(FASLEXT)	g-cndata.$(FASLEXT)	\
	g-error.$(FASLEXT)	g-opt.$(FASLEXT)	\
	g-timer.$(FASLEXT)	g-util.$(FASLEXT)	\
	ggreater.$(FASLEXT)				\
	hypertex.$(FASLEXT)	i-analy.$(FASLEXT)	\
	i-object.$(FASLEXT)				\
	i-code.$(FASLEXT)	i-coerce.$(FASLEXT)	\
	i-coerfn.$(FASLEXT)	i-eval.$(FASLEXT)	\
	i-funsel.$(FASLEXT)	bookvol5.$(FASLEXT)	\
	i-intern.$(FASLEXT)	i-map.$(FASLEXT)	\
	i-output.$(FASLEXT)	i-resolv.$(FASLEXT)	\
	i-spec1.$(FASLEXT)				\
	i-spec2.$(FASLEXT)	i-syscmd.$(FASLEXT)	\
	i-toplev.$(FASLEXT)	i-util.$(FASLEXT)	\
	incl.$(FASLEXT)	int-top.$(FASLEXT)	\
	intfile.$(FASLEXT)				\
	lisplib.$(FASLEXT)	macex.$(FASLEXT)	\
	match.$(FASLEXT)				\
	monitor.$(FASLEXT)	msg.$(FASLEXT)		\
	msgdb.$(FASLEXT)	\
	newaux.$(FASLEXT)	newfort.$(FASLEXT)	\
	nlib.$(FASLEXT)	nrunfast.$(FASLEXT)	\
	nrungo.$(FASLEXT)	nrunopt.$(FASLEXT)	\
	nruntime.$(FASLEXT)	osyscmd.$(FASLEXT)	\
	packtran.$(FASLEXT)	pathname.$(FASLEXT)	\
	pf2sex.$(FASLEXT)	pile.$(FASLEXT)	\
	posit.$(FASLEXT)	property.$(FASLEXT)	\
	ptrees.$(FASLEXT)	\
	record.$(FASLEXT)				\
	rulesets.$(FASLEXT)	\
	scan.$(FASLEXT)	serror.$(FASLEXT)	\
	server.$(FASLEXT)				\
	setvars.$(FASLEXT)	\
	sfsfun-l.$(FASLEXT)	sfsfun.$(FASLEXT)	\
	simpbool.$(FASLEXT)	slam.$(FASLEXT)	\
	sockio.$(FASLEXT)	spad.$(FASLEXT)	\
	spaderror.$(FASLEXT)				\
	template.$(FASLEXT)	termrw.$(FASLEXT)	\
	trace.$(FASLEXT)	\
	union.$(FASLEXT)       daase.$(FASLEXT)  	\
	fortcall.$(FASLEXT) \
	$(OPOBJS) \
	$(OCOBJS) \
	$(BROBJS)

interpsys_modules = $(patsubst %.$(FASLEXT), "%", $(OBJS))
@

Before we save the {\bf SAVESYS} image we need to run some
initialization code. These files perform initialization
for various parts of the system. The {\bf patches.lisp} \cite{5}
file contains last-minute changes to various functions and
constants.
<<environment>>=
INOBJS=	varini.$(FASLEXT)	\
	setvart.$(FASLEXT)	intint.$(FASLEXT)	\
        interop.$(FASLEXT)     \
        patches.$(FASLEXT)

IN_modules = $(patsubst %.$(FASLEXT), "%", $(INOBJS))

@

Certain functions do not need to be in the running system.
If the running image never calls the compiler or does not
use the hypertex browser we will never call the functions
in these files. The code that calls these functions in the
running system will autoload the appropriate files the
first time they are called. Loading the files overwrites
the autoload function call and re-calls the function. 
Any subsequent calls will run the compiled code.

The {\bf OPOBJS} list contains files from the old parser. The use of
``old'' is something of a subtle concept as there were several
generations of ``old'' and all meaning of the term is lost.

Notice that the object file [[def.$(FASLEXT)]] appears on both the
[[OPBJS]] and [[TRANOBJS]] lists.  In normal situation, parsing 
precedes translation; consequently the file [[def]] is loaded by the 
parser, so that it does not need to be reloaded by the translator. 
However, it may theoretically be that a translation could happen without 
prior parsing (in case someone types in a parse tree for SPAD code).  
Consequently, it must be ensured that [[def.]] is still loaded in that
configuration.  In the long term, the autoload machinery need
rethinking.

<<environment>>=
# These are autloaded old parser files
OPOBJS=	parsing.$(FASLEXT)	bootlex.$(FASLEXT)	\
        def.$(FASLEXT)	\
	fnewmeta.$(FASLEXT)	metalex.$(FASLEXT)	\
	parse.$(FASLEXT)	postpar.$(FASLEXT)	\
	postprop.$(FASLEXT)	preparse.$(FASLEXT)

autoload_objects += $(OPBJS)
@

The {\bf OCOBJS} list contains files from the old compiler. Again,
``old'' is meaningless. These files should probably be autoloaded.
<<environment>>=
OCOBJS=	apply.$(FASLEXT)	c-doc.$(FASLEXT)	\
	c-util.$(FASLEXT)	profile.$(FASLEXT)	\
	category.$(FASLEXT)	compiler.$(FASLEXT)	\
	define.$(FASLEXT)	functor.$(FASLEXT)	\
	info.$(FASLEXT)	iterator.$(FASLEXT)	\
	modemap.$(FASLEXT)	nruncomp.$(FASLEXT)	\
	package.$(FASLEXT)	htcheck.$(FASLEXT)	\
        xruncomp.$(FASLEXT)   

autoload_objects += $(OCOBJS)

@

The {\bf BROBJS} list contains files only used by the hypertex
browser. These files should probably be autoloaded.
<<environment>>=
BROBJS=	bc-matrix.$(FASLEXT)				\
	bc-misc.$(FASLEXT)	bc-solve.$(FASLEXT)	\
	bc-util.$(FASLEXT)				\
	ht-util.$(FASLEXT)	htsetvar.$(FASLEXT)	\
	ht-root.$(FASLEXT)	\
	br-con.$(FASLEXT)	\
	br-data.$(FASLEXT)	showimp.$(FASLEXT)    \
	br-op1.$(FASLEXT)	br-op2.$(FASLEXT)	\
	br-search.$(FASLEXT)	br-util.$(FASLEXT)	\
	topics.$(FASLEXT)     br-prof.$(FASLEXT)    \
	br-saturn.$(FASLEXT)

autoload_objects += $(BFOBJS)

@

The {\bf TRANOBJS} list contains files used by Spad to Aldor convertor.
The files probably are also used by the {\bf boot}
to Common Lisp translator and are probably never used by anyone
but the developers.

When a user requests converting a file from Spad to Aldor the
function
[[spad2AsTranslatorAutoloadOnceTrigger]] is called triggering
load of this group of files. Loading [[$TRANOBJS]] in turn replaces
many compiler functions by versions contain in this files.
 These files should probably be autoloaded
(at least [[${AUTO}/wi1.$(FASLEXT)]] and [[${AUTO}/wi2.$(FASLEXT)]]
(which replace compiler functions) {\em must} be autoloaded).
<<environment>>=
TRANOBJS= ${AUTO}/wi1.$(FASLEXT) ${AUTO}/wi2.$(FASLEXT) ${AUTO}/pspad1.$(FASLEXT) \
	  ${AUTO}/pspad2.$(FASLEXT) ${AUTO}/mark.$(FASLEXT) ${AUTO}/nspadaux.$(FASLEXT) \
	  ${AUTO}/def.$(FASLEXT)

autoload_objects += $(TRANOBJS)

@

The {\bf NAGBROBJS} list contains files used to access the 
Numerical Algorithms Group (NAG) fortran libraries. 
These files should probably be autoloaded.
Note that [[${AUTO}/nag-e02a.$(FASLEXT)]] is not included in this
list as it is a subset of [[${AUTO}/nag-e02.$(FASLEXT)]].
<<environment>>=
NAGBROBJS= ${AUTO}/nag-c02.$(FASLEXT)   ${AUTO}/nag-c05.$(FASLEXT) \
           ${AUTO}/nag-c06.$(FASLEXT)   ${AUTO}/nag-d01.$(FASLEXT) \
           ${AUTO}/nag-d02.$(FASLEXT)   ${AUTO}/nag-d03.$(FASLEXT) \
           ${AUTO}/nag-e01.$(FASLEXT)   ${AUTO}/nag-e02.$(FASLEXT) \
           ${AUTO}/nag-e04.$(FASLEXT)   ${AUTO}/nag-f01.$(FASLEXT) \
           ${AUTO}/nag-f02.$(FASLEXT)   ${AUTO}/nag-f04.$(FASLEXT) \
           ${AUTO}/nag-f07.$(FASLEXT)   ${AUTO}/nag-s.$(FASLEXT) 

autoload_objects += $(NAGBROBJS)

@

The {\bf ASCOMP} list contains files used by the {\bf Aldor}
\cite{5} compiler. These files should probably be autoloaded.
<<environment>>=
ASCOMP= hashcode.$(FASLEXT) as.$(FASLEXT) \
	foam_l.$(FASLEXT) axext_l.$(FASLEXT)

AS_modules = $(patsubst %.$(FASLEXT), "%", $(ASCOMP))

@

The {\bf ASAUTO} list contains files used by the {\bf Aldor}
\cite{5} compiler. These files are autoloaded as needed.
<<environment>>=
ASAUTO= ${AUTO}/ax.$(FASLEXT)

autoload_objects += $(ASAUTO)
@

OpenAxiom versions are given as a string of the form:
"Sunday September 21, 2003 at 20:38:05 "
which describe the day, date, and time of the build.
This is used for reporting bugs. It is only partially useful
in identifying which source code was used. Ideally we could create
a tar file of all of the date/time stamps of all of the source files
and use the MD5 hash of that file as the version stamp. Ultimately
though, this would be chasing the elusive "perfect information" idea.

A new variable [[boot::*build-version*]] is set here and used by the
[[yearweek]] function to display the version number of the OpenAxiom build.
This information is set by hand in the top level Makefile.
<<environment>>=
TIMESTAMP=$(axiom_targetdir)/timestamp
YEARWEEK=(progn (setq boot::timestamp "${TIMESTAMP}") \
                (setq boot::*build-version* "$(PACKAGE_STRING)") \
                (boot::yearweek))

@

The {\bf .PRECIOUS} setting will keep make from deleting these
images if the build is stopped. Since once they are built they
are likely to be useable we don't need to redo the work if they
exist.
<<environment>>=

.PRECIOUS:	${DEPSYS}
.PRECIOUS:	${SAVESYS}
.PRECIOUS:	${AXIOMSYS}

@

\section{Codes from Pamphlets}

As noted earlier, the Boot codes are first extrated from the pamphlet
files:
<<extract source codes>>=
.PRECIOUS: %.boot
%.boot: $(srcdir)/%.boot.pamphlet
	$(axiom_build_document) --tangle --output=$@ $<
@

The extracted Boot codes are then fed into \Tool{bootsys} which translates
them into Common Lisp codes:
<<extract source codes>>=
.PRECIOUS: %.clisp
%.clisp: %.boot
	$(BOOT_TO_LISP)
@

The resulting Common Lips codes are, in turn, compiled to object codes
using the \Tool{depsys} image.
<<extract source codes>>=
.PRECIOUS: %.$(FASLEXT)
%.$(FASLEXT): %.clisp
	$(COMPILE_LISP)
@

Part of the interpreter is written directly in Common Lisp (instead of the 
sugared dialect Boot).  That part is extracted from the pamphlet files
and compiled to native object code, as usual.
<<extract source codes>>=
# Extract and compile the part of the interpreter written
# in Common Lisp
.PRECIOUS: %.lisp
%.$(FASLEXT): %.lisp
	$(COMPILE_LISP)

%.lisp: $(srcdir)/%.lisp.pamphlet
	$(axiom_build_document) --tangle --output=$@ $<
@

\section{The warm.data file}

This is a file of commands that will be loaded into interpsys
at the last minute. It execute functions that will likely be
used in a running system so all of the required routines will
be in the lisp image thus minimizing their startup time.
<<warm.data.stanza>>=
../algebra/warm.data: $(srcdir)/Makefile.pamphlet
	@ echo 2 building warm.data
	$(axiom_build_document) --tangle=warm.data --output=$@ $<

@

<<warm.data>>=
(in-package 'boot)
(setq |$topicHash| (make-hash-table))
(setf (gethash '|basic| |$topicHash|) 2)
(setf (gethash '|algebraic| |$topicHash|) 4)
(setf (gethash '|miscellaneous| |$topicHash|) 13)
(setf (gethash '|extraction| |$topicHash|) 6)
(setf (gethash '|conversion| |$topicHash|) 7)
(setf (gethash '|hidden| |$topicHash|) 3)
(setf (gethash '|extended| |$topicHash|) 1)
(setf (gethash '|destructive| |$topicHash|) 5)
(setf (gethash '|transformation| |$topicHash|) 10)
(setf (gethash '|hyperbolic| |$topicHash|) 12)
(setf (gethash '|construct| |$topicHash|) 9)
(setf (gethash '|predicate| |$topicHash|) 8)
(setf (gethash '|trignometric| |$topicHash|) 11)

@

\section{UNUSED}

These files were in the interp distribution from NAG but have
no purpose at the moment. This belief is no doubt due to my
lack of understanding. Rather than erase them they are documented
here for future reference. [[${DOC}/nag-e02a.boot.dvi]] and
[[${DOC}/nag-e02b.boot.dvi]] appear to be two halfs of the file
[[${DOC}/nag-e02.boot.dvi]] and have been removed.
<<environment>>=
UNUSED= ${DOC}/anna.boot.dvi ${DOC}/construc.lisp.dvi \
	${DOC}/domain.lisp.dvi 	${DOC}/guess.boot.dvi \
	${DOC}/interp-fix.boot.dvi \
	${DOC}/nhyper.boot.dvi ${DOC}/pf2atree.boot.dvi \
	${DOC}/redefs.boot.dvi 	${DOC}/word.boot.dvi 

@

\section{Building DEPSYS}

\begin{verbatim}
NOTES: depsys proceeds all else. it is the compile-time environment
for all interpreter code. 
[[OLD-BOOT::BOOT]] emulates the new boot parser command [[BOOTTOCL]]. since
we eventually plan to move to the new boot parser this function
should disappear.
the load of postpar and parse (without extensions) allows the .${LISP} form
to be loaded in a virgin system. however, if depsys is recreated then
the compiled form will get loaded.
\end{verbatim}

\subsection{save depsys image}

Once the appropriate commands are in the [[makedep.lisp]] file
we can load the file into an initial Lisp image and save it.
In freebsd we cannot do this so we have to use
a much more complicated procedure.
This code used to read:
\begin{verbatim}
<<save depsys image>>=
	../lisp/base-lisp$(EXEEXT) -- --make --output=$@ \
		--load-directory=. makedep.lisp
@
\end{verbatim}


<<depsys>>=
${DEPSYS}:	vmlisp.$(FASLEXT) \
		hash.$(FASLEXT) \
		bits.$(FASLEXT) \
		ggreater.$(FASLEXT) \
		union.$(FASLEXT) \
		boot-pkg.$(FASLEXT) \
		sys-constants.$(FASLEXT) \
		sys-globals.$(FASLEXT) \
		sys-driver.$(FASLEXT) \
		diagnostics.$(FASLEXT) \
		sys-macros.$(FASLEXT) \
		macros.$(FASLEXT) \
		nlib.$(FASLEXT) \
		comp.$(FASLEXT) \
		${DEP} \
		nocompil.$(FASLEXT) \
	        bookvol5.$(FASLEXT)\
		util.$(FASLEXT) \
	        postpar.$(FASLEXT) \
		parse.$(FASLEXT) \
	        parsing.$(FASLEXT) \
		metalex.$(FASLEXT) \
	        bootlex.$(FASLEXT) \
		newaux.$(FASLEXT) \
	        preparse.$(FASLEXT) \
	        postprop.$(FASLEXT)\
		def.$(FASLEXT) \
	        fnewmeta.$(FASLEXT) \
		g-error.$(FASLEXT) \
	        g-boot.$(FASLEXT) \
		c-util.$(FASLEXT) \
	        g-util.$(FASLEXT) \
	        clam.$(FASLEXT) \
	        slam.$(FASLEXT)
	@ echo 3 making ${DEPSYS} 
	@ rm -f makedep.lisp
	@ $(mkinstalldirs) $(axiom_build_bindir)
	@ echo '(|importModule| "sys-driver")' >> makedep.lisp
	@ echo '(|importModule| "vmlisp")' >> makedep.lisp
	@ echo '(|importModule| "bits")' >> makedep.lisp
	@ echo '(|importModule| "hash")' >> makedep.lisp
	@ echo '(|importModule| "ggreater")' >> makedep.lisp
	@ echo '(|importModule| "union")' >> makedep.lisp
	@ echo '(|importModule| "nocompil")' >> makedep.lisp
	@ echo '(|importModule| "macros")' >> makedep.lisp
	@ echo '(|importModule| "nlib")' >> makedep.lisp
	@ echo '(|importModule| "bookvol5")' >> makedep.lisp
	@ echo '(|importModule| "util")' >> makedep.lisp
	@ echo '(in-package "BOOT")' >> makedep.lisp
	@ echo '(build-depsys (quote ($(patsubst %, "%", ${DEP}))))' >> makedep.lisp
	@ echo '(in-package "AxiomCore")' >> makedep.lisp
	@ echo '(|importModule| "newaux")' >> makedep.lisp
	@ echo '(|importModule| "parse")' >> makedep.lisp
	@ echo '(|importModule| "metalex")' >> makedep.lisp
	@ echo '(|importModule| "parsing")' >> makedep.lisp
	@ echo '(|importModule| "fnewmeta")' >> makedep.lisp
	@ echo '(|importModule| "preparse")' >> makedep.lisp
	@ echo '(|importModule| "comp")' >> makedep.lisp
	@ echo '(|importModule| "def")' >> makedep.lisp
	@ echo '(|importModule| "bootlex")' >> makedep.lisp
	@ echo '(|importModule| "postprop")' >> makedep.lisp
	@ echo '(|importModule| "postpar")' >> makedep.lisp
	@ echo '(|importModule| "clam")' >> makedep.lisp
	@ echo '(|importModule| "slam")' >> makedep.lisp
	@ echo '(|importModule| "g-error")' >> makedep.lisp
	@ echo '(|importModule| "g-boot")' >> makedep.lisp
	@ echo '(|importModule| "c-util")' >> makedep.lisp
	@ echo '(|importModule| "g-util")' >> makedep.lisp
<<save depsys image>>
	@ echo 4 ${DEPSYS} created


util.$(FASLEXT): util.lisp parsing.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

bookvol5.$(FASLEXT): bookvol5.lisp boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

nocompil.$(FASLEXT): nocompil.lisp boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<
@

\section{Building SAVESYS and AXIOMSYS}

GCL likes to tell you when it has replaced a function call by a 
tail-recursive call. This happens when the last form in a function
is a call to the same function. In general, we don't care so we set
compiler::*suppress-compiler-notes* to true in order to reduce the noise.

Notice that when OpenAxiom uses GCL as the Lisp platform, it is usually not 
a good idea to mess with GCL's internal variables.  In particular, GCL
has its own idea about what to do with [[si::*system-directory*]], which 
should not be set here just because we happen to save an GCL-based image.
Doing otherwise causes havoc.

<<savesys>>=
makeint.lisp:	${DEPSYS} ${OBJS} bookvol5.$(FASLEXT) util.$(FASLEXT) \
                nocompil.$(FASLEXT) \
		sys-driver.$(FASLEXT) \
	        ${OUTINTERP} obey.$(FASLEXT) \
		database.date ${INOBJS} ${ASCOMP} ${ASAUTO} \
		${NAGBROBJS} ${TRANOBJS} \
	        ${LOADSYS} \
		$(axiom_targetdir)/algebra/exposed.$(FASLEXT) \
		$(axiom_src_docdir)/msgs/s2-us.msgs \
	        ../algebra/warm.data
	@ echo 5 invoking make in `pwd` with parms:
	@rm -f makeint.lisp
	$(mkinstalldirs) $(axiom_target_datadir)/msgs
	$(INSTALL_DATA) $(axiom_src_docdir)/msgs/s2-us.msgs \
		 $(axiom_target_datadir)/msgs
	@ echo '(|importModule| "sys-driver")' >> makeint.lisp
	@ echo '(|importModule| "vmlisp")' >> makeint.lisp
	@ echo '(|importModule| "hash")' >> makeint.lisp
	@ echo '(gbc t)' >> makeint.lisp
	@ echo '(|importModule| "nocompil")' >> makeint.lisp
	@ echo '(|importModule| "bookvol5")' >> makeint.lisp
	@ echo '(|importModule| "util")' >> makeint.lisp
	@ echo '(in-package "BOOT")' >> makeint.lisp
	@ touch ${TIMESTAMP}
	@ echo '${YEARWEEK}' >> makeint.lisp
	@ echo '(boot::build-interpsys (append (quote ($(interpsys_modules))) (quote ($(AS_modules))) (quote ($(IN_modules))))  (quote ($(patsubst %, "%", ${TRANOBJS}))) (quote ($(patsubst %, "%", ${NAGBROBJS}))) (quote ($(patsubst %, "%", ${ASAUTO}))))' >> makeint.lisp
	@ echo '(boot::set-restart-hook)' >> makeint.lisp
	@ echo '(in-package "BOOT")' >> makeint.lisp
	@ echo '(load "../algebra/warm.data")' >> makeint.lisp
	@ echo '(boot::|clearClams|)' >> makeint.lisp
	@ echo '(load "obey")' >> makeint.lisp
	@ echo '#+:akcl (setq compiler::*suppress-compiler-notes* t)' >> makeint.lisp
	@ echo '#+:akcl (si::gbc-time 0)' >> makeint.lisp
	@ echo '(gbc t)' >> makeint.lisp

${SAVESYS}: makeint.lisp
	$(LOADSYS) -- --system="$(AXIOM)/" \
		--sysalg="$(axiom_src_datadir)/algebra/" \
		--make --output=$@ --main="BOOT::RESTART" \
		--load-directory=. makeint.lisp
	@ echo 6 ${SAVESYS} created
	$(mkinstalldirs) $(axiom_target_bindir)
@

\section{Building SAVESYS and AXIOMSYS}

We want to cache database data in the final image, so we dump it only
after databases are build.
Note that having dependency on databases is not enough, since databases
are re-generated after leaving \File{interp/} directory.

<<axiomsys>>=
.PHONY: all-axiomsys

all-axiomsys: ${AXIOMSYS}

${AXIOMSYS}: makeint.lisp
	$(LOADSYS) -- \
		--system="$(AXIOM)/" \
		--sysalg="$(axiom_targetdir)/algebra/" \
		--make --output=$@ --main="BOOT::RESTART" \
		--load-directory=. makeint.lisp
	@ echo 6a ${AXIOMSYS} created
@

\section{The Interpreter files}

\subsection{DVI files from pmaphlet files}

<<DVI from pamphlet>>=
$(axiom_build_texdir)/diagrams.tex: $(axiom_src_docdir)/diagrams.tex
	$(INSTALL_DATA) $< $@
@

\subsection{c-doc.boot \cite{60}}

<<c-doc.clisp>>=
c-doc.clisp: c-doc.boot
	@ echo 219 making $@ from $<
	@ echo '(old-boot::boot "c-doc.boot")' | ${DEPSYS} 
@


\subsection{clammed.boot \cite{62}}

<<clammed.clisp>>=
clammed.clisp: clammed.boot
	@ echo 226 making $@ from $<
	@ echo '(old-boot::boot "clammed.boot")' | ${DEPSYS} 
@

\subsection{compiler.boot \cite{64}}

<<compiler.clisp>>=
compiler.clisp: compiler.boot
	@ echo 233 making $@ from $<
	@ echo '(old-boot::boot "compiler.boot")' | ${DEPSYS}
@

\subsection{i-analy.boot}

<<i-analy.clisp>>=
i-analy.clisp: i-analy.boot
	@ echo 280 making $@ from $<
	@ echo '(old-boot::boot "i-analy.boot")' | ${DEPSYS}
@

\subsection{i-code.boot}

<<i-code.clisp>>=
i-code.clisp: i-code.boot
	@ echo 283 making $@ from $<
	@ echo '(old-boot::boot "i-code.boot")' | ${DEPSYS}
@

\subsection{i-coerce.boot}

<<i-coerce.clisp>>=
i-coerce.clisp: i-coerce.boot
	@ echo 286 making $@ from $<
	@ echo '(old-boot::boot "i-coerce.boot")' | ${DEPSYS}
@

\subsection{i-coerfn.boot}

<<i-coerfn.clisp>>=
i-coerfn.clisp: i-coerfn.boot
	@ echo 289 making $@ from $<
	@ echo '(old-boot::boot "i-coerfn.boot")' | ${DEPSYS}
@

\subsection{i-eval.boot}

<<i-eval.clisp>>=
i-eval.clisp: i-eval.boot
	@ echo 292 making $@ from $<
	@ echo '(old-boot::boot "i-eval.boot")' | ${DEPSYS}
@

\subsection{i-funsel.boot}

<<i-funsel.clisp>>=
i-funsel.clisp: i-funsel.boot
	@ echo 295 making $@ from $<
	@ echo '(old-boot::boot "i-funsel.boot")' | ${DEPSYS}
@

\subsection{bookvol5.lsp}


<<bookvol5.lisp>>=
bookvol5.lisp: $(srcdir)/bookvol5.pamphlet
	@ echo 298 making $@ from $<
	$(axiom_build_document) --tangle=Interpreter --output=$@ $<
@

\subsection{i-intern.boot}

<<i-intern.clisp>>=
i-intern.clisp: i-intern.boot
	@ echo 301 making $@ from $<
	@ echo '(old-boot::boot "i-intern.boot")' | ${DEPSYS}
@

\subsection{i-map.boot}

<<i-map.clisp>>=
i-map.clisp: i-map.boot
	@ echo 304 making $@ from $<
	@ echo '(old-boot::boot "i-map.boot")' | ${DEPSYS} 
@

\subsection{i-resolv.boot}

<<i-resolv.clisp>>=
i-resolv.clisp: i-resolv.boot
	@ echo 310 making $@ from $<
	@ echo '(old-boot::boot "i-resolv.boot")' | ${DEPSYS}
@

\subsection{i-spec1.boot}

<<i-spec1.clisp>>=
i-spec1.clisp: i-spec1.boot
	@ echo 313 making $@ from $<
	@ echo '(old-boot::boot "i-spec1.boot")' | ${DEPSYS}
@

\subsection{i-spec2.boot}

<<i-spec2.clisp>>=
i-spec2.clisp: i-spec2.boot
	@ echo 316 making $@ from i-spec2.boot
	@ echo '(old-boot::boot "i-spec2.boot")' | ${DEPSYS} 
@

\subsection{i-syscmd.boot}

<<i-syscmd.clisp>>=
i-syscmd.clisp: i-syscmd.boot
	@ echo 319 making $@ from $<
	@ echo '(old-boot::boot "i-syscmd.boot")' | ${DEPSYS}
@

\subsection{i-toplev.boot}

<<i-toplev.clisp>>=
i-toplev.clisp: i-toplev.boot
	@ echo 322 making $@ from $<
	@ echo '(old-boot::boot "i-toplev.boot")' | ${DEPSYS}
@

\subsection{i-util.boot}

<<i-util.clisp>>=
i-util.clisp: i-util.boot
	@ echo 325 making $@ from $<
	@ echo '(old-boot::boot "i-util.boot")' | ${DEPSYS}
@

\subsection{nruncomp.boot}

<<nruncomp.clisp>>=
nruncomp.clisp: nruncomp.boot
	@ echo 353 making $@ from $<
	@ echo '(old-boot::boot "nruncomp.boot")' | ${DEPSYS}
@

\subsection{nrunfast.boot}

<<nrunfast.clisp>>=
nrunfast.clisp: nrunfast.boot
	@ echo 356 making $@ from $<
	@ echo '(old-boot::boot "nrunfast.boot")' | ${DEPSYS}
@

\subsection{nrungo.boot}

<<nrungo.clisp>>=
nrungo.clisp: nrungo.boot
	@ echo 359 making $@ from $<
	@ echo '(old-boot::boot "nrungo.boot")' | ${DEPSYS}
@

\subsection{nruntime.boot}

<<nruntime.clisp>>=
nruntime.clisp: nruntime.boot
	@ echo 362 making $@ from $<
	@ echo '(old-boot::boot "nruntime.boot")' | ${DEPSYS}
@

\subsection{nrunopt.boot}

<<nrunopt.clisp>>=
nrunopt.clisp: nrunopt.boot
	@ echo 365 making $@ from $<
	@ echo '(old-boot::boot "nrunopt.boot")' | ${DEPSYS}
@

\subsection{postpar.boot}

\begin{verbatim}
NOTE: One thing need to be done to create an DEPSYS by hand:
  parse and postpar must be loaded along with the depsys files
     into a bare lisp system.
if these two things are done then a DEPSYS image can be bootstrapped
to a new platform.
\end{verbatim}

\subsection{setvart.boot}

<<setvart.clisp>>=
setvart.clisp: setvart.boot
	@ echo 398 making $@ from $<
	@ echo '(old-boot::boot "setvart.boot")' | ${DEPSYS}
@

\subsection{br-con.boot}

<<br-con.clisp>>=
br-con.clisp: br-con.boot
	@ echo 467 making $@ from $<
	@ echo '(old-boot::boot "br-con.boot")' | ${DEPSYS} 
@

\subsection{br-search.boot}

<<br-search.clisp>>=
br-search.clisp: br-search.boot
	@ echo 471 making $@ from $<
	@ echo '(old-boot::boot "br-search.boot")' | ${DEPSYS} 
@

\subsection{br-op1.boot}

<<br-op1.clisp>>=
br-op1.clisp: br-op1.boot
	@ echo 475 making $@ from $<
	@ echo '(old-boot::boot "br-op1.boot")' | ${DEPSYS}
@

\subsection{br-op2.boot}

<<br-op2.clisp>>=
br-op2.clisp: br-op2.boot
	@ echo 479 making $@ from $<
	@ echo '(old-boot::boot "br-op2.boot")' | ${DEPSYS} 
@

\subsection{br-data.boot}

<<br-data.clisp>>=
br-data.clisp: br-data.boot
	@ echo 483 making $@ from $<
	@ echo '(old-boot::boot "br-data.boot")' | ${DEPSYS} 
@

\subsection{br-util.boot}

<<br-util.clisp>>=
br-util.clisp: br-util.boot
	@ echo 487 making $@ from $<
	@ echo '(old-boot::boot "br-util.boot")' | ${DEPSYS}
@

\subsection{br-saturn.boot}

<<br-saturn.clisp>>=
br-saturn.clisp: br-saturn.boot
	@ echo 491 making $@ from $<
	@ echo '(old-boot::boot "br-saturn.boot")' | ${DEPSYS}
@

\section{The databases}

\begin{verbatim}
 autoload dependencies

 if you are adding a file which is to be autoloaded the following step
 information is useful:
  there are 2 cases:
   1) adding files to currently autoloaded parts
      (as of 2/92: browser old parser and old compiler)
   2) adding new files
   case 1:
     a) you have to add the file to the list of files currently there
        (e.g. see BROBJS above)
     b) add an autolaod rule
        (e.g. ${AUTO}/parsing.$(FASLEXT): parsing.$(FASLEXT))
     c) edit util.lisp to add the 'external' function (those that
        should trigger the autoload
   case 2:
     build-interpsys (in util.lisp) needs an extra argument for the
     new autoload things and several functions in util.lisp need hacking.

 database.date is a marker file used to force a rebuild of interpsys if the
 database is rebuilt (src/algebra/Makefile).

\end{verbatim}
<<databases>>=
exposed.lsp: $(axiom_src_algdir)/exposed.lsp.pamphlet
	@ echo 615 making exposed.lsp from $(axiom_src_algdir)/exposed.lsp.pamphlet
	$(axiom_build_document) --tangle --output=$@ $<

$(axiom_targetdir)/algebra/exposed.$(FASLEXT) : exposed.lsp ${LISPSYS}
	@ echo 616 making $@ from exposed.lsp
	$(mkinstalldirs) $(axiom_targetdir)/algebra
	@ echo '(progn  (compile-file "exposed.lsp" :output-file "$(axiom_targetdir)/algebra/exposed.$(FASLEXT)"))' | ${LISPSYS} 

database.date:
	@ echo 617 the database was updated...remaking interpsys
	@ touch database.date

@

\section{The Makefile}
<<*>>=

subdir = src/interp/

<<environment>>

.SUFFIXES:
.SUFFIXES: .boot .clisp .lisp .pamphlet

.PHONY: all all-ax all-depsys all-interpsys all-axiomsys

all: all-ax

all-ax: stamp
	@echo finished $(srcdir)

stamp: $(AUTO) remove-stamp build-images
	$(STAMP) stamp

.PHONY: remove-stamp
remove-stamp:
	-rm -f stamp

.PHONY: build-images
build-images: remove-stamp all-interpsys

all-interpsys: all-depsys 
	$(mkinstalldirs) $(AUTO)
	$(MAKE) $(SAVESYS)

all-axiomsys: all-depsys 
	$(MAKE) $(AXIOMSYS)

all-depsys: $(DEPSYS)

<<extract source codes>>

mostlyclean-local:
	@rm -f *.fn *.data *.$(FASLEXT) *.lib

clean-local: mostlyclean-local
	@rm -f *.clisp *.lsp

distclean-local: clean-local

<<savesys>>
<<depsys>>
<<axiomsys>>
<<databases>>

## Copy FASLs that are autoloaded to the autoload directory.
.PREVIOUS: $(AUTO)/%.$(FASLEXT)

$(AUTO)/%.$(FASLEXT): %.$(FASLEXT)
	$(INSTALL) $< $@

## Translation to Fortran
fortcall.$(FASLEXT): fortcall.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

## HyperDoc
bc-solve.$(FASLEXT): bc-solve.boot bc-matrix.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

bc-matrix.$(FASLEXT): bc-matrix.boot bc-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

bc-misc.$(FASLEXT): bc-misc.boot bc-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

bc-util.$(FASLEXT): bc-util.boot ht-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

ht-root.$(FASLEXT): ht-root.boot ht-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

htcheck.$(FASLEXT): htcheck.boot sys-driver.$(FASLEXT) macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

ht-util.$(FASLEXT): ht-util.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

htsetvar.$(FASLEXT): htsetvar.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

hypertex.$(FASLEXT): hypertex.boot boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

## OpenAxiom's interpreter.

profile.$(FASLEXT): profile.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

rulesets.$(FASLEXT): rulesets.boot vmlisp.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

i-output.$(FASLEXT): i-output.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

i-object.$(FASLEXT): i-object.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

format.$(FASLEXT): format.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

match.$(FASLEXT): match.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

record.$(FASLEXT): record.boot nlib.$(FASLEXT) pathname.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

## OpenAxiom's compiler

iterator.$(FASLEXT): iterator.boot g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

define.$(FASLEXT): define.boot cattable.$(FASLEXT) category.$(FASLEXT) \
			c-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

database.$(FASLEXT): database.boot clam.$(FASLEXT) nlib.$(FASLEXT) \
		cattable.$(FASLEXT) compat.$(FASLEXT) g-cndata.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

functor.$(FASLEXT): functor.boot category.$(FASLEXT) c-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

category.$(FASLEXT): category.boot g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

cattable.$(FASLEXT): cattable.boot simpbool.$(FASLEXT) g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

compat.$(FASLEXT): compat.boot pathname.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

simpbool.$(FASLEXT): simpbool.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

newfort.$(FASLEXT): newfort.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

## Interface with the Aldor compiler.
ax.$(FASLEXT): ax.boot as.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

as.$(FASLEXT): as.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

server.$(FASLEXT): server.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

##
## OpenAxiom's front-end consists of two parts:
##    (a) the interprerter's parser -- also referred to as new parser
##    (b) the compiler parser -- also referred to as parser
##
## The new parser component is always included in a running OpenAxiom
## image.  However the old parser component is so called `autoloaded'.
## While in theory that should work, in practice it turns out that 
## people tend to override functions in the autoload part, correcting
## bugs only there.  The consequence is that the same function will
## bahave very differently based on the history of the seesion.  Ideal
## recipe for creating heisenbugs.
##

## The old parser component roughtly is:
##

parse.$(FASLEXT): parse.boot postpar.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

postpar.$(FASLEXT): postpar.boot postprop.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

postprop.$(FASLEXT): postprop.lisp macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

bootlex.$(FASLEXT): bootlex.lisp preparse.$(FASLEXT) def.$(FASLEXT) \
			nlib.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

newaux.$(FASLEXT): newaux.lisp macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

def.$(FASLEXT): def.lisp macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

comp.$(FASLEXT): comp.lisp macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

preparse.$(FASLEXT): preparse.lisp fnewmeta.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

fnewmeta.$(FASLEXT): fnewmeta.lisp parsing.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

parsing.$(FASLEXT): parsing.lisp metalex.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

metalex.$(FASLEXT): metalex.lisp macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

nlib.$(FASLEXT): nlib.lisp macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

macros.$(FASLEXT): macros.lisp sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

## The new parser component roughtly is:
##   astr.boot dq.boot incl.boot pile.boot ptrees.boot
##   posit.boot cparse.boot format.boot cstream.boot
##

cparse.$(FASLEXT): cparse.boot ptrees.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

ptrees.$(FASLEXT): ptrees.boot posit.$(FASLEXT) serror.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

pile.$(FASLEXT): pile.boot scan.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

scan.$(FASLEXT): scan.boot incl.$(FASLEXT) bits.$(FASLEXT) dq.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

incl.$(FASLEXT): incl.boot cstream.$(FASLEXT) cformat.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

cformat.$(FASLEXT): cformat.boot unlisp.$(FASLEXT) posit.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

serror.$(FASLEXT): serror.boot posit.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

unlisp.$(FASLEXT): unlisp.lisp sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

posit.$(FASLEXT): posit.boot sys-macros.$(FASLEXT) astr.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

cstream.$(FASLEXT): cstream.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

astr.$(FASLEXT): astr.boot boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

bits.$(FASLEXT): bits.lisp boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

dq.$(FASLEXT): dq.boot boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

## General support and utilities.

modemap.$(FASLEXT): modemap.boot c-util.$(FASLEXT) info.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

info.$(FASLEXT): info.boot g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

slam.$(FASLEXT): slam.boot g-timer.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

clam.$(FASLEXT): clam.boot g-timer.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

g-opt.$(FASLEXT): g-opt.boot def.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

g-timer.$(FASLEXT): g-timer.boot macros.$(FASLEXT) g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

msgdb.$(FASLEXT): msgdb.boot g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

g-boot.$(FASLEXT): g-boot.boot def.$(FASLEXT) g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

g-error.$(FASLEXT): g-error.boot diagnostics.$(FASLEXT) g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

c-util.$(FASLEXT): c-util.boot g-util.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

pathname.$(FASLEXT): pathname.boot nlib.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

g-util.$(FASLEXT): g-util.boot macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

g-cndata.$(FASLEXT): g-cndata.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<

sys-macros.$(FASLEXT): sys-macros.lisp diagnostics.$(FASLEXT) \
			union.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

diagnostics.$(FASLEXT): diagnostics.boot sys-constants.$(FASLEXT) \
				sys-globals.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

sys-driver.$(FASLEXT): sys-driver.boot boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

sys-globals.$(FASLEXT): sys-globals.boot sys-constants.$(FASLEXT) \
				hash.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

sys-constants.$(FASLEXT): sys-constants.boot boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

hash.$(FASLEXT): hash.lisp vmlisp.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

union.$(FASLEXT): union.lisp vmlisp.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

ggreater.$(FASLEXT): ggreater.lisp vmlisp.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

vmlisp.$(FASLEXT): vmlisp.lisp boot-pkg.$(FASLEXT)
	$(BOOTSYS) -- --compile --output=$@ --load-directory=. $<

boot-pkg.$(FASLEXT): boot-pkg.lisp
	$(BOOTSYS) -- --compile --output=$@ $<

<<br-con.clisp>>

<<br-data.clisp>>

<<br-op1.clisp>>

<<br-op2.clisp>>

<<br-saturn.clisp>>

<<br-search.clisp>>

<<br-util.clisp>>

<<c-doc.clisp>>

<<clammed.clisp>>

<<compiler.clisp>>

<<i-analy.clisp>>

<<i-code.clisp>>

<<i-coerce.clisp>>

<<i-coerfn.clisp>>

<<i-eval.clisp>>

<<i-funsel.clisp>>

<<bookvol5.lisp>>

<<i-intern.clisp>>

<<i-map.clisp>>

<<i-resolv.clisp>>

<<i-spec1.clisp>>

<<i-spec2.clisp>>

<<i-syscmd.clisp>>

<<i-toplev.clisp>>

<<i-util.clisp>>

<<nruncomp.clisp>>

<<nrunfast.clisp>>

<<nrungo.clisp>>

<<nruntime.clisp>>

<<nrunopt.clisp>>

<<setvart.clisp>>

<<warm.data.stanza>>

buildom.$(FASLEXT): buildom.boot sys-macros.$(FASLEXT)
	$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<


<<DVI from pamphlet>>

@

\end{document}