forked from vlead/feedback-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·75 lines (60 loc) · 1.84 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 := /bin/bash
BUILD_DIR=build
VER_BRANCH=build-release
VER_FILE=VERSION
LITERATE_TOOLS="https://github.com/vlead/literate-tools.git"
LITERATE_DIR=literate-tools
ELISP_DIR=elisp
ORG_DIR=org-templates
STYLE_DIR=style
CODE_DIR=build/code
DOC_DIR=build/docs
SRC_DIR=src
PWD=$(shell pwd)
LINT_FILE=${PWD}/${CODE_DIR}/lint_output
EXIT_FILE=${PWD}/exit.txt
STATUS=0
all: build run-py-tests
clean-literate:
rm -rf ${ELISP_DIR}
rm -rf src/${ORG_DIR}
rm -rf src/${STYLE_DIR}
pull-literate-tools:
@echo "pulling literate support code"
echo ${PWD}
ifeq ($(wildcard elisp),)
@echo "proxy is..."
echo $$http_proxy
git clone ${LITERATE_TOOLS}
mv ${LITERATE_DIR}/${ELISP_DIR} .
mv ${LITERATE_DIR}/${ORG_DIR} ${SRC_DIR}
mv ${LITERATE_DIR}/${STYLE_DIR} ${SRC_DIR}
rm -rf ${LITERATE_DIR}
else
@echo "Literate support code already present"
endif
init: pull-literate-tools
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} ${CODE_DIR}
build: init write-version
emacs --script elisp/publish.el
rsync -avz --progress ${SRC_DIR}/runtime/rest/static ${BUILD_DIR}/code/runtime/rest/
ign:
rsync -a ${SRC_DIR}/${ORG_DIR} ${BUILD_DIR}/docs
rsync -a ${SRC_DIR}/${STYLE_DIR} ${BUILD_DIR}/docs
rm -f ${BUILD_DIR}/docs/*.html~
# get the latest commit hash and its subject line
# and write that to the VERSION file
write-version:
echo -n "Built from commit: " > ${CODE_DIR}/${VER_FILE}
echo `git rev-parse HEAD` >> ${CODE_DIR}/${VER_FILE}
echo `git log --pretty=format:'%s' -n 1` >> ${CODE_DIR}/${VER_FILE}
install-pep:
sudo pip install pep8
lint: install-pep
(pep8 --ignore=E302 ${PWD}/${CODE_DIR} > ${LINT_FILE}; ([ $$? -eq 0 ] && echo "no lint errors!") || echo "lint errors exist!")
build-with-lint: build lint
run-py-tests:
export PYTHONPATH=${PWD}/${CODE_DIR}; find ${PWD}/${CODE_DIR} -name '*test_*.py' -exec python '{}' \;
clean: clean-literate
rm -rf ${BUILD_DIR}