-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (32 loc) · 1.14 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
CRYSTAL_BIN = $(shell which crystal)
SHARDS_BIN = $(shell which shards)
PREFIX = $(HOME)
EXEC = "mymodern"
build:
$(SHARDS_BIN) build
build_release:
$(SHARDS_BIN) build --release
# The 'list' target displays all the available targets and their descriptions in
# the current Makefile. It uses the $(firstword $(MAKEFILE_LIST)) expression to
# get the name of the current Makefile, and then searches for lines starting with
# a word character followed by a colon (target names).
# The grep -v '^#' filters out any lines starting with '#' (comments) that are
# commented out tasks. The -A 1 option lists the line that comes after the matched
# target as well, either the command or a descriptive comment for the task.
list:
@grep -A 1 "^\w\+:" $(firstword $(MAKEFILE_LIST)) | grep -v '^#'
format:
$(CRYSTAL_BIN) tool format -e lib
test:
$(CRYSTAL_BIN) spec
diff_mock:
# compare bin/$(EXEC) --mock with fixture
@ bin/$(EXEC) -m > tmp_result
@if cmp -s tmp_result spec/fixtures/mock_expected; then \
echo "files are the same"; \
else \
echo "*******************"; \
echo "files are different"; \
echo "*******************"; \
fi
@rm tmp_result