-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (36 loc) · 1.09 KB
/
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
50
51
PREFIX=/usr/local
INSTALL_DIR=$(PREFIX)/bin
PROGRAM_SYSTEM=$(INSTALL_DIR)/fluence
OUT_DIR=$(shell pwd)/bin
PROGRAM=$(OUT_DIR)/fluence
PROGRAM_SOURCES=$(shell find src/ -type f -name '*.cr')
all: build
build: lib $(PROGRAM)
lib:
@shards install --production
$(PROGRAM): $(PROGRAM_SOURCES) | $(OUT_DIR)
@echo "Building fluence in $@"
@crystal build -o $@ src/fluence.cr -p --no-debug
$(OUT_DIR) $(INSTALL_DIR):
@mkdir -p $@
.PHONY: release run install link force_link clean distclean
release: $(PROGRAM_SOURCES) | $(OUT_DIR)
@echo "Building fluence for release in $(PROGRAM)"
@crystal build -p --no-debug --release -o $(PROGRAM) src/fluence.cr
run:
$(PROGRAM)
install: build | $(INSTALL_DIR)
@rm -f $(PROGRAM_SYSTEM)
@cp $(PROGRAM) $(PROGRAM_SYSTEM)
link: build | $(INSTALL_DIR)
@echo "Symlinking $(PROGRAM) to $(PROGRAM_SYSTEM)"
@ln -s $(PROGRAM) $(PROGRAM_SYSTEM)
force_link: build | $(INSTALL_DIR)
@echo "Symlinking $(PROGRAM) to $(PROGRAM_SYSTEM)"
@ln -sf $(PROGRAM) $(PROGRAM_SYSTEM)
clean:
rm -rf $(PROGRAM)
distclean:
rm -rf $(PROGRAM) .crystal .shards libs lib
test:
crystal s