Previous: , Up: using libraries compiling   [Index]


2.4.5.2 Compiling all the dependencies of a program

This library compilation strategy is implemented by a proper execution mode of Vicare enabled by the command line option --compile-dependencies of vicare; when using this mode the command line option --output is ignored. In this mode:

Let’s say we have the libraries:

(alpha beta (1 0))
(alpha gamma (1 2))

in the files:

$(srcdir)/lib/alpha/beta.sls
$(srcdir)/lib/alpha/gamma.sls

and we want to compile them to:

$(builddir)/lib/alpha/beta.fasl
$(builddir)/lib/alpha/gamma.fasl

we prepare a Scheme script for this purpose, containing the required import forms:

;; compile-all.sps --
;;

(import (only (alpha beta))
        (only (alpha beta)))

;;; end of file

and we execute it as follows:

vicare \
   --source-path     $(srcdir)/lib   \
   --build-directory $(builddir)/lib \
   --compile-dependencies compile-all.sps

if the option --library-locator is not used: using --compile-dependencies will automatically select the compile–time library locator.

If a selected library depends on the other selected library: Vicare will automatically take care of generating the appropriate binary formats. If a selected library depends on other libraries, not explicitly selected by the script: Vicare will automatically take care of generating the appropriate binary formats and FASL files in the selected compiled-library-build-directory.


Previous: , Up: using libraries compiling   [Index]