From c365b2f3e37370974e5a59e11d75f3ee213909a0 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Sun, 22 Jan 2023 17:57:16 +0100 Subject: [PATCH] Build. Provide fundamental building scripts That is Git ignore file, Cargo configuration file, and a general Makefile. --- .gitignore | 11 +++++++++++ Cargo.toml | 11 +++++++++++ Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e5470af --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Copyright (C) 2023 Gustav Eek +# +# SPDX-License-Identifier: CC0-1.0 + +*~ +*#* + +#Added by cargo + +/target +*.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..0304310 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +# Copyright (C) 2023 Gustav Eek +# +# SPDX-License-Identifier: CC0-1.0 + +[package] +name = "ranknauto" +version = "0.1.0" +authors = ["Gustav Eek "] +edition = "2018" + +[dependencies] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d7418c2 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +# Main build instruction for the project +# +# Copyright (C) 2023 Gustav Eek +# +# SPDX-License-Identifier: CC0-1.0 + +PRJ := $(notdir $(PWD)) + +.PHONY: release test install + +# Build + +BIN = target/release/$(PRJ) + +release: + cargo build --release + +$(BIN): release + +# Install and uninstall + +TRG = $(HOME)/.local/bin/$(PRJ) + +install: $(TRG) + +$(TRG): $(BIN) + test -d $(dir $@) + install $< $@ + +uninstall: + rm -f $(TRG) + +# Test + +test: + cargo build + cargo check + +# Clean + +clean: + rm -fr target -- 2.39.2