-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
39 lines (30 loc) · 866 Bytes
/
makefile
File metadata and controls
39 lines (30 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Project name
PROJECT_NAME := FakeCrypt
# Output folder
DIST_DIR := bin
# Windows target
WINDOWS_TARGET := x86_64-pc-windows-gnu
WINDOWS_EXE := $(DIST_DIR)/$(PROJECT_NAME).exe
# Linux binary
LINUX_BIN := $(DIST_DIR)/$(PROJECT_NAME)
# Default target: build both
all: linux windows
# Ensure output directory exists
$(DIST_DIR):
mkdir -p $(DIST_DIR)
# Native Linux build
linux: $(DIST_DIR)
cargo build --release
cp target/release/$(PROJECT_NAME) $(LINUX_BIN)
strip $(LINUX_BIN)
# Windows build
windows: $(DIST_DIR)
rustup target add $(WINDOWS_TARGET)
cargo build --release --target=$(WINDOWS_TARGET)
cp target/$(WINDOWS_TARGET)/release/$(PROJECT_NAME).exe $(WINDOWS_EXE)
$(if $(shell which strip),strip $(WINDOWS_EXE),echo "strip not found, skipping...")
# Clean build artifacts
clean:
cargo clean
rm -rf $(DIST_DIR)
.PHONY: all linux windows clean