summaryrefslogtreecommitdiff
path: root/objective-cl.asd
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-10 16:37:42 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-10 16:37:42 +0100
commit213ad2e9ce5aff9337234be84635e1a7ba22a598 (patch)
tree00e61121ea754c7d5ca584989593aa2cb9d1024e /objective-cl.asd
parent3170b6d37b051f42fe0b28ba2dfa54344e1c85e6 (diff)
Revamp the system definition.
darcs-hash:8060615b1741cadcf0296eb1ee36bd831a3043d3
Diffstat (limited to 'objective-cl.asd')
-rw-r--r--objective-cl.asd114
1 files changed, 2 insertions, 112 deletions
diff --git a/objective-cl.asd b/objective-cl.asd
index 0c15f8a..0598593 100644
--- a/objective-cl.asd
+++ b/objective-cl.asd
@@ -15,11 +15,11 @@
;;;; along with this program. If not, see
;;;; <http://www.gnu.org/licenses/>.
-(defvar *objcl-version* "0.0.4")
+(defvar asdf::*objcl-version* "0.0.4")
(defsystem "objective-cl"
:description "A portable Objective C bridge."
- :version *objcl-version*
+ :version asdf::*objcl-version*
:author "Matthias Benkard <matthias@benkard.de>"
:licence "GNU Lesser General Public License, version 3 or higher"
:depends-on (#:cffi #:trivial-garbage #:split-sequence #:objective-cl-libobjcl
@@ -78,113 +78,3 @@
"method-invocation"
"conditions")))))
:serial t)
-
-
-(defpackage objcl-asdf
- (:use #:cl #:asdf)
- (:export #:objc-source-file
- #:*objc-obj-dir*))
-(in-package #:objcl-asdf)
-
-(defvar *objc-obj-dir*)
-
-(defclass objc-source-file (source-file) ())
-(defclass objcl-c-source-file (objc-source-file) ()
- (:documentation "An Objective-CL C source file"))
-
-(defmethod source-file-type ((c objc-source-file) (s module)) "m")
-(defmethod source-file-type ((c objcl-c-source-file) (s module)) "c")
-
-(defmethod perform :before (o (c objc-source-file))
- ;; Copy the Objective-C sources to the target directory.
- (unless (null (output-files o c))
- (let* ((source-dir (component-pathname (find-system "objective-cl-libobjcl")))
- (sources
- (mapcar #'(lambda (x)
- (enough-namestring x source-dir))
- (mapcan #'(lambda (x)
- (directory (merge-pathnames x source-dir)))
- '(#p"**/*.c" #p"**/*.m" #p"**/*.h"
- #p"**/GNUmakefile.*"
- #p"**/*.make" #p"**/GNUmakefile"
- #p"**/*.in" #p"**/configure" #p"**/configure.ac"
- #p"libffi/**/*" #p"libffi/**/*.*"))))
- (output-dir
- (merge-pathnames #p"../../"
- (directory-namestring (first (output-files o c))))))
- (dolist (relative-source-file sources)
- (let ((output-file (merge-pathnames relative-source-file output-dir))
- (source-file (merge-pathnames relative-source-file source-dir)))
- (ensure-directories-exist output-file)
- (unless (and (probe-file output-file)
- (= (file-write-date source-file)
- (file-write-date output-file)))
- (ignore-errors ;; FIXME: We need to skip directories, so
- ;; that IGNORE-ERRORS can go away.
- (with-open-file (in source-file
- :element-type '(unsigned-byte 8))
- (with-open-file (out output-file
- :direction :output
- :if-exists :supersede
- :element-type '(unsigned-byte 8))
- (loop for byte = (read-byte in nil nil)
- while byte
- do (write-byte byte out)))))))))))
-
-(defmethod perform ((o compile-op) (c objc-source-file))
- (unless (or (operation-done-p o c)
- (null (output-files o c)))
- (zerop
- ;; Run `make' at the top level of the directory tree.
- (run-shell-command "make -C '~A'"
- (merge-pathnames #p"../../"
- (directory-namestring
- (first (output-files o c))))))))
-
-(defmethod output-files :around ((o compile-op) (c objc-source-file))
- ;; If this doesn't get called at all, we're kind of screwed.
- (let ((files (call-next-method)))
- (setq *objc-obj-dir*
- (merge-pathnames #p"../"
- (directory-namestring (first files))))
- files))
-
-#+(or)
-(defmethod output-files ((o compile-op) (c objc-source-file))
- (print (list (merge-pathnames (make-pathname :directory '(:relative "Objective-C" "obj")
- :type "o")
- (merge-pathnames
- (component-pathname (find-system "objective-cl-libobjcl"))
- (component-pathname c))))))
-
-(defmethod output-files ((o compile-op) (c objc-source-file))
- (list (merge-pathnames (make-pathname :directory '(:relative "obj")
- :type "o")
- (component-pathname c))))
-
-(defmethod operation-done-p ((o compile-op) (c objc-source-file))
- (and (every #'probe-file (output-files o c))
- (> (loop for file in (output-files o c)
- minimizing (file-write-date file))
- (file-write-date (component-pathname c)))))
-
-(defmethod perform ((o load-op) (c objc-source-file))
- nil)
-
-
-(defsystem "objective-cl-libobjcl"
- :description "A portable Objective C bridge."
- :version *objcl-version*
- :author "Matthias Benkard <matthias@benkard.de>"
- :licence "GNU Lesser General Public License, version 3 or higher"
- :depends-on ()
- :components ((:module "Objective-C"
- :components ((:objc-source-file "libobjcl")
- (:objc-source-file "PyObjC/libffi_support")
- (:objc-source-file "PyObjC/objc_support")
- (:objc-source-file "PyObjC/objc-runtime-apple")
- (:objc-source-file "PyObjC/objc-runtime-compat")
- (:objc-source-file "PyObjC/objc-runtime-gnu")
- (:objc-source-file "JIGS/ObjcRuntimeUtilities2")
- (:objcl-c-source-file "JIGS/ObjcRuntimeUtilities"))))
- :serial t)