Add way to make binary test build of user-side compiler
This commit is contained in:
parent
7940298753
commit
83fdb01368
3 changed files with 35 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,4 +5,4 @@
|
||||||
*.lst
|
*.lst
|
||||||
*.note
|
*.note
|
||||||
*.sh
|
*.sh
|
||||||
|
c6lc
|
32
wip-duuqnd/user-side-compiler/binary-test-build.lisp
Normal file
32
wip-duuqnd/user-side-compiler/binary-test-build.lisp
Normal file
|
@ -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 <output file>] <input file>~%")
|
||||||
|
(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))
|
|
@ -37,4 +37,5 @@
|
||||||
:components ((:file "value-allocator")
|
:components ((:file "value-allocator")
|
||||||
(:file "pre-assembly")
|
(:file "pre-assembly")
|
||||||
(:file "code-generator")))
|
(:file "code-generator")))
|
||||||
(:file "interface")))
|
(:file "interface")
|
||||||
|
(:file "binary-test-build")))
|
||||||
|
|
Loading…
Add table
Reference in a new issue