forked from fricas/fricas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
261 lines (221 loc) · 8.88 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
## ----------------------------------------
## -- 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-etc all-fricassys 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; \
else \
if test -d ${PREGENERATED}/target; then \
cp -r ${PREGENERATED}/target/* ${fricas_targetdir}; \
fi && \
${STAMP} $@; \
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
check: all-src
cd src/input; ${MAKE} check
viewports:
cd src/doc; ${MAKE} MAYBE_VIEWPORTS=viewports
$(FRICAS_SRC_TARGETS): pre-gen
cd $(build_srcdir) && $(MAKE) BUILD_DATE="${BUILD_DATE}" $@
stamp-rootdirs:
${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)/input
${MKDIR_P} $(fricas_target_srcdir)/algebra
${MKDIR_P} ${TMP}
$(STAMP) stamp-rootdirs
reltarget = target/$(target)
fricas_lib = $(subst $(exec_prefix)/,,$(libdir))
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 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/FRICASsys 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
if test "$(fricas_lib)" != "$(libdir)" ; then echo \
FRICAS='"$${exec_prefix}/$(fricas_lib)/fricas/target/$(target)"' \
>> '${COMMAND}'.tmp ; \
else \
echo FRICAS='"$(libdir)/fricas/target/$(target)"' \
>> '${COMMAND}'.tmp ; \
fi
echo export FRICAS >> '${COMMAND}'.tmp
echo FRICAS_VERSION='"${PACKAGE_VERSION}"' >> '${COMMAND}'.tmp
echo FRICAS_LISP_FLAVOR='"${FRICAS_LISP_FLAVOR}"' >> '${COMMAND}'.tmp
echo FRICAS_LISP_VERSION='"${FRICAS_LISP_VERSION}"' >> '${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'
$(INSTALL_SCRIPT) '$(fricas_src_srcdir)/etc/fricas-readline' '$(DESTDIR)$(libdir)/fricas/$(reltarget)/bin/fricas-readline'
if test x"@BUILD_ALDOR_INTERFACE@" = xyes ; then \
cd src/aldor && $(MAKE) install; \
fi
@echo 79 FriCAS installation finished.
install-contrib: install-src
$(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
-rm -rf FriCAS.app FriCAS.dmg
-cd contrib/emacs && ${MAKE} distclean
-rm -f config/fricas_c_macros.h
-rm -rf autom4te.cache
@-rm -f config.status config.log config_cl.out tmp.ap tmp.as
$(abs_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.
#
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}
# 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-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}
dist-osx-dmg: out-of-source-check
-rm -rf FriCAS.app FriCAS.dmg
${MKDIR_P} FriCAS.app/Contents/{MacOS,Resources}
${MAKE} DESTDIR=./FriCAS.app/Contents/Resources install-src
sed -e 's|/usr/local|`dirname $$0`/..|' -i .bak FriCAS.app/Contents/Resources/usr/local/bin/fricas
cp $(fricas_top_srcdir)/contrib/macos/Info.plist ./FriCAS.app/Contents/
cp $(fricas_top_srcdir)/contrib/macos/appIcon.icns ./FriCAS.app/Contents/Resources/
cc -framework CoreFoundation $(fricas_top_srcdir)/contrib/macos/FriCAS.c -o ./FriCAS.app/Contents/MacOS/FriCAS
hdiutil create -srcfolder FriCAS.app FriCAS.dmg
clean-distdir:
-rm -rf ${distdir} ${DIST_TARBALL}