chiark / gitweb /
Makefile, sbcl-build: Refresh the Common Lisp build system.
[fringe] / sbcl-build
diff --git a/sbcl-build b/sbcl-build
new file mode 100755 (executable)
index 0000000..b5170f1
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/sh -e
+#| -*-lisp-*-
+exec sbcl --script "$0" "$0" "$@"
+|#
+
+(require 'sb-executable)
+
+(let* ((args (cdr *posix-argv*))
+       (prog (pop args))
+       (cmd (pop args)))
+  (cond
+    ((string= cmd "build")
+     (let ((rc 0))
+       (dolist (file args)
+        (unless (compile-file file :verbose nil :print nil)
+          (setf rc 1)))
+       (quit :unix-status rc)))
+    ((string= cmd "link")
+     (let ((out (pop args)))
+       (sb-executable:make-executable out args)))
+    (t
+     (format *error-output* "~A: unknown command `~A'~%" prog cmd)
+     (quit :unix-status 1))))