-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (42 loc) · 1.2 KB
/
Makefile
File metadata and controls
58 lines (42 loc) · 1.2 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.PHONY: all build release install uninstall test clean
ZIG ?= zig
INSTALL_DIR ?= $(HOME)/.local/bin
NAME = zprompt
all: build
build:
$(ZIG) build
release:
$(ZIG) build -Doptimize=ReleaseFast
test:
$(ZIG) build test
install: release
@mkdir -p $(INSTALL_DIR)
@cp zig-out/bin/$(NAME) $(INSTALL_DIR)/$(NAME)
@chmod +x $(INSTALL_DIR)/$(NAME)
@echo "Installed $(NAME) to $(INSTALL_DIR)/$(NAME)"
@echo ""
@echo "Add to your ~/.zshrc:"
@echo ' eval "$$(zprompt init zsh)"'
uninstall:
@rm -f $(INSTALL_DIR)/$(NAME)
@echo "Removed $(INSTALL_DIR)/$(NAME)"
clean:
rm -rf zig-out .zig-cache
# Development helpers
run:
$(ZIG) build run
prompt:
$(ZIG) build run -- prompt --status 0 --cmd-duration 0
init-zsh:
$(ZIG) build run -- init zsh
# Cross compilation targets
build-linux-x86_64:
$(ZIG) build -Dtarget=x86_64-linux-gnu -Doptimize=ReleaseFast
build-linux-aarch64:
$(ZIG) build -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseFast
build-macos-x86_64:
$(ZIG) build -Dtarget=x86_64-macos -Doptimize=ReleaseFast
build-macos-aarch64:
$(ZIG) build -Dtarget=aarch64-macos -Doptimize=ReleaseFast
# Build all platforms
build-all: build-linux-x86_64 build-linux-aarch64 build-macos-x86_64 build-macos-aarch64