-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
169 lines (127 loc) · 4.38 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
.DEFAULT_GOAL = run
program = run.py
dir_name = $${PWD\#\#*/}
runenv = . env/bin/activate
python = $(runenv) && python
pip_install = $(runenv) && pip install
gempath = ./gems
gembin = $(gempath)/bin
use_gempath = export GEM_HOME=$(gempath)
csspath = static/css
scsspath = static/scss
sasspaths = $(scsspath):$(csspath)
sasscmd = $(gembin)/sass
bbfoldername = bourbon_files
bbpath = $(scsspath)/$(bbfoldername)
nmodulespath = ./node_modules
bowerpath = ./bower_components
bowercmd = $(nmodulespath)/bower/bin/bower
jspath = static/js
coffeepaths = $(jspath) static/coffee
coffeeoptions = --map --compile --output
coffeecmd = $(nmodulespath)/coffee-script/bin/coffee
sub_target =
sub_make_resources = export coffeecmd="$$(readlink -e $(coffeecmd))" && \
export sasscmd="$$(readlink -e $(sasscmd))" && \
export GEM_HOME="$$(readlink -e $(gempath))"
make_iterate_over_d = for d in */ ; \
do if [ -f "$$d/makefile" ]; then \
$(MAKE) -C "$$d" --no-print-directory $(sub_target); \
fi \
done
VPATH = static $(gembin) $(scsspath) $(nmodulespath) \
$(jspath) env/lib/python3.4/site-packages \
make_empty_targets $(csspath)
doc_path = doc
green = \033[0;32m
nc = \033[0m
make_empty_targets:
mkdir make_empty_targets
dependencies: | make_empty_targets
sudo apt-get update
sudo apt-get install python3 python3-dev \
build-essential ruby npm curl \
screen nodejs-legacy
touch make_empty_targets/dependencies
virtualenv: | dependencies
url=$$(./get_venv_url.py) && \
mkdir $@ && \
curl $$url | tar xvfz - -C $@ --strip-components=1
env: | dependencies virtualenv
cd virtualenv && \
python3 virtualenv.py --python=python3 ../env
tornado: | env
$(pip_install) $@
sphinx: | env
$(pip_install) Sphinx
sass bourbon: | dependencies
$(use_gempath) && gem install --no-ri --no-rdoc $@
$(bbfoldername): bourbon
$(use_gempath) && $(gembin)/bourbon install \
--path=$(scsspath)
mv $(scsspath)/bourbon $(bbpath)
css: scss | $(bbfoldername) sass
$(use_gempath) && $(sasscmd) --update $(sasspaths)
coffee-script bower: | dependencies
npm install $@
normalize.css: | css bower
$(bowercmd) install $@
cd $(csspath) && ln -s ../../$(bowerpath)/$@/$@ $@
reconnecting-websocket.js: | bower js
$(bowercmd) install reconnectingWebsocket
cd $(jspath) && ln -s ../../$(bowerpath)/reconnectingWebsocket/$@ $@
js: coffee | coffee-script
$(coffeecmd) $(coffeeoptions) $(coffeepaths)
.PHONY: run python srun drun testenv attach csswatch dcsswatch \
jswatch djswatch clean panels notifications locking_panels \
controls autodoc clean_doc
run_py_deps = tornado
run: $(run_py_deps) dependencies css js reconnecting-websocket.js normalize.css panels notifications locking_panels controls
$(python) -i $(program)
python: dependencies
$(python)
srun:
screen -S $(dir_name) $(MAKE) run
drun:
screen -d -m -S $(dir_name) $(MAKE) run
panels notifications locking_panels controls: coffee-script sass $(bbfoldername)
@echo "$(green)Executing makefiles in $@ ...$(nc)"
@$(sub_make_resources) && \
cd $@ && \
$(make_iterate_over_d)
testenv: env
$(python) -V
attach:
screen -r $(dir_name)
#Upstream Merge
upsm:
git pull --no-commit --no-rebase cganterh.net:git/tornadoBoiler.git
csswatch: scss $(bbfoldername) sass
$(use_gempath) && $(sasscmd) --watch $(sasspaths)
dcsswatch:
screen -d -m -S $(dir_name)_sass $(MAKE) csswatch
jswatch:
$(nmodulespath)/coffee-script/bin/coffee --watch $(coffeeoptions) $(coffeepaths)
djswatch:
screen -d -m -S $(dir_name)_coffee $(MAKE) jswatch
autodoc: $(run_py_deps) sphinx
$(runenv) && \
dir_name=$(dir_name) && \
cd .. && \
sphinx-apidoc --separate -f -o $$dir_name/$(doc_path) $$dir_name
$(runenv) && \
cd $(doc_path) && \
$(MAKE) html
clean_doc: sphinx
$(runenv) && cd $(doc_path) && $(MAKE) clean
cd $(doc_path) && \
find . -maxdepth 1 -type f ! -regex '.*\(index.rst\|todo.rst\|conf.py\|[mM]akefile\)' -delete
clean: sub_target = clean
clean: clean_doc
rm -rf $(bowerpath) env $(nmodulespath) \
__pycache__ $(csspath) $(jspath) $(gempath) \
log.log $(bbpath) virtualenv temp
-cd panels && $(make_iterate_over_d)
-cd notifications && $(make_iterate_over_d)
-cd locking_panels && $(make_iterate_over_d)
-cd controls && $(make_iterate_over_d)