mk-defsystem
MK-DEFSYSTEM is a system definition utility; it fills a similar role for CL as make(1) does for C.

The current version (3.9.2) was released on June 30, 2024, and is available in Quicklisp.

Documentation

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

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.

Portability notes

The y-or-n-p-wait function (which is also provided by text-query) uses a technique of busy-waiting on listen (or read-char-no-hang) that doesn't work everywhere. For example, it works in the LispWorks IDE for Windows, but doesn't work in the Windows Terminal. To disable the use of timeouts, you can change the value of *use-timeouts* away from the default:

(setf mk::*use-timeouts* nil)

ACL warns because some export forms are non-top-level. This is one of those things that changed when CLtL2 came around. Things like export (and proclaim, shadow, etc.) are supposed to be wrapped in an eval-when, or find another way to suppress the warnings. The variable *cltl1-compile-file-toplevel-compatibility-p* controls this behavior:

CG-USER(3): compiler:*cltl1-compile-file-toplevel-compatibility-p* WARN

Foreign files

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

Older versions


build