-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
65 lines (53 loc) · 1.45 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
#SHELL := /bin/bash
BUILD_DEST=build
CODE_DEST="${BUILD_DEST}/code"
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
PWD=$(shell pwd)
LINT_FILE=${PWD}/${CODE_DIR}/lint_output
EXIT_FILE=${PWD}/exit.txt
STATUS=0
all: clean build-with-lint
clean-literate:
rm -rf ${ELISP_DIR}
rm -rf ${ORG_DIR}
rm -rf ${STYLE_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} .
mv ${LITERATE_DIR}/${STYLE_DIR} .
rm -rf ${LITERATE_DIR}
else
@echo "Literate support code already present"
endif
init: pull-literate-tools
mkdir -p ${BUILD_DEST} ${CODE_DEST}
build: init write-version
emacs --script elisp/publish.el
mkdir -p ${CODE_DEST}/src/static/temp
rm -f ${BUILD_DEST}/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_DEST}/${VER_FILE}
echo `git rev-parse HEAD` >> ${CODE_DEST}/${VER_FILE}
echo `git log --pretty=format:'%s' -n 1` >> ${CODE_DEST}/${VER_FILE}
lint:
pep8 --ignore=E302 ${PWD}/${CODE_DIR} > ${LINT_FILE};
build-with-lint: build lint
clean:
rm -rf ${BUILD_DEST}