Changeset 11680


Ignore:
Timestamp:
02/22/09 15:49:54 (14 years ago)
Author:
ehuelsmann
Message:

Rename/ introduce variables for clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build-abcl.lisp

    r11679 r11680  
    147147         truename)))
    148148
    149 (defparameter *build-root*
     149(defparameter *tree-root*
    150150  (make-pathname :device (pathname-device *load-truename*)
    151151                 :directory (pathname-directory *load-truename*)))
     152(defparameter *build-root*
     153  (merge-pathnames "build/classes/" *tree-root*))
     154(defparameter *source-root*
     155  (merge-pathnames "src/" *tree-root*))
     156(defparameter *dist-root*
     157  (merge-pathnames "dist/" *tree-root*))
     158
    152159
    153160(defparameter *customizations-file*
    154   (merge-pathnames "customizations.lisp" *build-root*))
     161  (merge-pathnames "customizations.lisp" *tree-root*))
    155162
    156163(defparameter *abcl-dir*
    157   (merge-pathnames "src/org/armedbear/lisp/" *build-root*))
     164  (merge-pathnames "src/org/armedbear/lisp/" *tree-root*))
    158165
    159166(defparameter *jdk*           nil)
     
    191198                                     "bin/jar")
    192199                                 *jdk*)))
    193   (let ((classpath-components (list (merge-pathnames "src" *build-root*)
     200  (let ((classpath-components (list *source-root*
    194201                                    (if (eq *platform* :darwin)
    195202                                        #p"/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar"
     
    272279          (t
    273280           (cond (batch
    274                   (ensure-directories-exist (merge-pathnames "build/classes/" *build-root*))
     281                  (ensure-directories-exist *build-root*)
    275282                  (let* ((dir (pathname-directory *abcl-dir*))
    276283                         (cmdline (with-output-to-string (s)
    277284                                    (princ *java-compiler-command-line-prefix* s)
    278285                                    (princ " -d " s)
    279                                     (princ (merge-pathnames "build/classes/"
    280                                                             *build-root*) s)
     286                                    (princ *build-root* s)
    281287                                    (princ #\Space s)
    282288                                    (dolist (source-file source-files)
     
    290296                    (zerop status)))
    291297                 (t
    292                   (ensure-directories-exist (merge-pathnames "build/classes/" *build-root*))
     298                  (ensure-directories-exist *build-root*)
    293299                  (dolist (source-file source-files t)
    294300                    (unless (java-compile-file source-file)
     
    297303
    298304(defun make-jar ()
    299   (let ((*default-pathname-defaults* *build-root*)
     305  (let ((*default-pathname-defaults* *tree-root*)
    300306        (jar-namestring (namestring *jar*)))
    301307    (when (position #\space jar-namestring)
     
    306312          (command     (if (eq *platform* :windows) "make-jar.bat"    "sh make-jar")))
    307313      (copy-with-substitutions source-file target-file substitutions-alist)
    308       (ensure-directories-exist (merge-pathnames "dist/" *build-root*))
    309       (let ((status (run-shell-command command :directory *build-root*)))
     314      (ensure-directories-exist *dist-root*)
     315      (let ((status (run-shell-command command :directory *tree-root*)))
    310316        (unless (zerop status)
    311317          (format t "~A returned ~S~%" command status))
     
    325331                       (namestring
    326332                        (merge-pathnames "build/classes/org/armedbear/lisp/"
    327                                          *build-root*))
     333                                         *tree-root*))
    328334                       (when (eq *platform* :windows)
    329335                         '(("\\" . "/")))))
     
    339345    (setf status
    340346          (run-shell-command cmdline
    341                              :directory *build-root*))
     347                             :directory *tree-root*))
    342348    status))
    343349
     
    348354                       javah-namestring))
    349355              (status
    350                (run-shell-command command :directory (merge-pathnames "src/" *build-root*))))
     356               (run-shell-command command :directory *source-root*)))
    351357         (unless (zerop status)
    352358           (format t "~A returned ~S~%" command status))
     
    374380  (cond ((eq *platform* :windows)
    375381         (with-open-file (s
    376                           (merge-pathnames "abcl.bat" *build-root*)
     382                          (merge-pathnames "abcl.bat" *tree-root*)
    377383                          :direction :output
    378384                          :if-exists :supersede)
    379385           (format s "~A -Xss4M -Xmx256M -cp \"~A\" org.armedbear.lisp.Main %1 %2 %3 %4 %5 %6 %7 %8 %9~%"
    380386                   (safe-namestring *java*)
    381                    (namestring (merge-pathnames "dist\\abcl.jar" *build-root*)))))
     387                   (namestring (merge-pathnames "dist\\abcl.jar" *tree-root*)))))
    382388        (t
    383          (let ((pathname (merge-pathnames "abcl" *build-root*)))
     389         (let ((pathname (merge-pathnames "abcl" *tree-root*)))
    384390           (with-open-file (s pathname :direction :output :if-exists :supersede)
    385391             (if (eq *platform* :linux)
     
    388394                         (safe-namestring *java*)
    389395                         (safe-namestring *abcl-dir*)
    390                          (safe-namestring (merge-pathnames "src" *build-root*))
    391                          (safe-namestring (merge-pathnames "abcl.jar" *build-root*)))
     396                         (safe-namestring *source-root*)
     397                         (safe-namestring (merge-pathnames "abcl.jar" *tree-root*)))
    392398                 ;; Not Linux.
    393399                 (format s "#!/bin/sh~%exec ~A -Xss4M -Xmx256M -cp ~A:~A org.armedbear.lisp.Main \"$@\"~%"
    394400                         (safe-namestring *java*)
    395                          (safe-namestring (merge-pathnames "src" *build-root*))
    396                          (safe-namestring (merge-pathnames "abcl.jar" *build-root*)))))
     401                         (safe-namestring *source-root*)
     402                         (safe-namestring (merge-pathnames "abcl.jar" *tree-root*)))))
    397403           (run-shell-command (format nil "chmod +x ~A" (safe-namestring pathname))
    398                               :directory *build-root*)))))
     404                              :directory *tree-root*)))))
    399405
    400406(defun build-stamp ()
     
    425431
    426432(defun clean ()
    427   (dolist (f (list (list *build-root* "abcl.jar" "abcl.bat" "make-jar.bat"
     433  (dolist (f (list (list *tree-root* "abcl.jar" "abcl.bat" "make-jar.bat"
    428434                         "compile-system.bat")
    429435                   ;; as of 0.14 'compile-system.bat' isn't created anymore
     
    432438                                    "native.h" "libabcl.so" "build")
    433439                   (list (merge-pathnames "build/classes/org/armedbear/lisp/"
    434                                           *build-root*)
     440                                          *tree-root*)
    435441                                    "*.class" "*.abcl" "*.cls"
    436442                                    "native.h" "libabcl.so" "build")
    437443                   (list (merge-pathnames
    438444                          "build/classes/org/armedbear/lisp/util/"
    439                           *build-root*)
     445                          *tree-root*)
    440446                                    "*.class" "*.abcl" "*.cls")
    441                    (list (merge-pathnames "dist/" *build-root*)
    442                                     "*.jar" "*.class" "*.abcl" "*.cls")
     447                   (list *dist-root* "*.jar" "*.class" "*.abcl" "*.cls")
    443448                  (list (merge-pathnames "java/awt/" *abcl-dir*)
    444449                         "*.class")))
     
    546551    (when (probe-directory target-root)
    547552      (error "Target directory ~S already exists." target-root))
    548     (let* ((source-dir *build-root*)
     553    (let* ((source-dir *tree-root*)
    549554           (target-dir target-root)
    550555           (files (list "README"
     
    555560                        "make-jar.in")))
    556561      (copy-files files source-dir target-dir))
    557     (let* ((source-dir (merge-pathnames "examples/" *build-root*))
     562    (let* ((source-dir (merge-pathnames "examples/" *tree-root*))
    558563           (target-dir (merge-pathnames "examples/" target-root))
    559564           (files '("hello.java")))
    560565      (copy-files files source-dir target-dir))
    561     (let* ((source-dir (merge-pathnames "src/" *build-root*))
    562            (target-dir (merge-pathnames "src/" target-root))
     566    (let* ((target-dir (merge-pathnames "src/" target-root))
    563567           (files '("manifest-abcl")))
    564       (copy-files files source-dir target-dir))
     568      (copy-files files *source-root* target-dir))
    565569    (let* ((source-dir *abcl-dir*)
    566570           (target-dir (merge-pathnames "src/org/armedbear/lisp/" target-root))
Note: See TracChangeset for help on using the changeset viewer.