-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMakefile
42 lines (30 loc) · 874 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
PREFIX=/usr/local
INSTALL_DIR=$(PREFIX)/bin
MICRATE_SYSTEM=$(INSTALL_DIR)/micrate
OUT_DIR=$(CURDIR)/bin
MICRATE=$(OUT_DIR)/micrate
MICRATE_SOURCES=$(shell find src/ -type f -name '*.cr')
all: build
build: lib $(MICRATE)
lib:
@shards install --production
$(MICRATE): $(MICRATE_SOURCES) | $(OUT_DIR)
@echo "Building micrate in $@"
@crystal build -o $@ src/micrate-bin.cr -p --no-debug
$(OUT_DIR) $(INSTALL_DIR):
@mkdir -p $@
run:
$(MICRATE)
install: build | $(INSTALL_DIR)
@rm -f $(MICRATE_SYSTEM)
@cp $(MICRATE) $(MICRATE_SYSTEM)
link: build | $(INSTALL_DIR)
@echo "Symlinking $(MICRATE) to $(MICRATE_SYSTEM)"
@ln -s $(MICRATE) $(MICRATE_SYSTEM)
force_link: build | $(INSTALL_DIR)
@echo "Symlinking $(MICRATE) to $(MICRATE_SYSTEM)"
@ln -sf $(MICRATE) $(MICRATE_SYSTEM)
clean:
rm -rf $(MICRATE)
distclean:
rm -rf $(MICRATE) .crystal .shards libs lib