2016-04-16 20:59:55 +00:00
|
|
|
.PHONY: setup store serve
|
2011-02-04 03:15:16 +00:00
|
|
|
|
|
|
|
NOTANGLE= notangle
|
|
|
|
NOWEAVE= noweave
|
2016-04-16 20:59:55 +00:00
|
|
|
ECHO= echo
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-16 20:59:55 +00:00
|
|
|
LIBS:= htdocs/lib/underscore.js htdocs/lib/jquery.js htdocs/lib/backbone.js
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-17 04:31:53 +00:00
|
|
|
all: htdocs/index.html htdocs/store.js htdocs/data/items.json
|
2016-04-16 20:59:55 +00:00
|
|
|
@if [ ! -e "./htdocs/lib" ]; then \
|
|
|
|
echo "Please do 'make setup' before continuing"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-16 20:59:55 +00:00
|
|
|
serve: all
|
2016-04-17 04:31:53 +00:00
|
|
|
./bin/autoreload
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-16 20:59:55 +00:00
|
|
|
store: all
|
|
|
|
|
|
|
|
htdocs/lib:
|
|
|
|
mkdir -p htdocs/lib
|
|
|
|
|
|
|
|
htdocs/lib/underscore.js: htdocs/lib
|
|
|
|
cp bower_components/underscore/underscore.js htdocs/lib
|
|
|
|
|
|
|
|
htdocs/lib/jquery.js: htdocs/lib
|
|
|
|
cp bower_components/jquery/dist/jquery.js htdocs/lib
|
|
|
|
|
|
|
|
htdocs/lib/backbone.js:
|
|
|
|
cp bower_components/backbone/backbone.js htdocs/lib
|
|
|
|
|
|
|
|
install:
|
|
|
|
npm install
|
|
|
|
./node_modules/bower/bin/bower install jquery underscore backbone
|
|
|
|
|
|
|
|
setup: install $(LIBS)
|
|
|
|
|
|
|
|
docs:
|
|
|
|
mkdir -p docs
|
|
|
|
|
|
|
|
htdocs/index.html: src/backbonestore.nw
|
2016-04-17 04:31:53 +00:00
|
|
|
$(NOTANGLE) -c -Rindex.html src/backbonestore.nw > htdocs/index.html
|
2016-04-16 20:59:55 +00:00
|
|
|
|
|
|
|
htdocs/store.js: src/backbonestore.nw
|
|
|
|
$(NOTANGLE) -c -Rstore.js src/backbonestore.nw > htdocs/store.js
|
|
|
|
|
|
|
|
docs/backbonestore.tex: docs src/backbonestore.nw
|
|
|
|
${NOWEAVE} -x -delay src/backbonestore.nw > docs/backbonestore.tex
|
|
|
|
|
|
|
|
docs/backbonestore.pdf: docs/backbonestore.tex
|
|
|
|
xelatex docs/backbonestore.tex; \
|
|
|
|
while grep -s 'Rerun to get cross-references right' ./backbonestore.log; \
|
2011-02-04 03:15:16 +00:00
|
|
|
do \
|
2016-04-16 20:59:55 +00:00
|
|
|
xelatex docs/backbonestore.tex; \
|
2011-02-04 03:15:16 +00:00
|
|
|
done
|
2016-04-16 20:59:55 +00:00
|
|
|
mv backbonestore.pdf docs
|
|
|
|
rm -f ./backbonestore.log ./backbonestore.aux ./backbonestore.out
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-16 20:59:55 +00:00
|
|
|
pdf: docs/backbonestore.pdf
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-16 20:59:55 +00:00
|
|
|
docs/backbonestore.html: docs src/backbonestore.nw
|
|
|
|
$(NOWEAVE) -filter l2h -delay -x -autodefs c -html src/backbonestore.nw > docs/backbonestore.html
|
|
|
|
|
|
|
|
html: docs/backbonestore.html
|
2011-02-04 03:15:16 +00:00
|
|
|
|
|
|
|
clean:
|
2016-04-17 04:31:53 +00:00
|
|
|
- rm -f htdocs/*.js htdocs/*.html docs/*.tex docs/*.dvi docs/*.aux docs/*.toc docs/*.log docs/*.out
|
2016-04-16 20:59:55 +00:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
- rm -fr ./htdocs/lib
|
|
|
|
|
|
|
|
realclean: distclean
|
|
|
|
- rm -fr docs
|
2011-02-04 03:15:16 +00:00
|
|
|
|
|
|
|
|