From 78e37a7fdaaea81f8d9c93170c2adbf9515f6f8c Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Mon, 3 Feb 2025 16:58:06 -0700 Subject: Add a Makefile Most of the commands are simply wrappers around the cargo equivalent. However, it does include commands to install and uninstall a release build of the program. Signed-off-by: Rory Dudley --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0e5dfbb --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +OS = $$( uname -s ) + +all: build + +release: + cargo build --release + +build: + cargo build + +test: + cargo test + +run: + cargo run + +install: release + $$( case $(OS) in \ + ( Linux ) cat dist/etc/dwvshrc dist/etc/linuxrc > /etc/dwvshrc ;; \ + ( * ) cat dist/etc/dwvshrc > /etc/dwvshrc ;; \ + esac ) + cp -f target/release/dwvsh /usr/bin; + +uninstall: + rm -f /usr/bin/dwvsh + rm -f /etc/dwvshrc + +clean: + cargo clean -- cgit v1.2.3