From 360623154d4e7c4ceec5a58a1f35a23e336210f8 Mon Sep 17 00:00:00 2001 From: Secret Specter Date: Tue, 1 Aug 2023 13:41:08 -0600 Subject: [PATCH] Makefile and -v flag --- .editorconfig | 3 +++ Makefile | 17 +++++++++++++++++ build.sh | 3 --- src/bin.lisp | 9 +++++++-- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 Makefile delete mode 100755 build.sh diff --git a/.editorconfig b/.editorconfig index afdf465..8a12ecb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,3 +4,6 @@ indent_style=space indent_size=2 tab_width=2 trim_trailing_whitespace=true + +[Makefile] +indent_style=tab diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e04ccf9 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +bin/geml-server: src/*.lisp + mkdir -p bin + sbcl --no-userinit --no-sysinit --non-interactive \ + --load ~/quicklisp/setup.lisp \ + --load build.lisp + +clean: + -rm quicklisp-manifest.txt + -rm bin/geml-server + +install: bin/geml-server + cp bin/geml-server /usr/local/bin/geml-server + #cp geml.service /etc/systemd/system + +uninstall: + rm /usr/local/bin/geml-server + #rm /etc/systemd/system/geml.service diff --git a/build.sh b/build.sh deleted file mode 100755 index 1e775c4..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -mkdir bin -sbcl --non-interactive --load build.lisp diff --git a/src/bin.lisp b/src/bin.lisp index 9d110c2..80dcffa 100644 --- a/src/bin.lisp +++ b/src/bin.lisp @@ -9,8 +9,12 @@ :meta-var "FILE" :description "path to a geml.ini file" :default "/etc/geml/geml.ini") - ;; TODO --help gets picked upby sbcl... - ;; -h works tho + ;; TODO --help and --version gets picked up by sbcl... + ;; -h and -v work tho + (:name :version + :short #\v + :long "version" + :description "shows the version of this build") (:name :help :short #\h :long "help" @@ -34,4 +38,5 @@ (opts:exit 1))) (cond ((getf options :help) (opts:describe :usage-of "geml-server")) + ((getf options :version) (format t "~a~%" (slot-value (asdf:find-system 'geml) 'asdf:version))) (t (start-server (getf options :config))))))