-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (74 loc) · 2.29 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Makefile for Development and Production Builds of Nani
.PHONY: repl fig-dev-ui watch-css
.PHONY: build build-ui build-server build-css
.PHONY: run
.PHONY: test deps check
.PHONY: clean clean-all
.PHONY: help
# Leiningen Batch file won't work on windows
# Need to call it from cmd.exe explicitly
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
LEIN_CMD = lein
else
ifeq ($(UNAME), Darwin)
LEIN_CMD = lein
else
LEIN_CMD = lein.bat
endif
endif
help:
@echo "Nani Development and Production Build Makefile"
@echo ""
@echo "Development Commands:"
@echo " repl :: Start Clojure Development Repl"
@echo " fig-dev-ui :: Start and Watch Figwheel UI Build."
@echo " watch-css :: Start and Watch CSS Stylesheet Generation (Less)"
@echo ""
@echo "Production Commands:"
@echo " build :: Perform Production Build of Nani"
@echo " --"
@echo " build-ui :: Perform Production Build of UI Only"
@echo " build-server :: Generates UberJar of Server"
@echo " build-css :: Builds CSS Stylesheets Once"
@echo " --"
@echo " run :: Run Production Server"
@echo ""
@echo "Testing Commands:"
@echo " test :: Run Server Tests"
@echo ""
@echo "Misc Commands:"
@echo " deps :: Pull and Install all dependencies"
@echo " check :: Checks the status of required pre-requisites"
@echo " clean :: Clean out build artifacts"
@echo " clean-all :: Clean out more build artifacts"
@echo " help :: Display this help message"
repl:
$(LEIN_CMD) repl
fig-dev-ui:
$(LEIN_CMD) figwheel
watch-css:
less-watch-compiler resources/public/less resources/public/css main.less
build: build-css build-ui build-server
build-ui:
$(LEIN_CMD) cljsbuild once prod
build-server:
$(LEIN_CMD) uberjar
build-css:
lessc resources/public/less/main.less resources/public/css/main.css
run:
$(LEIN_CMD) run
test:
$(LEIN_CMD) test
deps:
$(LEIN_CMD) deps
npm install less
npm install less-watch-compiler
check:
@sh ./scripts/check_prerequisites.sh
clean:
$(LEIN_CMD) clean
rm -f ./nani.db
rm -rf ./resources/public/css
clean-all: clean
rm -rf node_modules