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
2025-03-09 20:00:18 +01:00

43 lines
1.1 KiB
Makefile

.PHONY: build
build: \
target/release/zmp24
ARCH := $(shell uname -m)
MAIN_RS_SRCS := $(shell find src -type f -regex '^.*\.rs$$') Cargo.toml \
client/dst/index.html client/dst/script.js client/dst/style.css \
config.json
SEARCH_REPLACE := lib/search_and_replace/target/release/search_and_replace
.PHONY: run
run: $(MAIN_RS_SRCS)
DB_PATH="$$(jq -r .dev.db config.json)" \
BIND_TO="$$(jq -r .dev.bind_to config.json)" \
cargo run --features dev
.PHONY: clean
clean: client_clean
cargo clean
cd lib/search_and_replace && cargo clean
rm -rf dst
dst:
mkdir dst
include client/client.mk
include image/image.mk
target/release/zmp24: $(MAIN_RS_SRCS)
DB_PATH="$$(jq -r .prod.db config.json)" \
BIND_TO="$$(jq -r .prod.sock_path config.json)" \
cargo build --release
target/$(ARCH)-unknown-linux-musl/release/zmp24: $(MAIN_RS_SRCS)
DB_PATH="$$(jq -r .prod.db config.json)" \
BIND_TO="$$(jq -r .prod.sock_path config.json)" \
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