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
|
%% 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)))
other_SOURCES = cfuns-c.c
unused_SOURCES = emupty.c
libspad_la_objects = $(libspad_la_SOURCES:.c=.lo)
other_objects = $(other_SOURCES:.c=.$(OBJEXT))
pamphlets = Makefile.pamphlet
@
\section{Files}
\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
<<object from C>>
<<cleanup>>
@
\end{document}
|