-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
72 lines (54 loc) · 2.04 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Some inspiration: https://github.com/git/git/blob/master/Makefile
# More inspiration: https://clarkgrubb.com/makefile-style-guide
SHELL = /bin/bash
src-clj = $(shell find src/ -type f -name '*.clj' -or -name '*.cljc' -or -name '*.edn')
src-cljs = $(shell find src/ -type f -name '*.cljs' -or -name '*.cljc' -or -name '*.clj' -or -name '*.edn')
srcfiles = $(src-clj) $(src-cljs)
test-clj = $(shell find test/ -type f -name '*.clj' -or -name '*.cljc' -or -name '*.edn')
test-cljs = $(shell find test/ -type f -name '*.cljs' -or -name '*.cljc' -or -name '*.clj' -or -name '*.edn')
testfiles = $(test-clj) $(test-cljs)
target = ./target
# This is the default target because it is the first real target in this Makefile
.PHONY: default # Same as "make ci"
default: ci
.PHONY: assert-clean # Fail if the git repo is dirty (untracked files, modified files, or files are in the index)
assert-clean:
ifeq ($(DRO),true)
@echo "Skipping dirty repo check"
else
@test -z "$$(git status --porcelain)"
endif
.PHONY: ci
ci: assert-clean
clojure -T:build ci
.PHONY: test # Run the Clojure and ClojureScript test suites
test: test-clj test-cljs
.PHONY: test-clj
test-clj: .make.test-clj
.PHONY: test-cljs
test-cljs: .make.test-cljs
.make.test-clj: deps.edn $(testfiles) $(srcfiles)
clojure -X:test:project/test-clj
touch .make.test-clj
.make.test-cljs: deps.edn $(testfiles) $(srcfiles)
clojure -M:test:project/test-cljs
touch .make.test-cljs
lint: $(testfiles) $(srcfiles)
clojure -T:build lint
format: $(testfiles) $(srcfiles)
clojure -T:build ensure-format
$(target)/:
mkdir -p $@
install: ci
clojure -T:build install
deploy: ci
clojure -T:build deploy
clean:
rm -f $(jar-file) $(pom-file)
rm -rf target/*
rm -rf cljs-test-runner-out
rm -f .make.*
# Copied from: https://github.com/jeffsp/makefile_help/blob/master/Makefile
# Tab nonesense resolved with help from StackOverflow... need a literal instead of the \t escape on MacOS
help: # Generate list of targets with descriptions
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20