Commit | Line | Data |
---|---|---|
c8f068d2 MW |
1 | ;;; -*-lisp-*- |
2 | ;;; | |
3 | ;;; $Id$ | |
4 | ;;; | |
5 | ;;; Build necessary things | |
6 | ;;; | |
7 | ;;; (c) 2006 Straylight/Edgeware | |
8 | ;;; | |
9 | ||
10 | ;;;----- Licensing notice --------------------------------------------------- | |
11 | ;;; | |
12 | ;;; This program is free software; you can redistribute it and/or modify | |
13 | ;;; it under the terms of the GNU General Public License as published by | |
14 | ;;; the Free Software Foundation; either version 2 of the License, or | |
15 | ;;; (at your option) any later version. | |
16 | ;;; | |
17 | ;;; This program is distributed in the hope that it will be useful, | |
18 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;;; GNU General Public License for more details. | |
21 | ;;; | |
22 | ;;; You should have received a copy of the GNU General Public License | |
23 | ;;; along with this program; if not, write to the Free Software Foundation, | |
24 | ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
25 | ||
26 | (handler-case | |
27 | (flet ((compile-if-necessary (name) | |
28 | (let* ((name (pathname name)) | |
29 | (args #+ecl '(:system-p t :c-file t) | |
30 | #-ecl nil) | |
31 | (object #+ecl (merge-pathnames (make-pathname :type "o") | |
32 | name) | |
33 | #-ecl (apply #'compile-file-pathname name args))) | |
34 | (unless (and (probe-file object) | |
35 | (< (file-write-date name) | |
36 | (file-write-date object))) | |
37 | (format t ";;; Compiling ~A -> ~A~%" name object) | |
38 | (apply #'compile-file name args)) | |
39 | (load object :verbose t)))) | |
40 | (let ((stamp (make-pathname :directory (list :relative) | |
41 | :name (format nil "build-~A" | |
42 | #+cmu "cmucl" | |
43 | #+clisp "clisp" | |
44 | #+ecl "ecl") | |
45 | :type "stamp"))) | |
46 | (ignore-errors (delete-file stamp)) | |
47 | (compile-if-necessary "runlisp.lisp") | |
48 | (with-open-file (dummy stamp | |
49 | :direction :output | |
50 | :if-exists :overwrite | |
51 | :if-does-not-exist :create) | |
52 | (declare (ignorable dummy))))) | |
53 | (error (cond) | |
54 | (format *error-output* "Build failure: ~A.~%" cond) | |
55 | (ext:quit 1))) | |
56 | (ext:quit 0) | |
57 | ||
58 | ;;;----- That's all, folks -------------------------------------------------- |