mk-defsystem
MK-defsystem is a system definition and build utility; it fills a similar role for CL as make(1) does for C. MK-defsystem can be downloaded from the CLOCC and its current official version identifier is MK:DEFSYSTEM 3.4 Interim (MK3).

The latest version of mk-defsystem works with asdf-install. I.e. you can use asdf-install to install .system files.

The new experimental version of mk-defsystem is MK:DEFSYSTEM 4.x (MK4). It is completely CLOS based and backward compatible with 3.x.

The sourceforge link to mk-defsystem is https://sourceforge.net/projects/clocc/

The CVS modules in the CLOCC are

  • defsystem-3.x and
  • defsystem-4.x
If you have patches to make mk-defsystem more usable, please submit them to the CLOCC mailing lists or to one of the CLOCC maintainers.



Note that the latest version of MK3 already includes the code shown below.



Did you know? You can also load foreign files with defsystem. For example, to define that C components are compiled by calling out to "make" and loaded using the foreign loader, try something like this example (originally from db-sockets):

(defparameter *make-program* "make")

(defun c-make-file (filename &rest args &key output-file error-file)
  ;; make foo.o



  (declare (ignore args error-file))
  (make::run-unix-program *make-program* (list output-file)))

(make:define-language :c
  :compiler #'c-make-file
  :loader
  #+:lucid #'load-foreign-files
  #+cmu #'alien::load-foreign
  #+sbcl #'sb-alien::load-foreign
  #+:allegro #'load
  #-(or :cmu :sbcl :lucid :allegro) #'load
  :source-extension "c"
  :binary-extension "o")

then you define the relevant component like this:

               (:file "get_h_errno.c" :language :c
                      :source-extension "c" :binary-extension "o")


Are there any documents for mk-defsystem out there? How does one add a path to its search path?

Chapter 4 of http://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/lang/lisp/code/tools/mkantdoc.tgz

I have done a mild update to the defsystem.html that appears in clocc/src/defsystem-3.3i/docs/. I have submitted the changes, but don't believe they have been incorporated. You can find the documents here. I'll try to add some of the material discussed on this page, as time permits.

The CLOCC version of mk-defsystem has some TeX/DVI/PS documentation. As to the specific question, the magical variable you're looking to push things onto is mk:*central-registry*.

Just to clarify: the CLOCC documentation is limited and needs to be updated. As per the specific question, both MK3 and MK4 now have a new function

     (mk:add-registry-location <i>pathname</i>)
which does the PUSH in a more meaningful way.

Henrik Motakef's Fight the System explains how to use and load libraries with mk-defsystem.


MK-DEFSYSTEM is now also asdf-installlable, though not yet from the official site (FWIW, this is version 3.3 and the latest version is 3.6):

ASDF-install package (obsolete) http://random-state.net/files/mk-defsystem_latest.tar.gz