Create MakeFile

This commit is contained in:
ferrreo 2023-07-06 18:14:45 +01:00 committed by GitHub
parent 2f605a1480
commit 287b196ffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

40
MakeFile Normal file
View File

@ -0,0 +1,40 @@
BINARY := wayshot
BUILDFLAGS := --release
TARGET_DIR := /usr/bin
SOURCE_DIR := ./target/release
MAN1_DIR := /usr/share/man/man1
MAN7_DIR := /usr/share/man/man7
all: build
build:
@cargo build $(BUILDFLAGS)
run:
@cargo run
install: build
@mkdir -p $(TARGET_DIR)
@cp $(SOURCE_DIR)/$(BINARY) $(TARGET_DIR)
@chmod +x $(TARGET_DIR)/$(BINARY)
@find ./docs -type f -iname "*.1.gz" -exec cp {} $(MAN1_DIR) \;
@find ./docs -type f -iname "*.7.gz" -exec cp {} $(MAN7_DIR) \;
uninstall:
@rm -f $(TARGET_DIR)/$(BINARY)
@rm -f /usr/share/man/**/wayshot.*
check:
@cargo fmt
@cargo check
@cargo clippy
clean:
@cargo clean
@rm -f ./docs/*.1.gz
setup:
@rustup install stable
@rustup default stable
.PHONY: check clean setup all install build