From 20ef53522555e5b05e55fb4ad8b0c5f74d3ca0e3 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 1 Apr 2013 16:27:21 +0100 Subject: [PATCH] Makefile, sbcl-build: Refresh the Common Lisp build system. Apparently SBCL won't just run its FASL files any more. But there's a gadget for bundling FASLs together now, so use that. Unfortunately it's a bit complicated, so turn the whole build system into a script (in Lisp, natch). --- Makefile | 8 ++++---- sbcl-build | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100755 sbcl-build diff --git a/Makefile b/Makefile index 0d87af1..226c975 100644 --- a/Makefile +++ b/Makefile @@ -109,16 +109,16 @@ icon-fringe: icon-fringe.icn CLEANFILES += *.core *.fasl +SBCL_BUILD = ./sbcl-build + .SUFFIXES: .lisp .fasl .lisp.fasl: - $(call v_echo,CL)sbcl --noinform --eval \ - '(quit :unix-status (if (compile-file "$<" :verbose nil :print nil) 0 1))' + $(call v_echo,CL)$(SBCL_BUILD) build $< LANGS += cl SOURCES += cl-fringe.lisp cl-fringe: cl-fringe.fasl - $(call v_echo,CP)cp $< $@.new && chmod +x $@.new && mv $@.new $@ -## $(call v_echo,CL)cl-launch -o $@ -f `pwd`/$^ +I -r launch -d $@.core + $(call v_echo,CLLD)$(SBCL_BUILD) link $@ $^ ###-------------------------------------------------------------------------- ### F#. diff --git a/sbcl-build b/sbcl-build new file mode 100755 index 0000000..b5170f1 --- /dev/null +++ b/sbcl-build @@ -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)))) -- 2.11.0