Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
madhavipuliraju committed Feb 20, 2017
2 parents c078d77 + 1ede5eb commit 52f2293
Show file tree
Hide file tree
Showing 17 changed files with 14,235 additions and 3,011 deletions.
1 change: 1 addition & 0 deletions elisp
15 changes: 15 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

if [ -d literate-tools ]; then
echo "literate-tools already present"
(cd literate-tools; git pull)
else
git clone https://github.com/vlead/literate-tools.git
fi

if [ -L tangle-make ]; then
echo "symlinked makefile already present"
else
ln -sf literate-tools/makefile tangle-make
fi

61 changes: 9 additions & 52 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,75 +1,32 @@
#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


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}
init:
./init.sh

build: init
make -f tangle-make -k all
#cp -r src/runtime/implementation/static ${CODE_DIR}/runtime/implementation
#cp -r src/images ${DOC_DIR}/images
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!")
pep8 --ignore=E302 ${PWD}/${CODE_DIR} > ${LINT_FILE};

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}
clean:
make -f tangle-make clean

Loading

0 comments on commit 52f2293

Please sign in to comment.