X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcold%2Fslam.lisp;h=02d91ad88f04af17a7fee0133129c0c9d534dd47;hb=47c73b316a434da5bab4e39b746bbe9a0f17aa8c;hp=92534c64ca576f6e55849c91c12fb687d3db524c;hpb=2db3b6b4cb740d5b6512459c223859f747807b09;p=sbcl.git diff --git a/src/cold/slam.lisp b/src/cold/slam.lisp index 92534c6..02d91ad 100644 --- a/src/cold/slam.lisp +++ b/src/cold/slam.lisp @@ -29,16 +29,25 @@ ;; recompile unnecessarily than sometimes bogusly to assume ;; up-to-date-ness.) (> (file-write-date output) - (file-write-date input)))) + (file-write-date input)))) + +;;; One possible use-case for slam.sh is to generate a trace-file for +;;; a file that is suddenly of interest, but was not of interest +;;; before. In order for this to work, we need to reload the stems +;;; and flags from build-order.lisp-expr, the user needs to have added +;;; :trace-file as a flag. +(setf *stems-and-flags* (read-from-file "build-order.lisp-expr")) (do-stems-and-flags (stem flags) (unless (position :not-target flags) - (let ((srcname (concatenate 'string stem ".lisp")) - (objname (concatenate 'string - *target-obj-prefix* - stem - *target-obj-suffix*))) - (unless (output-up-to-date-wrt-input-p objname srcname) - (target-compile-stem stem - :assem-p (find :assem flags) - :ignore-failure-p (find :ignore-failure-p flags)))))) + (let ((srcname (stem-source-path stem)) + (objname (stem-object-path stem flags :target-compile))) + (unless (and (output-up-to-date-wrt-input-p objname srcname) + ;; Back to our "new-trace-file" case, also build if + ;; a trace file is desired but is out-of-date. + (or (not (position :trace-file flags)) + (output-up-to-date-wrt-input-p + (concatenate 'string (stem-remap-target stem) + ".trace") + srcname))) + (target-compile-stem stem flags)))))