make-cm

[Function]
  (`make-cm` [`:save-image` bool] [`:delete-fasls` bool] [`:bin-directory` dir] [`:scheme` bool] [`:verbose` bool] [`:force` bool] [`:extensions` bool] )

Compiles, loads and saves the Common Music application according to its keyword build parameters. This function is called automatically if you build Common Music in its default configuration by loading the file src/cm.lisp. To customize the build process, or to enable interactive prompting for each build parameter during the make process, load the file src/make.lisp and call `make-cm` by hand. Note that the function's name is interned as an internal symbol of the CL-USER package.

`make-cm` supports the following keyword build parameters:

`:save-image` {true | false | `:if-no-compile`}
  If true then `make-cm` saves Common Music in a lisp image file (cm.img) and immediately exits from the current Lisp session. If the value is `:if-no-compile` than an image is saved only if no source files are compiled during the make pass. If the value is false then no image file is saved. The default value is false.
`:delete-fasls` {true | false}
  If true then compiled files are deleted after an image has been savedm, otherwise they are not deleted. The default value is true if `:save-image` is true otherwise the default value is false.
`:bin-directory` {true | false | string }
  Specifies the directory in which compiled files and (optionally) image files are saved to. You must have write permission in this directory. If the value is true then the binary directory is set to the bin/ subdirectory of the Common Music installation directory. If the value is false (or if you do not have write permission in the bin directory) then no compilation or image saving will occur but source files will still be loaded. Othewise, the value should a fully specified pathname (string) to the directory in which to save binaries. The default value is true.
`:scheme` {true | false}
  If true then Scheme syntax is enabled in Common Lisp, if false it is not. The default value is true.
`:verbose` {true | false}
  If true then information about the make progress is printed to the terminal, if false it is not. A false value will not stop compiler warnings or other implementation output from occuring. The default value is true.
`:extensions` {list | false}
  A list of user-supplied extensions to process as CM loads up. Each entry in the list should be a function to evaluate or a filename (string) to load. The extensions list is normally processed inside the Common Music package after the system loads itself. To process some (or all) of the entries before any CM files are loaded, add the keyword :before to the front of the list. Preprocessing can be turned off for later entries in the extensions list by including the keyword :after in front of those entries that should be be processed in the normal, post-loading manner.
`:force` {true | false}
  Determines what to do if `make-cm` is called in a Lisp environment that already contains Common Music. Normally, `make-cm` should be invoked in a fresh Lisp session without CM already loaded. If the CM package is already present when `make-cm` is called then the function will immediately return `nil` without doing anything unless its `:force` parameter is explicitly set to `t`. The default value is false.

#### Examples:

Build Common Music in its default configuration.

    > (load "/Lisp/cm-2.4.0/src/cm.lisp")
    ; Compiling /Lisp/cm-2.4.0/src/clm-stubs.lisp.
    ; Loading /Lisp/cm-2.4.0/bin/clm-stubs.pfsl.
    [...build output deleted...]
    ; Saving start-up script '/Lisp/cm-2.4.0/bin/cm'.
    ; Copying application files...
    ; Garbage collecting...

Build using custom bin directory and not deleting compiled files after image save.

    > (load "/Lisp/cm-2.4.0/src/make.lisp")
    #P"/Lisp/cm-2.4.0/src/make.lisp"
    > (make-cm :bin-directory "/Lisp/bin/cm" :delete-fasls nil)
    ; Compiling /Lisp/cm-2.4.0/src/clm-stubs.lisp.
    ; Loading /Lisp/bin/cm-2.4.0/clm-stubs.pfsl.
    [...build output deleted...]
    ; Garbage collecting...

Build using interactive prompting.

    > (load "/Lisp/cm-2.4.0/src/make.lisp")
    #P"/Lisp/cm-2.4.0/src/make.lisp"
    > (make-cm :prompt t)
    Making Common Music from '/Lisp/cm-2.4.0/'.
    Type '?' for help, '^' to abort and
    Return to accept defaults shown in [].

    Binary directory: [/Lisp/cm-2.4.0/bin/] ?
    Type the full pathname to the directory that you want compiled files
    and/or the Common Music image file to be saved in. You must have write
    permission in this directory.
    Binary directory: [/Lisp/cm-2.4.0/bin/]
    Include Scheme compatibility? (Y/N): [Y]
    Save CM image file? (Y/N/:if-no-compile): [Y]
    Delete compiled files after saving image?: [Y] n
    Making Common Music with build parameters:
      :bin-directory "/Lisp/cm-2.4.0/bin/"
      :scheme t
      :save-image t
      :delete-fasls nil

    Are these values correct? (Y/N): y

    ; Compiling /Lisp/cm-2.4.0/src/clm-stubs.lisp.
    ; Loading /Lisp/cm-2.4.0/bin:/clm-stubs.pfsl.
    [...build output deleted...]
    ; Garbage collecting...
    ; Saving application image.
    ; Bye!

#### See Also:

- `cm.sh``` [Script]