diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | rva.asd | 23 | ||||
-rw-r--r-- | src/lex.lisp | 8 | ||||
-rw-r--r-- | src/rva.lisp | 19 |
6 files changed, 82 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..77b3e2b --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# IDE files +.dir-locals.el +manifest.scm + +# generated +bin/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7ae7ab8 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +BIN := rva +LISP := sbcl + +.PHONY: all run clean + +all: + $(LISP) --non-interactive \ + --eval '(require "asdf")' \ + --eval '(asdf:load-asd (merge-pathnames "rva.asd" (uiop:getcwd)))' \ + --eval '(asdf:make :rva)' + +run: + @ ./bin/$(BIN) + +clean: + rm -f ./bin/$(BIN) diff --git a/README.md b/README.md new file mode 100644 index 0000000..0650ad9 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# RISC V[ECTOR] Assembler + +## Dependencies + +- SBCL +- ASDF + +## To compile + +make @@ -0,0 +1,23 @@ +(defsystem "rva" + ;; :author "" + ;; :license "" + :version "0.1" + :homepage "https://github.com/bdunahu/rva" + :source-control (:git "git@github.com:bdunahu/rva.git") + :depends-on ("uiop") + :components ((:module "src" + :serial t + :components ((:file "lex") + (:file "rva")))) + :long-description + #.(uiop:read-file-string + (uiop:subpathname *load-pathname* "README.md")) + :in-order-to ((test-op (test-op "rva/tests"))) + :build-operation "program-op" + :build-pathname "bin/rva" + :entry-point "rva::main") + +(defmethod asdf:perform ((o asdf:image-op) (c asdf:system)) + (uiop:dump-image (asdf:output-file o c) + :executable t + :compression t)) diff --git a/src/lex.lisp b/src/lex.lisp new file mode 100644 index 0000000..2f89bb5 --- /dev/null +++ b/src/lex.lisp @@ -0,0 +1,8 @@ +(defpackage :lex + (:use :cl) + (:export :stub)) + +(in-package :lex) + +(defun stub () + (format t "Hello, world!~%")) diff --git a/src/rva.lisp b/src/rva.lisp new file mode 100644 index 0000000..83b0fe1 --- /dev/null +++ b/src/rva.lisp @@ -0,0 +1,19 @@ +(defpackage :rva + (:use :cl)) + +(in-package :rva) + +(defparameter *version* "v0.1") + +(defun error-cli (message) + (format *error-output* + "~a~%Usage: + risc_vector file +Options: + --version, -v: print version information~%" + message) + (sb-ext:exit :code 1)) + +(defun main () + (lex:stub) + (error-cli "foobar")) |