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
|
%% Oh Emacs, this is a -*- Makefile -*-, so give me tabs.
\documentclass{article}
\usepackage{axiom}
\title{\$SPAD/src/lib Makefile}
\author{Timothy Daly \and Gabriel Dos~Reis}
\begin{document}
\maketitle
\begin{abstract}
This Makefile builds the \Tool{Axiom} C runtime system. This runtime
support consists of three main compoments: core, terminal I/O, and
graphics.
\end{abstract}
\eject
\tableofcontents
\eject
\section{Components}
\subsection{Core runtime}
The core C runtime system is required on all hosts. It is composed of
\begin{itemize}
\item \verb!iint bsdSignal()!
\item \verb!int addtopath(const char*)!
\item \verb!int directoryp(const char*)!
\item \verb!int make_path_from_file(const char*, const char*)!
\item \verb!int writeablep(const char*)!
\item \verb!int readablep(const char*)!
\item \verb!int findString(const char*, const char*)!
\item \verb!int copyEnvValue(const char*, char*)!
\end{itemize}
Those functions are implemented in \File{cfuns-c.c} and
\File{sockio-c.c}. For the most part,
they depend on [[<unistd.h>]], [[<sys/stat.h>]], and
[[<sys/socket.h>]]
<<environment>>=
core_sources = bsdsignal.c cfuns-c.c sockio-c.c
@
\subsection{Terminal I/O}
This component provides all the routines necessary to build
the \Tool{Superman} component.
<<environment>>=
terminal_io_sources = cursor.c edin.c fnct_key.c openpty.c prt.c wct.c
@
\subsection{Graphics}
HyperDoc and any other graphics capability.
<<environment>>=
graphics_sources = \
halloc.c \
hash.c \
pixmap.c \
spadcolors.c \
util.c \
XDither.c \
XShade.c \
XSpadFill.c
@
??? document each of those files.???
\section{environment}
The \Tool{Autoconf}-subst'd variable [[axiom_c_runtime]] is computed
at configure time, based on the characteristics of the host environment.
It is a list of the main components. It also contain [[core]]
<<environment>>=
libspad_la_sources = $(foreach comp, \
$(addsuffix _sources, @axiom_c_runtime@), \
$($(comp)))
libspad_la_SOURCES = $(addsuffix .pamphlet,$(libspad_la_sources))
other_sources = cfuns-c.c
other_SOURCES = $(addsuffix .pamphlet,$(other_sources))
unused_sources = emupty.c
libspad_la_objects = $(libspad_la_sources:.c=.lo)
other_objects = $(other_sources:.c=.$(OBJEXT))
pamphlets = Makefile.pamphlet $(libspad_la_SOURCES) $(other_SOURCES)
@
\section{Files}
\subsection{C from pamphlet}
<<C from pamphlet>>=
.PRECIOUS: %.c
%.c: $(srcdir)/%.c.pamphlet
$(axiom_build_document) --tangle --output=$@ $<
@
\subsection{object from C}
<<object from C>>=
.PRECIOUS: %.$(OBJEXT) %.lo
%.lo: %.c $(axiom_c_macros_h)
$(COMPILE) -o $@ $(CCF) $(axiom_includes) $(AXIOM_X11_CFLAGS) $<
@
\subsection{cfuns-c.c \cite{2}}
The cfuns-c file contains socket primitives used by Axiom.
They must be linked into and visible from the inferior lisp.
In GCL this link happens thru setting a shell variable called
{\bf EXTRAS} in the {\bf h/386-linux.defs} file. This file
gets included as part of the final system build of GCL.
\subsection{hash.c \cite{6}}
This a a string-based hash table that is used both in the graph
and hyper functions. It is included here because we need it built
earlier so the graph and hyper routines can refer to it.
\subsection{sockio-c.c \cite{10}}
The sockio-c file contains socket primitives used by Axiom.
They must be linked into and visible from the inferior lisp.
In GCL this link happens thru setting a shell variable called
{\bf EXTRAS} in the {\bf h/386-linux.defs} file. This file
gets included as part of the final system build of GCL.
\section{The cleanup stanza}
<<cleanup>>=
# This is a support library, so it does not change often and
# we don't need to remove the produced objects in mostlyclean.
# The remoal is done by clean.
mostlyclean-local:
@rm -f *.lo *.$(OBJEXT)
clean-local: mostlyclean-local
@$(LIBTOOL) --mode=clean $(axiom_target_libdir)/libspad.la
@rm -f $(other_objects)
@rm -f $(libspad_la_sources) $(other_sources)
@rm -fr .libs _libs
@rm -f stamp
distclean-local: clean-local
@
<<*>>=
<<environment>>
subdir = src/lib/
.PHONY: all all-lib
.SUFFIXES:
.SUFFIXES: .o .lo .obj .c .h
all: all-ax
all-ax all-lib: stamp
stamp: $(axiom_target_libdir)/libspad.la
rm -f stamp
$(STAMP) stamp
$(axiom_target_libdir)/libspad.la: $(libspad_la_objects)
$(mkinstalldirs) $(axiom_target_libdir)
$(LIBTOOL) --mode=link $(CC) -o $@ $(libspad_la_objects) \
-rpath $(libdir)/axiom/target/$(target)/lib
<<C from pamphlet>>
<<object from C>>
<<cleanup>>
@
\eject
\begin{thebibliography}{99}
\bibitem{1} {\$SPAD/src/lib/bsdssignal.c.pamphlet}
\bibitem{2} {\$SPAD/src/lib/cfuns-c.c.pamphlet}
\bibitem{3} {\$SPAD/src/lib/cursor.c.pamphlet}
\bibitem{4} {\$SPAD/src/lib/edin.c.pamphlet}
\bibitem{5} {\$SPAD/src/lib/fnct\_key.c.pamphlet}
\bibitem{6} {\$SPAD/src/lib/halloc.c.pamphlet}
\bibitem{7} {\$SPAD/src/lib/openpty.c.pamphlet}
\bibitem{8} {\$SPAD/src/lib/pixmap.c.pamphlet}
\bibitem{9} {\$SPAD/src/lib/prt.c.pamphlet}
\bibitem{10} {\$SPAD/src/lib/sockio-c.c.pamphlet}
\bibitem{11} {\$SPAD/src/lib/spadcolors.c.pamphlet}
\bibitem{12} {\$SPAD/src/lib/util.c.pamphlet}
\bibitem{13} {\$SPAD/src/lib/wct.c.pamphlet}
\bibitem{14} {\$SPAD/src/lib/XDither.c.pamphlet}
\bibitem{15} {\$SPAD/src/lib/XShade.c.pamphlet}
\bibitem{16} {\$SPAD/src/lib/XSpadFill.c.pamphlet}
\end{thebibliography}
\end{document}
|