-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile.in
302 lines (257 loc) · 9.92 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
## ----------------------------------------
## -- Old-style Axiom makefile variables --
## ----------------------------------------
COMMAND_DIR=$(DESTDIR)$(libdir)/fricas/target/$(target)/bin
COMMAND=$(COMMAND_DIR)/fricas
subdir =
SUBDIRS = src
build_srcdir = $(builddir)/src
FRICAS_SRC_TARGETS = all-algebra all-asq all-axiomsys all-book all-boot \
all-clef all-doc all-graph all-hyper all-input all-interpsys \
all-lib all-lisp all-sman all-src
BUILD_DATE:=`date`
.PHONY: all install $(FRICAS_SRC_TARGETS)
all: all-ax all-contrib
# If there is a directory "${PREGENERATED}/target", we can simply copy
# its contents to ${fricas_targetdir}.
# The pregenerated lisp files are under ${PREGENERATED}/src/algebra.
# The .daase files are are under ${PREGENERATED}/target/algebra.
# For more details see the "dist" target below.
pre-gen: stamp-rootdirs
echo "PREGENERATED=[${PREGENERATED}]"
if test -z "${PREGENERATED}"; then \
echo "Not using pre-generated data."; \
elif test ! -d "${PREGENERATED}"; then \
echo "PREGENERATED directory does not exist."; \
exit 1; \
elif echo "${PREGENERATED}"|grep ^/ >/dev/null; then\
if test -d ${PREGENERATED}/target; then \
cp -r ${PREGENERATED}/target/* ${fricas_targetdir}; \
fi && \
if test -d ${PREGENERATED}/src; then \
cp -r ${PREGENERATED}/src/* src; \
fi && \
${STAMP} $@; \
else \
echo "PREGENERATED must contain an absolute path."; \
exit 1; \
fi
# Generate the efricas script.
all-contrib: all-src
cd contrib/emacs && ${MAKE}
all-ax: all-src
@echo finished system build on `date` | tee >lastBuildDate
all-src: stamp-rootdirs @fricas_all_prerequisites@
all-input: all-src
viewports:
cd src/doc; ${MAKE} MAYBE_VIEWPORTS=viewports
$(FRICAS_SRC_TARGETS): pre-gen
cd $(build_srcdir) && $(MAKE) BUILD_DATE="${BUILD_DATE}" $@
stamp-rootdirs: $(axiom_build_document)
mkdir -p $(fricas_build_bindir)
mkdir -p $(fricas_build_libdir)
mkdir -p $(fricas_target_bindir)
mkdir -p $(fricas_target_libdir)
mkdir -p $(fricas_target_datadir)/spadhelp
mkdir -p $(fricas_target_datadir)/msgs
mkdir -p $(fricas_target_texdir)
mkdir -p $(fricas_targetdir)/algebra/
mkdir -p $(fricas_targetdir)/autoload
mkdir -p $(fricas_targetdir)/input
mkdir -p $(fricas_target_srcdir)/algebra
mkdir -p ${TMP}
$(STAMP) stamp-rootdirs
.PHONY: all-noweb
all-noweb: stamp-noweb
stamp-noweb:
@echo Making in noweb
([ -d noweb ] || \
( mkdir noweb && cd noweb && \
$(TAR) -zx -f "@noweb_tarball@" ) ) && \
( cd noweb/src && \
cat Makefile \
| sed -e "s|^BIN=.*|BIN=$(fricas_build_bindir)|" \
-e "s|^LIB=.*|LIB=$(fricas_build_libdir)|" \
-e "s|^MAN=.*|MAN=$(fricas_build_mandir)|" \
-e "s|^TEXINPUTS=.*|TEXINPUTS=$(fricas_target_texdir)|" \
-e 's/ make / $$\(MAKE\) /' \
-e "s,c/nt,c/nt$(EXEEXT)," \
-e "s,c/markup,c/markup$(EXEEXT)," \
-e "s,c/mnt,c/mnt$(EXEEXT)," \
-e "s,c/finduses,c/finduses$(EXEEXT)," \
-e "s,^CFLAGS=.*,CFLAGS=-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=1," \
> Makefile.tmp && mv Makefile.tmp Makefile && \
./awkname $(AWK) && $(MAKE) -j 1 all install )
$(STAMP) stamp-noweb
book:
@ echo 79 building the book as $(fricas_target_docdir)/book.dvi
mkdir -p ${TMP}
mkdir -p $(fricas_target_docdir)/ps
$(INSTALL) $(fricas_src_srcdir)/doc/book.pamphlet $(fricas_target_docdir)
cp $(fricas_src_srcdir)/doc/ps/* $(fricas_target_docdir)/ps
(cd $(fricas_target_docdir) ; \
latex book.pamphlet --interaction nonstopmode && \
latex book.pamphlet --interaction nonstopmode ; \
rm book.pamphlet ; \
rm book.toc ; \
rm book.log ; \
rm book.aux )
@ echo 80 The book is at $(fricas_target_docdir)/book.dvi
reltarget = target/$(target)
install: install-src install-contrib
install-src:
@echo Installing FriCAS in $(prefix)
rm -rf '$(DESTDIR)$(libdir)/fricas'
$(mkinstalldirs) '$(DESTDIR)$(libdir)/fricas'
$(mkinstalldirs) '$(DESTDIR)$(libdir)/fricas/$(reltarget)/lib'
for A in algebra autoload doc share src lib/graph ; do \
for B in `find $(reltarget)/$$A -type d -print` ; do \
$(mkinstalldirs) '$(DESTDIR)$(libdir)'/fricas/$$B \
|| exit 1 ; \
done ; \
for B in `find $(reltarget)/$$A -type f -print` ; do \
$(INSTALL_DATA) $$B '$(DESTDIR)$(libdir)'/fricas/$$B \
|| exit 1 ; \
done ; \
done
$(mkinstalldirs) '$(DESTDIR)$(libdir)/fricas/$(reltarget)/bin'
for A in bin/AXIOMsys bin/asq bin/clef bin/htadd bin/hypertex \
bin/sman bin/viewAlone lib/ex2ht lib/hthits lib/session \
lib/spadbuf lib/spadclient lib/view2D lib/view3D \
lib/viewman ; do \
if [ -f $(reltarget)/$$A$(EXEEXT) ] ; then \
$(INSTALL_PROGRAM) $(reltarget)/$$A$(EXEEXT) \
'$(DESTDIR)$(libdir)'/fricas/$(reltarget)/$$A$(EXEEXT) \
|| exit 1 ; \
fi ; \
done
if [ -f $(reltarget)/lib/libspad.so ] ; then \
$(INSTALL_PROGRAM) $(reltarget)/lib/libspad.so \
'$(DESTDIR)$(libdir)'/fricas/$(reltarget)/lib/libspad.so \
|| exit 1 ; \
fi
if [ -f $(reltarget)/lib/gmp_wrap.so ] ; then \
$(INSTALL_PROGRAM) $(reltarget)/lib/gmp_wrap.so \
'$(DESTDIR)$(libdir)'/fricas/$(reltarget)/lib/gmp_wrap.so \
|| exit 1 ; \
fi
for A in SPADEDIT htsearch presea ; do \
if [ -f $(reltarget)/lib/$$A ] ; then \
$(INSTALL_SCRIPT) $(reltarget)/lib/$$A \
'$(DESTDIR)$(libdir)'/fricas/$(reltarget)/lib/$$A \
|| exit 1 ; \
fi ; \
done
for A in command.list copyright summary ; do \
$(INSTALL_DATA) $(reltarget)/lib/$$A \
'$(DESTDIR)$(libdir)'/fricas/$(reltarget)/lib/$$A \
|| exit 1 ; \
done
echo '#!/bin/sh -' > '${COMMAND}'.tmp
echo exec_prefix='"$${FRICAS_PREFIX:-$(exec_prefix)}"' >> '${COMMAND}'.tmp
echo AXIOM='"$${exec_prefix}/lib/fricas/target/$(target)"' >> '${COMMAND}'.tmp
echo export AXIOM >> '${COMMAND}'.tmp
cat $(fricas_src_srcdir)/etc/fricas >> '${COMMAND}'.tmp
$(INSTALL_SCRIPT) '${COMMAND}'.tmp '${COMMAND}'
-rm '${COMMAND}'.tmp
rm -f '$(DESTDIR)$(bindir)'/fricas
$(mkinstalldirs) '$(DESTDIR)$(bindir)'
$(INSTALL_SCRIPT) '$(COMMAND)' '$(DESTDIR)$(bindir)/fricas'
if test x"@BUILD_ALDOR_INTERFACE@" = xyes ; then \
cd src/aldor && $(MAKE) install; \
fi
@echo 79 FriCAS installation finished.
install-contrib:
$(mkinstalldirs) '$(DESTDIR)$(bindir)'
$(mkinstalldirs) '$(DESTDIR)@emacsdatadir@'
cd contrib/emacs && $(MAKE) install;
@echo 79 FriCAS contrib installation finished.
mostlyclean-local: clean-distdir
@-rm -f lastBuildDate
clean-local: mostlyclean-local
-rm -f stamp-*
-cd contrib/emacs && ${MAKE} clean
-rm -rf $(fricas_targetdir)
-rm -rf build/$(target)
distclean-local: clean-local
@-rm -rf build
-rm -rf target
-cd contrib/emacs && ${MAKE} distclean
@-rm -f config.status config.log config_cl.out
@-rm -f Makefile
$(top_builddir)/config.status: $(top_srcdir)/configure
$(SHELL) ./config.status --recheck
$(RECURSIVE_TARGETS): stamp-rootdirs @fricas_all_prerequisites@
###################################################################
# "make dist" creates a distribution tarball with precomputed machine
# independent files like *.lsp, *.daase, *.ht, *.pht, *.VIEW/*, *.help.
# Running "make dist" must be called *after* a full (out-of-source)
# build. The "out-of-source" build is necessary, since we "cp -r" from
# the fricas checkout directory.
#
# The tarball data will be temporarily copied into a local directory
# then tar'ed and bzipped.
#
# We do not make this target dependent on "all", though, because it is
# currently not possible to restart the build from an interrupted
# build process.
#
# Finding the noweb tarball. If --with-noweb-tarball=... was given at
# configure time, the variable @noweb_tarball@ will be substituted and
# we can safely include this tarball. Otherwise, we check for
# existence of zips/noweb-2.10a.tgz. If this is not there, then we
# require the variable NOWEB to be set and pointing to the noweb
# tarball.
NOWEB="@noweb_tarball@"
distdir=${PACKAGE_TARNAME}-${PACKAGE_VERSION}
disttargetdir=${distdir}/pre-generated/target
distsrcdir=${distdir}/pre-generated/src
DIST_TARBALL=${distdir}.tar.bz2
out-of-source-check:
test "${abs_builddir}" != ${abs_top_srcdir}
dist-noweb:
NOWEB="${NOWEB}"; \
test -n "$$NOWEB" || NOWEB="${srcdir}/zips/noweb-2.10a.tgz"; \
if ! test -r "$$NOWEB"; then \
echo "missing NOWEB tarball"; \
echo "use 'make dist NOWEB=/path/to/noweb.tar.bz2'"; \
exit 1; \
else \
mkdir -p ${distdir}/zips; \
cp "$$NOWEB" ${distdir}/zips; \
fi;
# copy databases and algebra bootstrap files
dbs=browse.daase category.daase compress.daase interp.daase operation.daase\
libdb.text comdb.text USERS.DAASE DEPENDENTS.DAASE
generated_dbs=${addprefix ${disttargetdir}/algebra/, ${dbs}}
${generated_dbs}: ${disttargetdir}/%: ${fricas_targetdir}/%
test -d ${disttargetdir}/algebra || mkdir -p ${disttargetdir}/algebra
cp -r $< $@
dist-lisp: ${generated_dbs}
(cd src/algebra; ls -d *.NRLIB | sed 's,\.NRLIB$$,,') > nrlibs
mkdir -p ${distsrcdir}/algebra
for A in $$(cat nrlibs); do \
cp src/algebra/$${A}.NRLIB/$${A}.lsp ${distsrcdir}/algebra/$${A}.lsp;\
done
# We assume that the *.help files are available from a directory
# ${helpsrcdir}. It is an error if this variable is not set.
help-sanity-check:
test -f ${helpsrcdir}/Integer.help \
|| (echo "helpfiles are missing"; \
echo "use 'make dist helpsrcdir=/path/to/spadhelp'"; \
exit 1)
# .help files that are generated during the documentation build under
# src/doc will be taken care of by the dist-doc target.
dist-help: help-sanity-check
mkdir -p ${disttargetdir}/share/spadhelp
cp ${helpsrcdir}/* ${disttargetdir}/share/spadhelp
# Copy generated .ht and .pht and *.VIEW/* files to distribution directory.
dist-doc:
cd src/doc; ${MAKE} disttargetdir="../../${disttargetdir}" dist
${DIST_TARBALL}: out-of-source-check lastBuildDate dist-noweb dist-help dist-lisp dist-doc
cp -r ${abs_top_srcdir}/* ${distdir}
find ${distdir} -type d -name .svn -exec rm -rf {} \+
tar cjf $@ ${distdir}
dist: ${DIST_TARBALL}
clean-distdir:
-rm -rf ${distdir} ${DIST_TARBALL}