-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (38 loc) · 943 Bytes
/
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
TARGETS=index.html api.html api.css api.js
[email protected]:/var/www/dev.buildbotics.com/
DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
TARGETS := $(patsubst %,http/%,$(TARGETS))
WATCH := src
NODE_MODS := $(DIR)/node_modules
STYLUS := $(NODE_MODS)/stylus/bin/stylus
JADE := $(DIR)/jade.js
all: $(TARGETS)
http/index.html: http/api.html
ln -sf $(shell basename $<) $@
http/%.html: src/%.jade node_modules http
$(JADE) $< >$@ || rm $@
http/%.css: src/%.styl node_modules http
$(STYLUS) < $< >$@ || rm $@
http/%.js: src/%.js http
install $< $@
http:
mkdir $@
publish:
rsync -av --exclude=*~ http/ $(DEST)
node_modules:
npm install
watch:
@clear
$(MAKE)
@while sleep 1; do \
inotifywait -qr -e modify -e create -e delete \
--exclude .*~ --exclude \#.* $(WATCH); \
clear; \
$(MAKE); \
done
tidy:
rm -f $(shell find . -name \*~)
clean: tidy
rm -rf http
dist-clean: clean
rm -rf node_modules