[Ecls-list] ASDF to build FAS libraries

Goffioul Michael goffioul at imec.be
Wed Oct 19 08:11:07 UTC 2005


Hi,

I tried to play with ASDF in order to compile FAS libraries (I mean FAS
files containing several LISP files). To do that, I applied to attached
patch to asdf.lisp and defined a new build-op operation as the following:

========================================

(defclass build-op (compile-op) ())

(defmethod initialize-instance :after ((instance build-op) &rest initargs &key &allow-other-keys)
  (setf (slot-value instance 'system-p) t))

(defmethod output-files ((o build-op) (c cl-source-file))
  (list (compile-file-pathname (component-pathname c) :type :object)))

(defmethod traverse ((o build-op) (c cl-source-file))
  (let ((op (make-instance 'load-source-op))
        (tree (call-next-method)))
    (unless (operation-done-p op c)
      (push (cons op c) tree))
    tree))

(defgeneric get-files (component type))

(defmethod get-files ((m module) type)
  (loop for c in (module-components m)
        append (get-files c type)))

(defmethod get-files ((c cl-source-file) type)
  (case type
    (:input (list c))
    (:output (output-files (make-instance 'build-op) c))))

(defmethod output-files ((o build-op) (c system))
  (list (compile-file-pathname (component-name c))))

(defmethod input-files ((o build-op) (c system))
  (get-files c :output))

(defmethod perform ((o build-op) (c system))
  (let ((obj-files (get-files c :output))
        (out-file (car (output-files o c))))
    (c::build-fasl out-file :lisp-files obj-files)))

========================================

Maybe this could be a nice addition to ECL asdf support. Isn't it?
(Note: I'm not an ASDF expert, I guess the code can be improved...)

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asdf.diff.bz2
Type: application/octet-stream
Size: 525 bytes
Desc: asdf.diff.bz2
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20051019/739a1f0e/attachment.obj>


More information about the ecl-devel mailing list