From: Gustav Eek Date: Sun, 22 Jan 2023 16:57:16 +0000 (+0100) Subject: Build. Provide fundamental building scripts X-Git-Tag: v.0.1~1 X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=c365b2f3e37370974e5a59e11d75f3ee213909a0;p=ranknauto.git Build. Provide fundamental building scripts That is Git ignore file, Cargo configuration file, and a general 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