-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
66 lines (45 loc) · 1.51 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
#### General
BUILD_DIR = .build
SHELL = /bin/bash
VENV_DIR = venv
PIP = $(VENV_DIR)/bin/pip
PYTHON = $(VENV_DIR)/bin/python
PYCCO = $(VENV_DIR)/bin/pycco
all: pycco_deps test_deps build
build: pycco_deps
$(PYCCO) sockjs-protocol.py
clean:
@rm -rf $(BUILD_DIR)
@find . -name "*.pyc" -delete
#### Dependencies
venv_dir: $(VENV_DIR)
$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)
$(VENV_DIR):
virtualenv $(VENV_DIR)
$(BUILD_DIR)/pip.log: $(BUILD_DIR) requirements.txt
$(PIP) install -Ur requirements.txt | tee $(BUILD_DIR)/pip.log
$(BUILD_DIR)/pip-dev.log: $(BUILD_DIR) requirements_dev.txt
$(PIP) install -Ur requirements_dev.txt | tee $(BUILD_DIR)/pip-dev.log
pycco_deps: venv_dir $(BUILD_DIR)/pip-dev.log
test_deps: venv_dir $(BUILD_DIR)/pip.log
#### Development
serve: pycco_deps
@while [ 1 ]; do \
make build; \
sleep 0.1; \
inotifywait -r -q -e modify .; \
done
#### Deployment
upload: build
@node -v > /dev/null
[ -e ../sockjs-protocol-gh-pages ] || \
git clone `git remote -v|tr "[:space:]" "\t"|cut -f 2` \
--branch gh-pages ../sockjs-protocol-gh-pages
(cd ../sockjs-protocol-gh-pages; git pull;)
cp docs/* ../sockjs-protocol-gh-pages
(cd ../sockjs-protocol-gh-pages; git add pycco.css sockjs*html; git commit sockjs*html -m "Content regenerated";)
(cd ../sockjs-protocol-gh-pages; node generate_index.js > index.html;)
(cd ../sockjs-protocol-gh-pages; git add index.html; git commit index.html -m "Index regenerated";)
@echo ' [*] Now run:'
@echo '(cd ../sockjs-protocol-gh-pages; git push;)'