Skip to content
This repository
tree: ed2a4a86fa
Fetching contributors…

Cannot retrieve contributors at this time

file 75 lines (65 sloc) 3.279 kb
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 75
wrap-jquery = ./wrap-jquery
all-css = static/all.css
all-js = static/all.js
all-min-css = static/all.min.css
all-min-js = static/all.min.js
colorpicker = static/colorpicker/js/colorpicker.js
compute_server = static/compute_server.js
jmol = static/jmol
jmol-js = $(jmol)/appletweb/Jmol.js
jquery = static/jquery.min.js
jquery-ui = static/jquery-ui/js/jquery-ui-1.8.21.custom.min.js
sagecell = static/sagecell.js
sagecell-css = static/sagecell.css
sockjs-client = static/sockjs.js
codemirror-css = submodules/codemirror/lib/codemirror.css
codemirror = submodules/codemirror/lib/codemirror.js
cm-python-mode = submodules/codemirror/mode/python/python.js
cm-xml-mode = submodules/codemirror/mode/xml/xml.js
cm-html-mode = submodules/codemirror/mode/htmlmixed/htmlmixed.js
cm-js-mode = submodules/codemirror/mode/javascript/javascript.js
cm-css-mode = submodules/codemirror/mode/css/css.js
cm-r-mode = submodules/codemirror/mode/r/r.js
jquery-ui-tp = submodules/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js
cssmin = submodules/cssmin/src/cssmin.py
jsmin = submodules/jsmin/jsmin.c
jsmin-bin = submodules/jsmin-bin
wrap-js = static/wrap.js
sage-root := $(shell [ -n "$$SAGE_ROOT" ] && echo "$$SAGE_ROOT" || sage --root || echo "\$$SAGE_ROOT")
ip-js = $(shell python -c "import os,IPython; print '/'+os.path.join(*IPython.__file__.split(os.sep)[:-1]+'frontend/html/notebook/static/js'.split(os.sep))")
ip-namespace = $(ip-js)/namespace.js
ip-events = $(ip-js)/events.js
ip-utils = $(ip-js)/utils.js
ip-kernel = $(ip-js)/kernel.js
jquery-url = http://code.jquery.com/jquery-1.7.2.min.js
sockjs-url = http://cdn.sockjs.org/sockjs-0.3.js
jmol-sage = $(sage-root)/local/share/jmol

all: submodules $(jquery) $(all-min-js) $(all-min-css)

.PHONY: submodules
submodules:
if git submodule status | grep -q ^[+-]; then git submodule update --init > /dev/null; fi

$(jquery):
python -c "import urllib; urllib.urlretrieve('$(jquery-url)', '$(jquery)')"

$(all-min-js): $(jsmin-bin) $(all-js)
$(jsmin-bin) < $(all-js) > $(all-min-js)

$(all-js): $(ip-namespace) $(wrap-js) $(codemirror) $(cm-python-mode) \
           $(cm-xml-mode) $(cm-html-mode) $(cm-js-mode) $(cm-css-mode) \
           $(cm-r-mode) $(jmol-js) $(sockjs-client) $(compute_server) $(sagecell)
cat $(codemirror) $(cm-python-mode) $(cm-xml-mode) $(cm-html-mode) \
$(cm-js-mode) $(cm-css-mode) $(cm-r-mode) $(jmol-js) $(ip-namespace) \
$(wrap-js) > $(all-js)
echo ';' >> $(all-js)
cat $(sockjs-client) $(compute_server) $(sagecell) >> $(all-js)

$(wrap-js): $(wrap-jquery) $(ip-events) $(ip-utils) $(ip-kernel) \
            $(jquery-ui) $(jquery-ui-tp) $(colorpicker)
cat $(ip-events) $(ip-utils) $(ip-kernel) $(jquery-ui) $(jquery-ui-tp) \
$(colorpicker) | $(wrap-jquery) > $(wrap-js)

$(all-min-css): $(codemirror-css) $(sagecell-css)
cat $(codemirror-css) $(sagecell-css) | python $(cssmin) > $(all-min-css)

$(jsmin-bin): $(jsmin)
gcc -o $(jsmin-bin) $(jsmin)

$(jmol-js): $(jmol-sage)
rm -f $(jmol)
ln -s $(jmol-sage) $(jmol)

$(sockjs-client):
python -c "import urllib; urllib.urlretrieve('$(sockjs-url)', '$(sockjs-client)')"
Something went wrong with that request. Please try again.