2016-04-15 22:43:05 +00:00
|
|
|
.PHONY: setup store serve
|
2011-02-04 03:15:16 +00:00
|
|
|
|
|
|
|
NOTANGLE= notangle
|
|
|
|
NOWEAVE= noweave
|
2016-04-15 22:22:16 +00:00
|
|
|
ECHO= echo
|
|
|
|
STYLUS= ./node_modules/stylus/bin/stylus
|
2011-08-08 04:18:47 +00:00
|
|
|
HAML= haml
|
2016-04-15 22:22:16 +00:00
|
|
|
COFFEE= ./node_modules/coffee-script/bin/coffee
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-15 22:22:16 +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-15 22:22:16 +00:00
|
|
|
all: htdocs/index.html htdocs/store.js htdocs/jsonstore.css htdocs/data/items.json
|
2016-04-15 22:48:59 +00:00
|
|
|
@if [ ! -e "./htdocs/lib" ]; then \
|
|
|
|
echo "Please do 'make setup' before continuing"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2011-08-08 04:18:47 +00:00
|
|
|
|
2016-04-15 22:43:05 +00:00
|
|
|
serve: all
|
|
|
|
$(COFFEE) ./bin/autoreload
|
|
|
|
|
|
|
|
store: all
|
|
|
|
|
2016-04-15 22:22:16 +00:00
|
|
|
htdocs/lib:
|
2016-04-15 22:06:16 +00:00
|
|
|
mkdir -p htdocs/lib
|
2016-04-15 22:22:16 +00:00
|
|
|
|
|
|
|
htdocs/lib/underscore.js: htdocs/lib
|
2016-04-15 22:06:16 +00:00
|
|
|
cp bower_components/underscore/underscore.js htdocs/lib
|
2011-08-08 04:18:47 +00:00
|
|
|
|
2016-04-15 22:22:16 +00:00
|
|
|
htdocs/lib/jquery.js: htdocs/lib
|
2016-04-15 22:06:16 +00:00
|
|
|
cp bower_components/jquery/dist/jquery.js htdocs/lib
|
2011-08-08 04:18:47 +00:00
|
|
|
|
2016-04-15 22:06:16 +00:00
|
|
|
htdocs/lib/backbone.js:
|
|
|
|
cp bower_components/backbone/backbone.js htdocs/lib
|
2011-08-08 04:18:47 +00:00
|
|
|
|
2016-04-15 22:22:16 +00:00
|
|
|
install:
|
|
|
|
npm install
|
|
|
|
bower install jquery underscore backbone
|
|
|
|
|
|
|
|
setup: install $(LIBS)
|
|
|
|
|
2016-04-15 22:06:16 +00:00
|
|
|
work:
|
|
|
|
mkdir -p work
|
2011-08-08 04:18:47 +00:00
|
|
|
|
2016-04-15 22:06:16 +00:00
|
|
|
docs:
|
|
|
|
mkdir -p docs
|
|
|
|
|
2016-04-15 22:22:16 +00:00
|
|
|
work/index.haml: work src/backbonestore.nw
|
|
|
|
$(NOTANGLE) -c -Rindex.haml src/backbonestore.nw > work/index.haml
|
2016-04-15 22:06:16 +00:00
|
|
|
|
|
|
|
htdocs/index.html: htdocs work/index.haml
|
|
|
|
$(HAML) --unix-newlines --no-escape-attrs --double-quote-attribute work/index.haml > htdocs/index.html
|
|
|
|
|
|
|
|
htdocs/jsonstore.css: htdocs work/jsonstore.styl
|
|
|
|
$(STYLUS) -o htdocs work/jsonstore.styl
|
|
|
|
|
|
|
|
work/jsonstore.styl: work src/backbonestore.nw
|
|
|
|
$(NOTANGLE) -c -Rjsonstore.styl src/backbonestore.nw > work/jsonstore.styl
|
|
|
|
|
|
|
|
htdocs/store.js: htdocs work/store.coffee
|
|
|
|
$(COFFEE) -o htdocs --compile work/store.coffee
|
|
|
|
|
2016-04-15 22:22:16 +00:00
|
|
|
work/store.coffee: work src/backbonestore.nw
|
2016-04-15 22:06:16 +00:00
|
|
|
$(NOTANGLE) -c -Rstore.coffee src/backbonestore.nw > work/store.coffee
|
|
|
|
|
2016-04-15 23:54:52 +00:00
|
|
|
docs/backbonestore.tex: docs src/backbonestore.nw
|
|
|
|
${NOWEAVE} -x -delay src/backbonestore.nw > docs/backbonestore.tex
|
2011-02-04 03:15:16 +00:00
|
|
|
|
2016-04-15 23:54:52 +00:00
|
|
|
docs/backbonestore.pdf: docs/backbonestore.tex
|
|
|
|
xelatex docs/backbonestore.tex; \
|
|
|
|
while grep -s 'Rerun to get cross-references right' docs/backbonestore.log; \
|
2011-02-04 03:15:16 +00:00
|
|
|
do \
|
2016-04-15 23:54:52 +00:00
|
|
|
xelatex docs/backbonestore.tex; \
|
2011-02-04 03:15:16 +00:00
|
|
|
done
|
|
|
|
|
2016-04-15 23:54:52 +00:00
|
|
|
pdf: docs/backbonestore.pdf
|
|
|
|
|
|
|
|
docs/backbonestore.html: docs src/backbonestore.nw
|
|
|
|
${NOWEAVE} -html -x -delay src/backbonestore.nw > docs/backbonestore.html
|
|
|
|
|
|
|
|
|
2011-02-04 03:15:16 +00:00
|
|
|
clean:
|
2016-04-15 22:48:59 +00:00
|
|
|
- rm -f htdocs/*.* docs/*.tex docs/*.dvi docs/*.aux docs/*.toc docs/*.log docs/*.out
|
|
|
|
- rm -fr ./work
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
- rm -fr ./htdocs/lib
|
|
|
|
|
|
|
|
realclean: distclean
|
|
|
|
- rm -fr docs
|
2011-02-04 03:15:16 +00:00
|
|
|
|
|
|
|
|