|
1 |
| -PROJECT_NAME := $(shell cargo read-manifest --manifest-path ./server/Cargo.toml | jq -r ".name") |
2 |
| -PROJECT_VER := $(shell cargo read-manifest --manifest-path ./server/Cargo.toml | jq -r ".version") |
3 |
| -BIN_DIR := ./bin |
4 |
| -STATIC_DIR := ./client/dist |
5 |
| -PROJECT_SRCS := $(shell find server/src -type f -iname *.rs) \ |
6 |
| - $(shell find server/src -type f -iname *.html) \ |
7 |
| - ./server/Cargo.toml \ |
8 |
| - ./server/Cargo.lock |
9 |
| -STATIC_SRCS := client/package.json \ |
10 |
| - client/pnpm-lock.yaml \ |
11 |
| - client/tailwind.config.js \ |
12 |
| - client/src/style.css \ |
13 |
| - $(shell find client/src -type f -iname *.js) \ |
14 |
| - $(shell find client/static -type f) \ |
15 |
| - $(shell find server/src -type f -iname *.html) |
16 |
| -STATIC_OBJS := $(addprefix $(BIN_DIR)/static/,index.js style.css icon.svg) |
17 |
| -DIST_DIR = $(BIN_DIR)/dist |
18 |
| -DOCKER_TEMPLATE = ./containers/Dockerfile.template |
19 |
| -PACK_TARGETS = x86-64-musl \ |
20 |
| - x86-64-v3-musl \ |
21 |
| - x86-64-v4-musl \ |
22 |
| - aarch64-musl \ |
23 |
| - aarch64-gnu \ |
24 |
| - armv6-musleabi \ |
25 |
| - armv7-musleabi \ |
26 |
| - riscv64gc-gnu |
27 |
| - |
28 |
| -fn_output_path = $(BIN_DIR)/$(1)/$(PROJECT_NAME) |
29 |
| -fn_target_path = server/target/$(1)/$(PROJECT_NAME) |
| 1 | +PROJECT_NAME := $(shell cargo read-manifest --manifest-path ./server/Cargo.toml | jq -r ".name") |
| 2 | +PROJECT_VER := $(shell cargo read-manifest --manifest-path ./server/Cargo.toml | jq -r ".version") |
| 3 | +BIN_DIR := ./bin |
| 4 | +STATIC_DIR := ./client/dist |
| 5 | +NODE_MODULES_DIR := ./client/node_modules |
| 6 | +PROJECT_SRCS := $(shell find server/src -type f -iname *.rs) \ |
| 7 | + $(shell find server/src -type f -iname *.html) \ |
| 8 | + ./server/Cargo.toml \ |
| 9 | + ./server/Cargo.lock |
| 10 | +STATIC_SRCS := client/package.json \ |
| 11 | + client/pnpm-lock.yaml \ |
| 12 | + client/tailwind.config.js \ |
| 13 | + client/src/style.css \ |
| 14 | + $(shell find client/src -type f -iname *.js) \ |
| 15 | + $(shell find client/static -type f) \ |
| 16 | + $(shell find server/src -type f -iname *.html) |
| 17 | +STATIC_OBJS := $(addprefix $(BIN_DIR)/static/,index.js style.css icon.svg) |
| 18 | +DIST_DIR = $(BIN_DIR)/dist |
| 19 | +DOCKER_TEMPLATE = ./containers/Dockerfile.template |
| 20 | +PACK_TARGETS = x86-64-musl \ |
| 21 | + x86-64-v3-musl \ |
| 22 | + x86-64-v4-musl \ |
| 23 | + aarch64-musl \ |
| 24 | + aarch64-gnu \ |
| 25 | + armv6-musleabi \ |
| 26 | + armv7-musleabi \ |
| 27 | + riscv64gc-gnu |
| 28 | + |
| 29 | +fn_output_path = $(BIN_DIR)/$(1)/$(PROJECT_NAME) |
| 30 | +fn_target_path = server/target/$(1)/$(PROJECT_NAME) |
30 | 31 |
|
31 | 32 | # RECIPIES:
|
32 | 33 | # ==============================================================================
|
@@ -235,6 +236,7 @@ generate-dockerfiles:
|
235 | 236 | clean:
|
236 | 237 | @echo "Cleaning artifacts"
|
237 | 238 | @cd server && cargo clean
|
238 |
| - @test -d $(BIN_DIR) && rm -r $(BIN_DIR) |
239 |
| - @test -d $(STATIC_DIR) && rm -r $(STATIC_DIR) |
| 239 | + @if [ -d "$(BIN_DIR)" ]; then rm -r "$(BIN_DIR)"; fi; |
| 240 | + @if [ -d "$(STATIC_DIR)" ]; then rm -r "$(STATIC_DIR)"; fi; |
| 241 | + @if [ -d "$(NODE_MODULES_DIR)" ]; then rm -r "$(NODE_MODULES_DIR)"; fi; |
240 | 242 | @echo "Clean completed"
|
0 commit comments