Issue kill(all) in rtest6b so that value assigned to d in a preceding test does not...
[maxima/cygwin.git] / src / Makefile.am
blob119486fc98ed938c6ed5e82668ef45fcb07433ca
1 ## Lisp normally uses ASDF for compiling big projects, an extensible make-like utility.
2 ## ASDF also allows to build maxima on systems that don't contain autotools.
3 ## It therefore is natural to use make only for initiating the build process
4 ## and to use the autotools for setting up all files, but to use the standard lisp
5 ## tools for the actual build.
6 ##
7 ## The ASDF equivalent of a makefile is named maxima.system.
8 ## For details about its syntax see
9 ## https://common-lisp.net/project/asdf/asdf/The-defsystem-form.html
11 include $(top_srcdir)/common.mk
13 if WIN32
14 bin_SCRIPTS = maxima-command.ico maxima.bat set_lang.vbs
15 else
16 bin_SCRIPTS = maxima rmaxima
17 endif
19 ## In instsrcdir, we install the lisp source files in src/ (including
20 ## the numerical subdirectories).
21 ## TODO: Should we also be installing the .system and .asd files here?
22 real_lisp_sources := $(shell echo $(srcdir)/*.lisp $(srcdir)/numerical/*.lisp $(srcdir)/numerical/slatec/*.lisp)
23 nobase_dist_instsrc_DATA = $(real_lisp_sources)
24 EXTRA_DIST = \
25   maxima.asd maxima.system \
26   numerical/slatec/fortran \
27   maxima-build.lisp maxima-command.ico set_lang.vbs \
28   lisp \
29   share-subdirs.lisp \
30   $(real_lisp_sources)
32 ## If we can, we use Automake's blah_SCRIPTS targets to install
33 ## stuff. When doing this, we have to populate EXTRA_SCRIPTS, so we
34 ## use += and initialise here.
35 EXTRA_SCRIPTS =
37 ## A debugging tool. If you're trying to understand the value of the
38 ## variable $(foo) when make runs, call "make echo_foo" and it will be
39 ## printed.
40 echo_%:
41         @echo "$(subst echo_,,$@)=$($(subst echo_,,$@))"
42         @echo "origin $(subst echo_,,$@) returns $(origin $(subst echo_,,$@))"
44 ## "all" depends on sharefiles.mk and whatever files we choose to
45 ## build. These are listed in BUILT_FILES, which is populated in the
46 ## implementation-dependent sections below.
48 ## The special treatment of share-subdirs.lisp is necessary due to the
49 ## following requirements:
50 ##  - We want to autogenerate this file so it changes if source files are
51 ##    added or deleted.
52 ##  - We want to ship the file with maxima.
53 ##  - And we don't want to tell the autotools that we autogenerate this
54 ##    file. Else "make distclean" would delete the file causing
55 ##    "make distcleancheck" to fail.
56 BUILT_FILES =
57 all-local: $(BUILT_FILES) share-subdirs_autogenerated.lisp
58         if test share-subdirs_autogenerated.lisp -nt share-subdirs.lisp; then cp share-subdirs_autogenerated.lisp share-subdirs.lisp; fi
59 DISTCLEAN_FILES=$(DISTCLEAN_EXTRA_SRC_FILES)
61 ## The "clean" rule always just deletes some files and they are
62 ## specified in the conditional sections by adding
63 ## implementation-specific targets to the list CLEAN_TARGETS.
64 CLEAN_TARGETS =
65 clean-local: $(CLEAN_TARGETS)
67 ## Tell make clean to delete all the <foo>-depends.mk files.
68 DEPENDS_FILES = \
69   clisp-depends.mk cmucl-depends.mk scl-depends.mk acl-depends.mk \
70   sbcl-depends.mk gcl-depends.mk openmcl-depends.mk ecl-depends.mk abcl-depends.mk
71 CLEANFILES = $(DEPENDS_FILES) tools/sys-proclaim.lisp
73 ## Similarly, we do something hacky with the install rule. Most of the
74 ## time, we can actually use Automake's tools for this, but for the
75 ## crazy "install another copy of the implementation" approach that we
76 ## use with SCL and CLISP, we need to do it by hand.
77 WEIRD_INSTALL_TARGETS =
78 WEIRD_UNINSTALL_TARGETS =
79 install-exec-local: $(WEIRD_INSTALL_TARGETS)
80 uninstall-hook: $(WEIRD_UNINSTALL_TARGETS)
82 ## A rule to build binary directories of the form binary-<lispname>
83 ## and subdirectories ./numerical and ./numerical/slatec
84 binary_subdirs = / /numerical /numerical/slatec
85 lisps_enabled = @lisps_enabled@
86 .PHONY: bd
87 bd:
88         for l in $(lisps_enabled); do for d in $(binary_subdirs); do $(MKDIR_P) binary-$$l$$d; done; done
90 ## Some hunks of lisp that get used by more than one implementation
91 LOADDEFSYSTEM = (load "$(top_srcdir)/lisp-utils/defsystem.lisp") (mk:add-registry-location "$(top_srcdir)/src/")
92 LOADMAKEDEPENDS = (load "$(top_srcdir)/lisp-utils/make-depends.lisp")
93 DS_OOS = funcall (intern (symbol-name :operate-on-system) :mk) "maxima"
94 if QUIET_BUILD
95 QUIET="(setf *compile-print* nil) (setq *compile-verbose* nil)"
96 DEFSYSTEMCOMPILE = ($(DS_OOS) :compile :verbose nil)
97 DEFSYSTEMLOAD = ($(DS_OOS) :load :verbose nil )
98 else
99 DEFSYSTEMCOMPILE = ($(DS_OOS) :compile :verbose t)
100 DEFSYSTEMLOAD = ($(DS_OOS) :load :verbose t)
101 endif
102 DEFSYSTEMTESTLOAD = ($(DS_OOS) :load :verbose t :test t)
104 ## A function that takes: $(1) = the target name or names (either a
105 ## string or a list of strings); $(2) = <foo>-depends.mk; $(3) = any
106 ## postscript that should be added. It outputs lisp code
107 ## that, when run, should create the dependency Makefile fragments.
108 MAKE_DEPENDS = '$(LOADDEFSYSTEM) $(LOADMAKEDEPENDS) (funcall (intern "CREATE-DEPENDENCY-FILE" :mk) $(1) "$(2)") $(3)'
110 ## CLISP #######################################################################
111 if CLISP
113 EXTRA_SCRIPTS += $(CLISP_MAXIMA)
115 if CLISP_EXEC
116 CLISP_MAXIMA = binary-clisp/maxima$(EXEEXT)
117 clisplib_SCRIPTS = $(CLISP_MAXIMA)
118 clispexeflag = :EXECUTABLE t
119 else
120 CLISP_MAXIMA = binary-clisp/maxima.mem
121 clisplib_DATA = $(CLISP_MAXIMA)
122 clispexeflag =
123 ## Rather crazily, we install an extra copy of clisp. Maybe there's a
124 ## more sensible approach than this?!
125 WEIRD_INSTALL_TARGETS += install-clisp-copy
126 WEIRD_UNINSTALL_TARGETS += uninstall-clisp-copy
127 install-clisp-copy:
128         $(mkinstalldirs) $(DESTDIR)$(clisplibdir)
129         $(INSTALL_PROGRAM) @CLISP_RUNTIME_PATH@ "$(DESTDIR)$(clisplibdir)/@CLISP_RUNTIME@"
130 uninstall-clisp-copy:
131         rm -f "$(DESTDIR)$(clisplibdir)/@CLISP_RUNTIME@"
132 endif
134 EXECUTECLISP = $(CLISP_NAME) -norc -q
135 clisplibdir = $(verpkglibdir)/binary-clisp
137 BUILT_FILES += $(CLISP_MAXIMA)
139 clisp: $(CLISP_MAXIMA)
141 $(CLISP_MAXIMA):
142         $(MAKE) bd
143         echo '$(QUIET) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE)' > clisp-command.lisp
144         $(EXECUTECLISP) clisp-command.lisp
145         echo '$(LOADDEFSYSTEM) $(DEFSYSTEMLOAD) (ext:saveinitmem "$@" :init-function (function cl-user::run) $(clispexeflag))' > clisp-command.lisp
146         $(EXECUTECLISP) clisp-command.lisp
147         rm clisp-command.lisp
149 clisp-depends.mk: maxima.system Makefile *.lisp
150         echo $(call MAKE_DEPENDS,"$(CLISP_MAXIMA)",clisp-depends.mk.tmp) > clisp-command2.lisp
151         $(EXECUTECLISP) clisp-command2.lisp
152         cat clisp-depends.mk.tmp | sed -e "s#\\\\#/#g" > clisp-depends.mk
154 -include clisp-depends.mk
155 endif CLISP
157 clean-clisp:
158         rm -rf binary-clisp clisp-command.lisp clisp-command2.lisp
159 CLEAN_TARGETS += clean-clisp
161 ## CMUCL #######################################################################
162 if CMUCL
164 EXTRA_SCRIPTS += $(CMU_MAXIMA) lisp
166 if CMUCL_EXEC
167 CMU_MAXIMA = binary-cmucl/maxima
168 cmucllib_SCRIPTS = $(CMU_MAXIMA)
169 cmuflag = :executable t :init-function '\''cl-user::run
170 else
171 CMU_MAXIMA = binary-cmucl/maxima.core
172 cmucllib_SCRIPTS = lisp
173 cmucllib_DATA = $(CMU_MAXIMA)
174 cmuflag =
175 endif
177 # Newer versions of CMUCL have an INTL package that is compatible with
178 # maxima's.  We just bind intl::*default-domain* here so that when we
179 # compile the files, we will get appropriate translations.  (Otherwise
180 # we have to put (intl:textdomain "maxima") in each Lisp file.
181 INITINTL = (when (find-package "INTL") (set (find-symbol "*DEFAULT-DOMAIN*" "INTL") "maxima"))
182 CMU_COMPILE = echo '$(QUIET) $(INITINTL) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE)' | $(EXECUTECMUCL)
183 CMU_WRITE = echo '$(LOADDEFSYSTEM) $(DEFSYSTEMLOAD) (ext:save-lisp "$(CMU_MAXIMA)" $(cmuflag))' | $(EXECUTECMUCL)
184 CMU_BUILD = ($(CMU_COMPILE)) && ($(CMU_WRITE))
185 EXECUTECMUCL = $(CMUCL_NAME) -noinit -batch
187 cmucllibdir = $(verpkglibdir)/binary-cmucl
188 BUILT_FILES += $(CMU_MAXIMA)
190 cmucl: $(CMU_MAXIMA)
192 $(CMU_MAXIMA):
193         $(MAKE) bd
194         $(CMU_BUILD)
196 cmucl-depends.mk: maxima.system Makefile *.lisp
197         echo $(call MAKE_DEPENDS,"$(CMU_MAXIMA)",cmucl-depends.mk.tmp) | $(EXECUTECMUCL)
198         cat cmucl-depends.mk.tmp | sed -e "s#\\\\#/#g" > cmucl-depends.mk
200 -include cmucl-depends.mk
201 endif
203 clean-cmucl:
204         rm -rf binary-cmucl
205 CLEAN_TARGETS += clean-cmucl
207 ## SCL #########################################################################
208 if SCL
210 scllibdir = $(verpkglibdir)/binary-scl
212 EXECUTESCL = $(SCL_NAME) -noinit -batch
213 BUILT_FILES += binary-scl/maxima.core
214 scllib_DATA = binary-scl/maxima.core
216 scl: binary-scl/maxima.core
218 binary-scl/maxima.core:
219         $(MAKE) bd
220         (echo '$(QUIET) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE)' | $(EXECUTESCL)) && \
221         (echo '$(LOADDEFSYSTEM) $(DEFSYSTEMLOAD) (ext:save-lisp "binary-scl/maxima.core")' | $(EXECUTESCL))
223 ## Just like with clisp, we install an extra copy of SCL. No, I don't
224 ## understand either. Also, I just read the SCL license agreement. Is
225 ## the user even allowed to do this?!
226 WEIRD_INSTALL_TARGETS += install-scl-copy
227 WEIRD_UNINSTALL_TARGETS += uninstall-scl-copy
228 install-scl-copy:
229         $(mkinstalldirs) $(DESTDIR)$(scllibdir)
230         $(INSTALL_PROGRAM) @SCL_RUNTIME_PATH@ "$(DESTDIR)$(scllibdir)/@SCL_RUNTIME@"
231 uninstall-scl-copy:
232         rm -f "$(DESTDIR)$(scllibdir)/@SCL_RUNTIME@"
234 scl-depends.mk: maxima.system Makefile *.lisp
235         echo $(call MAKE_DEPENDS,"binary-scl/maxima.core",scl-depends.mk.tmp) | $(EXECUTESCL)
236         cat scl-depends.mk.tmp | sed -e "s#\\\\#/#g" > scl-depends.mk
238 -include scl-depends.mk
240 endif
242 clean-scl:
243         rm -rf binary-scl
244 CLEAN_TARGETS += clean-scl
246 ## ACL #########################################################################
247 if ACL
249 acllibdir = $(verpkglibdir)/binary-acl
251 EXECUTEACL = $(ACL_NAME) -batch
252 BUILT_FILES += binary-acl/maxima.dxl
254 acllib_DATA = binary-acl/maxima.dxl
256 acl: binary-acl/maxima.dxl
258 binary-acl/maxima.dxl:
259         $(MAKE) bd
260         (echo '$(QUIET) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE)' | $(EXECUTEACL)) && \
261         (echo '$(LOADDEFSYSTEM) $(DEFSYSTEMLOAD) (excl:dumplisp :name "binary-acl/maxima.dxl")' | $(EXECUTEACL))
263 acl-depends.mk: maxima.system Makefile *.lisp
264         echo $(call MAKE_DEPENDS,"binary-acl/maxima.dxl",acl-depends.mk.tmp) | $(EXECUTEACL)
265         cat acl-depends.mk.tmp | sed -e "s#\\\\#/#g" > acl-depends.mk
267 -include acl-depends.mk
268 endif
270 clean-acl:
271         rm -rf binary-acl
272 CLEAN_TARGETS += clean-acl
274 ## SBCL ########################################################################
275 if SBCL
277 sbcllibdir = $(verpkglibdir)/binary-sbcl
279 EXTRA_SCRIPTS += $(SBCL_MAXIMA)
281 if SBCL_EXEC
282 SBCL_MAXIMA = binary-sbcl/maxima$(EXEEXT)
283 sbcllib_SCRIPTS = $(SBCL_MAXIMA)
284 sb_slad = (sb-ext:save-lisp-and-die "$@" :executable t)
285 else
286 SBCL_MAXIMA = binary-sbcl/maxima.core
287 sbcllib_DATA = $(SBCL_MAXIMA)
288 sb_slad = (sb-ext:save-lisp-and-die "$@")
289 endif
291 EXECUTESBCL = "$(SBCL_NAME)" --noinform --noprint $(SBCL_EXTRA_ARGS)
292 BUILT_FILES += $(SBCL_MAXIMA)
294 COMPILE_SBCL = echo '$(QUIET) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE) (sb-ext:quit)' | $(EXECUTESBCL) 
295 WRITE_SBCL = echo '$(LOADDEFSYSTEM) $(DEFSYSTEMLOAD) $(sb_slad) (sb-ext:quit)' | $(EXECUTESBCL)
296 BUILD_SBCL = $(COMPILE_SBCL) && $(WRITE_SBCL)
298 sbcl: $(SBCL_MAXIMA)
300 $(SBCL_MAXIMA):
301         $(MAKE) bd
302         $(BUILD_SBCL)
304 sbcl-depends.mk: maxima.system Makefile *.lisp
305         echo $(call MAKE_DEPENDS,"$(SBCL_MAXIMA)",sbcl-depends.mk.tmp,(sb-ext:quit)) | $(EXECUTESBCL)
306         cat sbcl-depends.mk.tmp | sed -e "s#\\\\#/#g" > sbcl-depends.mk
308 -include sbcl-depends.mk
310 endif
312 clean-sbcl:
313         rm -rf binary-sbcl numerical/binary-sbcl numerical/slatec/binary-sbcl
314 CLEAN_TARGETS += clean-sbcl
316 ## GCL #########################################################################
318 # For gcl we execute all commands from a temp file for the following motive:
320 # Some versions of GCL 2.6.12 don't automatically close at the end of a lisp
321 # file that contains the commands needed for compiling maxima and crash if
322 # they reach a (quit). In newer versions of 2.6.12 sending the (quit) from the
323 # command-line causes a crash.
324 # GCL's --eval switch adds an implicit (progn) that breaks defsystem's
325 # (mk:add-registry-location).
326 # And when executing commands from stdin some GCL versions get the
327 # end-of-file from the end of the command list too early and therefore close
328 # before the last command has been processed.
329 # Providing all commands from the command-line and ending them with a
330 # (quit) so it doesn't matter if lisp automatically closes at the last
331 # or the second last command seems to work, though.
333 if GCL
335 gcllibdir = $(verpkglibdir)/binary-gcl
337 EXTRA_SCRIPTS += binary-gcl/maxima
338 gcllib_SCRIPTS = binary-gcl/maxima
340 EXECUTEGCL = $(GCL_NAME)
341 BUILT_FILES += binary-gcl/maxima
343 sys_proc_dependency = tools/sys-proclaim.lisp
344 gcl_depends_targets = (list "binary-gcl/maxima" "tools/sys-proclaim.lisp")
346 tools/sys-proclaim.lisp: maxima.system *.lisp
347         rm -rf binary-gcl
348         touch sys-proclaim.lisp
349         $(MAKE) bd
350         echo '(load "generate-sys-proclaim.lisp") (system::quit)' | $(EXECUTEGCL)
351         rm -rf binary-gcl
352         mkdir -p tools
353         mv sys-proclaim.lisp tools
355 gcl: binary-gcl/maxima
357 binary-gcl/maxima: $(sys_proc_dependency) gcl-depends.mk
358         $(MAKE) bd
359 if GCL_ALT_LINK
360         echo '$(QUIET) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE) (system::quit)' | $(EXECUTEGCL)
361         echo '(let ((com (quote (progn (defvar compiler::*gazonk-prefix* "gazonk") (defun compiler::gazonk-name (&aux tem)(dotimes (i 1000) (unless (probe-file (setq tem (merge-pathnames (format nil "~d~d.lsp" compiler::*gazonk-prefix* i))))(return-from compiler::gazonk-name (pathname tem))))(error "1000 gazonk names used already!"))(let ((compiler::*gazonk-prefix* "maxima_gazonk")(compiler::*keep-gaz* t))$(LOADDEFSYSTEM)$(DEFSYSTEMLOAD))))))(let ((si::*collect-binary-modules* t))(eval com)(let ((compiler::*default-system-p* t))(dolist (l (directory "maxima_gazonk*.lsp")) (compile-file l) (delete-file l)))(compiler::link si::*binary-modules* "binary-gcl/maxima" (format nil "~S" com) "" nil)(dolist (l (directory "maxima_gazonk*.lsp")) (delete-file l)))) (system::quit)' | $(EXECUTEGCL)
362 else
363         echo '$(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE) (system::quit)' | $(EXECUTEGCL)
364         echo '(setq si::*optimize-maximum-pages* nil) $(LOADDEFSYSTEM) $(DEFSYSTEMLOAD) (setq si::*optimize-maximum-pages* t) (si:save-system "binary-gcl/maxima") (system::quit)'  | $(EXECUTEGCL)
365 endif
367 gcl-depends.mk: maxima.system Makefile *.lisp
368         echo $(call MAKE_DEPENDS,$(gcl_depends_targets),gcl-depends.mk.tmp) '(system::quit)' | $(EXECUTEGCL)
369         cat gcl-depends.mk.tmp | sed -e "s#\\\\#/#g" > gcl-depends.mk
370 -include gcl-depends.mk
372 endif
374 clean-gcl:
375         rm -rf binary-gcl
376 CLEAN_TARGETS += clean-gcl
378 ## OPENMCL / CCL ###############################################################
379 if OPENMCL
381 openmcllibdir = $(verpkglibdir)/binary-openmcl
382 EXTRA_SCRIPTS += $(OPENMCL_MAXIMA)
384 if OPENMCL_EXEC
385 OPENMCL_MAXIMA = binary-openmcl/maxima$(EXEEXT)
386 openmcllib_SCRIPTS = $(OPENMCL_MAXIMA)
387 omcl_flag = :prepend-kernel t
388 else
389 OPENMCL_MAXIMA = binary-openmcl/maxima.image
390 openmcllib_DATA = $(OPENMCL_MAXIMA)
391 omcl_flag =
392 endif
394 EXECUTEOPENMCL = $(OPENMCL_NAME)
395 BUILT_FILES += $(OPENMCL_MAXIMA)
397 COMPILE_OMCL = echo '$(QUIET) (require :defsystem) (mk:add-registry-location "$(top_srcdir)/src/") $(DEFSYSTEMCOMPILE) (ccl::quit)' | $(EXECUTEOPENMCL)
398 WRITE_OMCL = echo '(require :defsystem) (mk:add-registry-location "$(top_srcdir)/src/") $(DEFSYSTEMLOAD) (ccl:save-application "$@") (ccl::quit)' | $(EXECUTEOPENMCL)
399 BUILD_OMCL = $(COMPILE_OMCL) && $(WRITE_OMCL)
401 openmcl: $(OPENMCL_MAXIMA)
403 $(OPENMCL_MAXIMA):
404         $(BUILD_OMCL)
405         echo '(require :defsystem)  $(DEFSYSTEMCOMPILE) (ccl::quit)' | $(EXECUTEOPENMCL) \
406            && \
407         echo '(require :defsystem) $(DEFSYSTEMLOAD) (ccl:save-application "$@" $(omcl_flag)) (ccl::quit)' | $(EXECUTEOPENMCL)
409 openmcl-depends.mk: maxima.system Makefile *.lisp
410         echo $(call MAKE_DEPENDS,"$(OPENMCL_MAXIMA)",openmcl-depends.mk.tmp,(ccl:quit)) | $(EXECUTEOPENMCL)
411         cat openmcl-depends.mk.tmp | sed -e "s#\\\\#/#g" > openmcl-depends.mk
413 -include openmcl-depends.mk
415 endif
417 clean-openmcl:
418         rm -rf binary-openmcl
419 CLEAN_TARGETS += clean-openmcl
421 ## CCL64 #######################################################################
423 if CCL64
425 ccl64libdir = $(verpkglibdir)/binary-ccl64
426 EXTRA_SCRIPTS += $(OPENMCL_MAXIMA)
428 if CCL64_EXEC
429 CCL64_MAXIMA = binary-ccl64/maxima$(EXEEXT)
430 ccl64lib_SCRIPTS = $(CCL64_MAXIMA)
431 omcl_flag = :prepend-kernel t
432 else
433 CCL64_MAXIMA = binary-ccl64/maxima.image
434 ccl64lib_DATA = $(CCL64_MAXIMA)
435 omcl_flag =
436 endif
438 EXECUTECCL64 = $(CCL64_NAME)
439 BUILT_FILES += $(CCL64_MAXIMA)
441 COMPILE_CCL64 = echo '$(QUIET) (require :defsystem) (mk:add-registry-location "$(top_srcdir)/src/") $(DEFSYSTEMCOMPILE) (ccl::quit)' | $(EXECUTECCL64)
442 WRITE_CCL64 = echo '(require :defsystem) (mk:add-registry-location "$(top_srcdir)/src/") $(DEFSYSTEMLOAD) (ccl:save-application "$@") (ccl::quit)' | $(EXECUTECCL64)
443 BUILD_CCL64 = $(COMPILE_CCL64) && $(WRITE_CCL64)
445 ccl64: $(CCL64_MAXIMA)
447 $(CCL64_MAXIMA):
448         $(BUILD_CCL64)
449         echo '(require :defsystem)  $(DEFSYSTEMCOMPILE) (ccl::quit)' | $(EXECUTECCL64) \
450            && \
451         echo '(require :defsystem) $(DEFSYSTEMLOAD) (ccl:save-application "$@" $(omcl_flag)) (ccl::quit)' | $(EXECUTECCL64)
453 ccl64-depends.mk: maxima.system Makefile *.lisp
454         echo $(call MAKE_DEPENDS,"$(CCL64_MAXIMA)",ccl64-depends.mk.tmp,(ccl:quit)) | $(EXECUTECCL64)
455         cat ccl64-depends.mk.tmp | sed -e "s#\\\\#/#g" > ccl64-depends.mk
457 -include ccl64-depends.mk
460 endif
462 clean-ccl64:
463         rm -rf binary-ccl64
464 CLEAN_TARGETS += clean-ccl64
466 ## ECL #########################################################################
467 if ECL
469 ecllibdir = $(verpkglibdir)/binary-ecl
470 EXTRA_SCRIPTS += binary-ecl/maxima
471 ecllib_SCRIPTS = binary-ecl/maxima
473 EXECUTEECL = $(ECL_NAME) -norc
474 BUILT_FILES += binary-ecl/maxima
476 ecl:binary-ecl/maxima
478 binary-ecl/maxima:
479         $(MAKE) bd
480         echo '$(QUIET) $(LOADDEFSYSTEM) $(DEFSYSTEMCOMPILE) (build-maxima-lib) (ext:quit)' | $(EXECUTEECL)
482 ecl-depends.mk: maxima.system Makefile *.lisp
483         echo $(call MAKE_DEPENDS,"binary-ecl/maxima",ecl-depends.mk.tmp,(quit)) | $(EXECUTEECL)
484         cat ecl-depends.mk.tmp | sed -e "s#\\\\#/#g" > ecl-depends.mk
486 -include ecl-depends.mk
487 endif
489 clean-ecl:
490         rm -rf binary-ecl libmaxima.a
491 CLEAN_TARGETS += clean-ecl
493 ## ABCL ########################################################################
494 if ABCL
496 # ABCL compiles the individual files maxima is comprised of. But they aren't 
497 # compiled into a single .jar archive, but need to be loaded by abcl in the
498 # right order => We need to copy all the stuff defsystem needs into the binary
499 # folder and need to use defsystem for loading all the files in the Right Order.
501 abcllibdir = $(verpkglibdir)/binary-abcl
502 EXTRA_SCRIPTS += binary-abcl/maxima
503 abcllib_SCRIPTS = binary-abcl/maxima
505 EXECUTEABCL = $(JRE) -jar $(ABCL_JAR) --noinit
506 BUILT_FILES += binary-abcl/maxima
508 WEIRD_INSTALL_TARGETS += install-abcl-folder
509 WEIRD_UNINSTALL_TARGETS += uninstall-abcl-folder
511 install-abcl-folder:
512         $(mkinstalldirs) $(DESTDIR)$(abcllibdir)
513         cp -r binary-abcl/* "$(DESTDIR)$(abcllibdir)"
514         chmod +x $(DESTDIR)$(abcllibdir)/maxima
515 uninstall-abcl-folder:
516         if test x"$(abcllibdir)" = x"" ; then echo "Error: No known maxima version"; exit -1; else rm -f "$(DESTDIR)$(abcllibdir)/*"; fi
518 abcl:binary-abcl/maxima
521 binary-abcl/maxima: Makefile.am startmaxima_abcl.sh
522         $(MAKE) bd
523 if QUIET_BUILD
524         $(EXECUTEABCL) --eval '(setq *compile-verbose* nil)' --eval '(setf *compile-print* nil)' --eval '(load "$(top_srcdir)/lisp-utils/defsystem.lisp")' --eval '(mk:add-registry-location "$(top_srcdir)/src/")' --eval '($(DS_OOS) :compile :verbose nil)' --eval '(quit)'
525 else
526         $(EXECUTEABCL) --eval '(load "$(top_srcdir)/lisp-utils/defsystem.lisp")' --eval '(mk:add-registry-location "$(top_srcdir)/src/")' --eval '($(DS_OOS) :compile :verbose t)' --eval '(quit)'
527 endif
528         cat $(srcdir)/maxima.system | sed -e 's#"binary-abcl"#(ext:getenv "MAXIMA_IMAGESDIR_BIN")#g' > binary-abcl/maxima.system
529         cp $(srcdir)/maxima-package.lisp binary-abcl
530         cp $(srcdir)/autol.lisp binary-abcl
531         cp $(srcdir)/init-cl.lisp binary-abcl
532         cp $(srcdir)/max_ext.lisp binary-abcl
533         cp share-subdirs.lisp binary-abcl
534         cp autoconf-variables.lisp binary-abcl
535         cp $(ABCL_JAR) binary-abcl/abcl.jar
536         cp $(srcdir)/../lisp-utils/defsystem.lisp binary-abcl
537         cp -a startmaxima_abcl.sh binary-abcl/maxima
538         touch binary-abcl/maxima
539         chmod +x binary-abcl/maxima
541 abcl-depends.mk: maxima.system Makefile *.lisp
542         echo $(call MAKE_DEPENDS,"binary-abcl/maxima",abcl-depends.mk.tmp,(quit)) | $(EXECUTEABCL)
543         cat abcl-depends.mk.tmp | sed -e "s#\\\\#/#g" > abcl-depends.mk
545 -include abcl-depends.mk
546 endif
548 clean-abcl:
549         rm -rf binary-abcl libmaxima.a
550 CLEAN_TARGETS += clean-abcl
552 distclean-local:
553         rm -f sbcl-depends.mk.tmp