diff --git a/.gitignore b/.gitignore index b2a7b4a..d5e305b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ *.lst *.note *.sh - +c6lc \ No newline at end of file diff --git a/wip-duuqnd/user-side-compiler/binary-test-build.lisp b/wip-duuqnd/user-side-compiler/binary-test-build.lisp new file mode 100644 index 0000000..3edec4e --- /dev/null +++ b/wip-duuqnd/user-side-compiler/binary-test-build.lisp @@ -0,0 +1,32 @@ +(in-package #:user-side-compiler) + +(defun batch-parse-options (arguments) + (let ((options '())) + (loop :with outputp := nil + :for arg :in arguments + :do (cond (outputp + (setf (getf options :output) arg + outputp nil)) + ((or (string= arg "-o") (string= arg "--output")) + (setf outputp t)) + ((or (string= arg "-h") (string= arg "--help")) + (setf (getf options :show-help-p) t)) + (t + (setf (getf options :input) arg)))) + options)) + +(defun batch-main () + (destructuring-bind (&key input output show-help-p) + (batch-parse-options (uiop:command-line-arguments)) + (if show-help-p + (progn + (format t "Usage: c6lc [-o ] ~%") + (sb-ext:exit :code -1)) + (batch-compile input output)))) + +(defun build () + (assert (not (member :swank *features*))) + (sb-ext:save-lisp-and-die "c6lc" :toplevel #'batch-main :executable t + :save-runtime-options t + :root-structures 'batch-main + :compression t)) diff --git a/wip-duuqnd/user-side-compiler/user-side-compiler.asd b/wip-duuqnd/user-side-compiler/user-side-compiler.asd index 3868969..7974f7c 100644 --- a/wip-duuqnd/user-side-compiler/user-side-compiler.asd +++ b/wip-duuqnd/user-side-compiler/user-side-compiler.asd @@ -37,4 +37,5 @@ :components ((:file "value-allocator") (:file "pre-assembly") (:file "code-generator"))) - (:file "interface"))) + (:file "interface") + (:file "binary-test-build")))