-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 884 Bytes
/
Makefile
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
PREFIX=/usr/local
INSTALL_DIR=$(PREFIX)/bin
AZU_SYSTEM=$(INSTALL_DIR)/azu
OUT_DIR=$(CURDIR)/bin
AZU=$(OUT_DIR)/azu
SOURCE_FILE=src/azu_cli.cr
all: build | link
build: shard $(AZU)
.PHONY: shard
shard:
@echo "Building Azu CLI"
shards build --production --ignore-crystal-version
$(AZU): $(AZU_SOURCES) | $(OUT_DIR)
crystal build -o $@ $(SOURCE_FILE) -p --no-debug
$(OUT_DIR) $(INSTALL_DIR):
@mkdir -p $@
.PHONY: run
run:
$(AZU)
.PHONY: install
install: build | $(INSTALL_DIR)
rm -f $(AZU_SYSTEM)
cp $(AZU) $(AZU_SYSTEM)
.PHONY: link
link: build | $(INSTALL_DIR)
@echo "Symlinking $(AZU) to $(AZU_SYSTEM)"
ln -s $(AZU) $(AZU_SYSTEM)
.PHONY: force_link
force_link: build | $(INSTALL_DIR)
@echo "Symlinking $(AZU) to $(AZU_SYSTEM)"
ln -sf $(AZU) $(AZU_SYSTEM)
.PHONY: clean
clean:
rm -rf $(AZU)
.PHONY: distclean
distclean:
rm -rf $(AZU) .crystal .shards libs lib