summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRory Dudley2025-02-03 16:58:06 -0700
committerRory Dudley2025-02-03 22:35:51 -0700
commit78e37a7fdaaea81f8d9c93170c2adbf9515f6f8c (patch)
treee602a4951c3ebf7b0ae8c4c35fe302708b913e6a
parentbfbd5b7e5d2dcf6fde1c44b475ea12f09bc23fdc (diff)
downloaddwarvish-main.tar.gz
Add a MakefileHEADmain
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 <rory@netc.lu>
Notes
Notes: Tested on Linux and OpenBSD (i.e. GNU make and BSD make).
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
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