-
Notifications
You must be signed in to change notification settings - Fork 84
/
Makefile
56 lines (42 loc) · 1.35 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
JSHINT=./node_modules/jshint/bin/jshint
JSHINTFLAGS=
UGLIFYJS=./node_modules/uglify-js/bin/uglifyjs
UGLIFYJSFLAGS=
LESSC=./node_modules/less/bin/lessc
LESSFLAGS=
APACHE=False
ifeq ($(APACHE), True)
PWD := $(shell pwd)
SERVER := httpd -d $(PWD) -e info -f $(PWD)/dev.conf -k start -DFOREGROUND
else
SERVER := python -m SimpleHTTPServer 4000
endif
server:
$(SERVER)
atom.xml:
./tools/atom-generator
# This only works on Rdio's internal network, you'll need to VPN in to deploy
deploy: atom.xml
-rsync -avzO -r --delete --stats --progress -e "ssh bastion ssh srv-110-06" * :/srv/apache/algorithm
-ssh bastion ssh srv-110-06 chgrp -R dev /srv/apache/algorithm/*
-ssh bastion ssh srv-110-06 chmod -R 775 /srv/apache/algorithm/*
js_files=$(shell find Components -name '*.js')
jshint: $(js_files)
$(JSHINT) $(JSHINTFLAGS) $?
%.min.js: %.js
$(UGLIFYJS) $(UGLIFYJSFLAGS) $? > $@
core_js_files=$(shell find blog -name *.js)
min_core_js_files=$(core_js_files:%.js=%.min.js)
core.js: $(min_core_js_files)
cat $^ > $@
%.css: %.less
$(LESSC) $(LESSCFLAGS) $? > $@
core_less_files=$(shell find blog -name *.less)
core.css: $(shell find blog -name *.css) $(core_less_files:%.less=%.css)
cat $^ > $@
prod: core.js core.css
watch:
watchman watch $(shell pwd)
watchman -- trigger $(shell pwd) remake *.js *.css -- make prod
clean:
rm -f core.js core.css blog/*.min.js