-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (70 loc) · 2.14 KB
/
Makefile
File metadata and controls
94 lines (70 loc) · 2.14 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
VERSION := 0.1.0
R := https://github.com/makeplus/makes
M := .cache/makes
$(shell [ -d '$M' ] || git clone -q $R '$M')
include $M/init.mk
include $M/bun.mk
include $M/graalvm.mk
include $M/clojure.mk
include $M/clean.mk
include $M/shell.mk
UBER-JAR := target/mandy-$(VERSION)-standalone.jar
MAKES-CLEAN := mandy
MAKES-REALCLEAN := dist bin release .cpcache
MAKES-DISTCLEAN := node_modules
build: mandy-cli mandy-ui
jar: $(UBER-JAR)
# 1. Clojure Component (Native Image)
mandy-cli: mandy
# 2. TUI Component (Compiled Bun Binary)
mandy-ui: $(BUN)
bun install
bun run build
mandy: $(UBER-JAR) $(GRAALVM)
native-image \
-jar $< \
mandy \
--no-fallback \
--initialize-at-build-time \
-H:+UnlockExperimentalVMOptions \
-H:IncludeResources=base.ys \
-H:+ReportExceptionStackTraces
@echo "Created mandy native binary"
$(UBER-JAR): $(CLOJURE) src/clj/mandy/main.clj plugins/base.clj plugins/base.ys
rm -rf target/uber target/classes
mkdir -p target/uber target/classes
cp plugins/* target/classes/
clojure -M -e "(binding [*compile-path* \"target/classes\"] (compile 'mandy.main))"
for j in $$(clojure -Spath | tr ':' '\n' | grep '\.jar$$'); do \
(cd target/uber && jar xf "$$j"); \
done
cp -r target/classes/* target/uber/
jar cfe $@ mandy.main -C target/uber .
rm -rf target/uber target/classes
zsh-shell: mandy-ui
ZDOTDIR=$$PWD zsh -is eval "source .mandyrc"
clean::
rm -rf target
rm -f mandy
test: test-debug test-sanitized test-tokens test-tui-select test-tui-quit test-tui-search
test-debug: $(CLOJURE)
clojure -M -m mandy.main pwd --debug
test-sanitized: $(CLOJURE)
clojure -M -m mandy.main pwd --strip
test-tokens: $(CLOJURE)
clojure -M -m mandy.main ls --debug | ys -J -
test-tui-select: mandy-ui $(BUN)
@util/make test-tui-select
test-tui-quit: mandy-ui $(BUN)
@util/make test-tui-quit
test-tui-search: mandy-ui $(BUN)
@util/make test-tui-search
debug-tui: mandy-ui $(BUN)
@CMD=$(or $(CMD),ls) util/make debug-tui
debug-payload:
@CMD=$(or $(CMD),ls) util/make debug-payload
run-tui: mandy-ui $(BUN)
@util/make run-tui
# 3. Release Orchestration
release-all: clean $(BUN)
@VERSION=$(VERSION) util/make release-all