diff --git a/prepare-build.lisp b/prepare-build.lisp
index 4f04ce5..9b63b72 100644
--- a/prepare-build.lisp
+++ b/prepare-build.lisp
@@ -157,12 +157,14 @@
(defun system-and-dependencies (name)
(let (dependencies)
(labels ((dfs (name)
- (let ((sys (asdf:find-system name)))
- (when (and sys (not (find sys dependencies)))
- (locally (declare (type asdf:system sys))
- (format t "~& ~A" sys) (force-output)
- (map 'nil #'dfs (asdf:system-depends-on sys))
- (push sys dependencies))))))
+ (etypecase name
+ ((or string symbol asdf:system)
+ (let ((sys (asdf:find-system name)))
+ (when (and sys (not (find sys dependencies)))
+ (locally (declare (type asdf:system sys))
+ (format t "~& ~A" sys) (force-output)
+ (map 'nil #'dfs (asdf:system-depends-on sys))
+ (push sys dependencies))))))))
(dfs name)
(nreverse dependencies))))