forked from hiveeyes/arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (57 loc) · 2.11 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
SHELL = bash
# ==========================================
# environment
# ==========================================
#
# Miscellaneous tools:
# Software tests, Documentation builder, Virtual environment builder
#
docs-html: virtualenv
export SPHINXBUILD="`pwd`/.venv/bin/sphinx-build"; cd doc; make html
virtualenv:
@echo Setup or update virtualenv
@test -e .venv/bin/python || `command -v virtualenv` --python=`command -v python2.7` --no-site-packages .venv
@echo Install packages from requirements-dev.txt
@.venv/bin/pip --quiet install --requirement requirements-dev.txt
# ==========================================
# releasing
# ==========================================
#
# Release targets for convenient release cutting.
#
# Synopsis::
#
# make release bump={patch,minor,major}
#
bumpversion:
.venv/bin/bumpversion $(bump)
push:
git push && git push --tags
release: virtualenv bumpversion push
# ==========================================
# ptrace.hiveeyes.org
# ==========================================
# Don't commit media assets (screenshots, etc.) to the repository.
# Instead, upload them to https://ptrace.hiveeyes.org/
ptrace_target := [email protected]:/var/www/ptrace.hiveeyes.org/htdocs/
ptrace_http := https://ptrace.hiveeyes.org/
ptrace: check-ptrace-options
$(eval prefix := $(shell date --iso-8601))
$(eval name := $(shell basename '$(source)'))
$(eval file_name := $(prefix)_$(name))
$(eval file_escaped := $(shell printf %q "$(file_name)"))
$(eval file_url := $(shell echo -n "$(file_name)" | python -c "import sys, urllib; print urllib.quote(sys.stdin.read())"))
$(eval upload_command := scp '$(source)' '$(ptrace_target)$(file_escaped)')
$(eval media_url := $(ptrace_http)$(file_url))
@# debugging
@#echo "name: $(name)"
@#echo "file_name: $(file_name)"
@#echo "file_escaped: $(file_escaped)"
@#echo "command: $(upload_command)"
$(upload_command)
@echo "Access URL: $(media_url)"
check-ptrace-options:
@if test "$(source)" = ""; then \
echo "ERROR: 'source' not set"; \
exit 1; \
fi