projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
08f50f4
)
Bootstrap from any working directory
author
David Vázquez
<davazp@gmail.com>
Thu, 24 Oct 2013 12:54:53 +0000
(14:54 +0200)
committer
David Vázquez
<davazp@gmail.com>
Thu, 24 Oct 2013 12:56:15 +0000
(14:56 +0200)
It closes ticket #78
jscl.lisp
patch
|
blob
|
history
make.sh
patch
|
blob
|
history
diff --git
a/jscl.lisp
b/jscl.lisp
index
8378417
..
a5e4294
100644
(file)
--- a/
jscl.lisp
+++ b/
jscl.lisp
@@
-22,6
+22,9
@@
(in-package :jscl)
(in-package :jscl)
+(defvar *base-directory*
+ (or #.*load-pathname* *default-pathname-defaults*))
+
;;; List of all the source files that need to be compiled, and whether they
;;; are to be compiled just by the host, by the target JSCL, or by both.
;;; All files have a `.lisp' extension, and
;;; List of all the source files that need to be compiled, and whether they
;;; are to be compiled just by the host, by the target JSCL, or by both.
;;; All files have a `.lisp' extension, and
@@
-86,11
+89,12
@@
`(dolist (,name (get-files *source* ,type '(:relative "src")))
,@body))
`(dolist (,name (get-files *source* ,type '(:relative "src")))
,@body))
-(defun source-pathname
- (filename &key (directory '(:relative "src")) (type nil) (defaults filename))
- (if type
- (make-pathname :type type :directory directory :defaults defaults)
- (make-pathname :directory directory :defaults defaults)))
+(defun source-pathname (filename &key (directory '(:relative "src")) (type nil) (defaults filename))
+ (merge-pathnames
+ (if type
+ (make-pathname :type type :directory directory :defaults defaults)
+ (make-pathname :directory directory :defaults defaults))
+ *base-directory*))
;;; Compile jscl into the host
(with-compilation-unit ()
;;; Compile jscl into the host
(with-compilation-unit ()
@@
-154,13
+158,13
@@
(setq *variable-counter* 0
*gensym-counter* 0
*literal-counter* 0)
(setq *variable-counter* 0
*gensym-counter* 0
*literal-counter* 0)
- (with-open-file (out "jscl.js" :direction :output :if-exists :supersede)
+ (with-open-file (out (merge-pathnames "jscl.js" *base-directory*) :direction :output :if-exists :supersede)
(write-string (read-whole-file (source-pathname "prelude.js")) out)
(do-source input :target
(!compile-file input out))
(dump-global-environment out))
;; Tests
(write-string (read-whole-file (source-pathname "prelude.js")) out)
(do-source input :target
(!compile-file input out))
(dump-global-environment out))
;; Tests
- (with-open-file (out "tests.js" :direction :output :if-exists :supersede)
+ (with-open-file (out (merge-pathnames "tests.js" *base-directory*) :direction :output :if-exists :supersede)
(dolist (input (append (directory "tests.lisp")
(directory "tests/*.lisp")
(directory "tests-report.lisp")))
(dolist (input (append (directory "tests.lisp")
(directory "tests/*.lisp")
(directory "tests-report.lisp")))
diff --git
a/make.sh
b/make.sh
index
3dd4df3
..
25d789b
100755
(executable)
--- a/
make.sh
+++ b/
make.sh
@@
-1,3
+1,5
@@
#!/bin/sh
#!/bin/sh
-sbcl --load 'jscl.lisp' --eval '(jscl:bootstrap)' --eval '(quit)'
+BASE=`dirname $0`
+
+sbcl --load "$BASE/jscl.lisp" --eval '(jscl:bootstrap)' --eval '(quit)'