Update build
[gitorious:ui3.git] / Makefile
1 GTS3_DEPS=js/lib/spin.js/spin.js js/lib/when/when.js js/lib/bane/lib/bane.js js/lib/reqwest/reqwest.js js/lib/uinit/lib/uinit.js js/lib/showdown/src/showdown.js js/lib/timeago/timeago.js
2
3 GTS3_UTILS=js/src/app.js js/src/cache.js js/src/json-request.js
4
5 GTS3_COMPONENTS=js/src/components/dropdown.js js/src/components/ganalytics.js js/src/components/abbrev.js js/src/components/url.js js/src/components/ref-selector.js js/src/components/tree-history.js js/src/components/commit-linker.js js/src/components/profile-menu.js js/src/components/clone-url-selection.js js/src/components/blob.js js/src/components/live-markdown-preview.js js/src/components/timeago.js js/src/components/collapse.js js/src/components/admin-menu.js js/src/components/project.js js/src/components/repository.js js/src/components/rails-links.js js/src/components/clone-name-suggestion.js js/src/components/loading.js js/src/components/oid-ref-interpolator.js js/src/components/comments.js js/src/components/slugify.js js/src/components/select-details.js js/src/components/login-button.js
6
7 CAPILLARY_SOURCES=js/lib/raphael/raphael-min.js js/src/spacer.js js/lib/capillary/lib/capillary.js js/lib/capillary/lib/capillary/branch.js js/lib/capillary/lib/capillary/graph.js js/lib/capillary/lib/capillary/formatters/scale.js js/lib/capillary/lib/capillary/formatters/svg-data.js js/lib/capillary/lib/capillary/formatters/raphael.js  js/lib/capillary/lib/capillary/formatters/message-markup.js js/src/components/capillary.js js/src/capillary.js
8
9 all: dist/gitorious3.min.css dist/gitorious3-capillary.min.js dist/gitorious3.min.js
10
11 rebuild: clean all
12
13 node_modules/.bin/uglifyjs:
14         npm install uglify-js
15
16 js/lib/culljs/dist/cull.js:
17         cd js/lib/culljs && npm install && node build -s -n
18
19 js/lib/dome/dist/dome.js:
20         cd js/lib/dome && npm install && node build -s -n
21
22 dist/gitorious3-dependencies.min.js: $(GTS3_DEPS) js/lib/culljs/dist/cull.js js/lib/dome/dist/dome.js node_modules/.bin/uglifyjs
23         cat js/lib/culljs/dist/cull.js \
24             js/lib/dome/dist/dome.js \
25             $(GTS3_DEPS) | ./node_modules/.bin/uglifyjs -m -c > dist/gitorious3-dependencies.min.js
26         du -h dist/gitorious3-dependencies.min.js
27
28 dist/gitorious3-components.min.js: $(GTS3_UTILS) $(GTS3_COMPONENTS) js/src/gitorious.js node_modules/.bin/uglifyjs
29         cat $(GTS3_UTILS) $(GTS3_COMPONENTS) js/src/gitorious.js | ./node_modules/.bin/uglifyjs -m -c > dist/gitorious3-components.min.js
30         du -h dist/gitorious3-components.min.js
31
32 dist/gitorious3.min.js: dist/gitorious3-dependencies.min.js dist/gitorious3-components.min.js
33         cat dist/gitorious3-dependencies.min.js dist/gitorious3-components.min.js > dist/gitorious3.min.js
34         du -h dist/gitorious3.min.js
35
36 dist/gitorious3-capillary.min.js: $(CAPILLARY_SOURCES) node_modules/.bin/uglifyjs
37         cat $(CAPILLARY_SOURCES) | ./node_modules/.bin/uglifyjs -m -c > dist/gitorious3-capillary.min.js
38         du -h dist/gitorious3-capillary.min.js
39
40 dist/gitorious3.min.css: css/gitorious.css css/syntax-highlight.css
41         juicer merge -f -o dist/gitorious3.min.css css/gitorious.css
42         du -h dist/gitorious3.min.css
43
44 clean:
45         rm -fr 
46         rm -fr js/lib/culljs/dist
47         rm -fr js/lib/dome/dist
48