-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 747 Bytes
/
Makefile
File metadata and controls
39 lines (27 loc) · 747 Bytes
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
SHELL = /bin/bash
LINK_FLAGS = --link-flags "-static"
SRCS = ${wildcard examples/*.cr}
PROGS = $(SRCS:examples/%.cr=%)
.PHONY : all static examples clean bin hello hello-static spec test
.PHONY : ${PROGS}
all: build
test: check_version_mismatch build examples spec
static: hello-static
build: bin ${PROGS}
bin:
@mkdir -p bin
hello: examples/hello.cr
crystal build $^ -o bin/$@
hello-static: examples/hello.cr
crystal build $^ -o bin/$@ ${LINK_FLAGS}
spec:
crystal spec -v
examples:
@for x in examples/*.cr ; do\
crystal build "$$x" -o /dev/null ;\
done
clean:
@rm -rf bin
.PHONY : check_version_mismatch
check_version_mismatch: shard.yml README.md
diff -w -c <(grep version: README.md | head -1) <(grep ^version: shard.yml)