MK-defsystem is a system definition 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 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

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

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 ...)

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.

Update (2020-08-01)

An updated version (3.8) of the first widely available (and quite portable) DEFSYSTEM for Common Lisp:

MK:DEFSYSTEM was, and is, the first widely available, implementation independent, DEFSYSTEM (or make) for Common Lisp.

The current distribution and repository (3.8) contains a file defsystem.lisp, a docs directory, and this README file. The current version is based on MK:DEFSYSTEM distributed with CLOCC, but it contains a few enhancements and extensions for newer CL implementations.

MK:DEFSYSTEM works on most current (August 2020) Common Lisp implementations and it is still used by a wide variety of projects.