Archived
3
0
This repository has been archived on 2025-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zmp24-docs/Makefile
Ondřej Mekina 5513042b1b
Some checks failed
Check indentation / build (push) Has been cancelled
Continuous testing / build (push) Has been cancelled
extract config to external files
2025-03-12 23:08:40 +01:00

56 lines
1.2 KiB
Makefile

.PHONY: build
build: \
target/release/zmp24
ARCH := $(shell uname -m)
FILES_RS := $(shell find src -type f -regex '^.*\.rs$$')
FILES_CLIENT := client/dst/index.html client/dst/script.js client/dst/style.css
MAIN_RS_SRCS := $(FILES_RS) $(FILES_CLIENT) Cargo.toml
SEARCH_REPLACE := lib/search_and_replace/target/release/search_and_replace
.PHONY: run
run: $(MAIN_RS_SRCS) dst/dev_config.toml
cargo run --features dev -- dst/dev_config.toml
.PHONY: test
test: target/debug/zmp24
cargo test
.PHONY: test_tabs
test_tabs:
@for file in $(FILES_RS); do \
echo -n "$$file ... "; \
if grep -Eq '^\s* ' "$$file"; then \
echo "fail"; \
exit 1; \
fi; \
echo "ok"; \
done
.PHONY: clean
clean: client_clean
cargo clean
cd lib/search_and_replace && cargo clean
rm -rf dst
dst:
mkdir dst
include lib/config.mk
include client/client.mk
include image/image.mk
target/release/zmp24: $(MAIN_RS_SRCS)
cargo build --release
target/debug/zmp24: $(MAIN_RS_SRCS)
cargo build
target/$(ARCH)-unknown-linux-musl/release/zmp24: $(MAIN_RS_SRCS)
cargo build --target $(ARCH)-unknown-linux-musl --release
$(SEARCH_REPLACE): lib/search_and_replace/src/main.rs lib/search_and_replace/Cargo.toml
cd lib/search_and_replace && cargo build --release