-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (29 loc) · 856 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
CRYSTAL_BIN ?= $(shell which crystal)
SHARDS_BIN ?= $(shell which shards)
FINCHER_BIN ?= $(shell which fincher)
PREFIX ?= /usr/local
RELEASE ?=
STATIC ?=
SOURCES = src/*.cr src/**/*.cr
override CRFLAGS += --error-on-warnings $(if $(RELEASE),--release ,--debug --error-trace )$(if $(STATIC),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )
.PHONY: all
all: deps parse-trace
bin/hcl_parse_test: $(SOURCES)
mkdir -p bin
$(CRYSTAL_BIN) build $(CRFLAGS) -o bin/hcl_parse_test src/hcl_parse_test.cr
.PHONY: parse-trace
parse-trace: bin/hcl_parse_test
bin/hcl_parse_test > trace.txt
.PHONY: deps
deps:
$(SHARDS_BIN) check || $(SHARDS_BIN) install
.PHONY: clean
clean:
rm -rf ./bin/*
rm -rf ./dist
.PHONY: test
test: deps $(SOURCES)
$(CRYSTAL_BIN) tool format --check
$(CRYSTAL_BIN) spec $(CRFLAGS)
.PHONY: spec
spec: test