|
1 | 1 | ifeq ($(OS),Windows_NT)
|
2 | 2 | export NODE_PATH=$(APPDATA)/npm/node_modules
|
| 3 | +cp = copy /y $(subst /,\,$1) $(subst /,\,$2) |
| 4 | +else |
| 5 | +cp = cp $1 $2 |
3 | 6 | endif
|
4 | 7 |
|
5 |
| -all: js css |
| 8 | +all: js css bower_copy |
6 | 9 |
|
7 | 10 | # Rules to minify our .js files
|
8 | 11 | js: js/jsonl.min.js
|
9 |
| -%.min.js: %.js |
| 12 | +js/%.min.js: js/%.js |
10 | 13 | uglifyjs "$^" > "$@"
|
11 | 14 | js/%.js: %.grammar.js
|
12 | 15 | node "$^" > "$@"
|
13 | 16 |
|
14 | 17 | .PRECIOUS: js/%.js
|
15 | 18 |
|
| 19 | +# Rules to copy stuff from bower_components to our folders |
| 20 | +bower_copy: |
| 21 | +.PHONY: bower_copy |
| 22 | +_BOWER_DIR[.js] = js |
| 23 | +_BOWER_DIR[.css] = css |
| 24 | +_BOWER_DIR[*] = fonts |
| 25 | +_BOWER_TARGET = $(or $(_BOWER_DIR[$(suffix $(1))]),$(_BOWER_DIR[*]))/$(notdir $(1)) |
| 26 | +define _BOWER |
| 27 | +bower_copy: $(call _BOWER_TARGET,$(1)) |
| 28 | +$(call _BOWER_TARGET,$(1)): $1 |
| 29 | + $$(call cp,"$$<","$$@") |
| 30 | +endef |
| 31 | +BOWER = $(eval $(call _BOWER,$1,$2)) |
| 32 | + |
| 33 | +# Bootstrap |
| 34 | +$(call BOWER,bower_components/bootstrap/dist/css/bootstrap.min.css) |
| 35 | +$(call BOWER,bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot) |
| 36 | +$(call BOWER,bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg) |
| 37 | +$(call BOWER,bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf) |
| 38 | +$(call BOWER,bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff) |
| 39 | +$(call BOWER,bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2) |
| 40 | +# FontAwesome |
| 41 | +$(call BOWER,bower_components/fontawesome/css/font-awesome.min.css) |
| 42 | +$(call BOWER,bower_components/fontawesome/fonts/fontawesome-webfont.ttf) |
| 43 | +$(call BOWER,bower_components/fontawesome/fonts/fontawesome-webfont.eot) |
| 44 | +$(call BOWER,bower_components/fontawesome/fonts/fontawesome-webfont.svg) |
| 45 | +$(call BOWER,bower_components/fontawesome/fonts/fontawesome-webfont.woff) |
| 46 | +$(call BOWER,bower_components/fontawesome/fonts/fontawesome-webfont.woff2) |
| 47 | +# JQeury & Angular stuff |
| 48 | +$(call BOWER,bower_components/jquery/jquery.min.js) |
| 49 | +$(call BOWER,bower_components/angular/angular.min.js) |
| 50 | +$(call BOWER,bower_components/angular-bootstrap-colorpicker/css/colorpicker.min.css) |
| 51 | +$(call BOWER,bower_components/angular-sanitize/angular-sanitize.min.js) |
| 52 | +$(call BOWER,bower_components/angular-ui-utils/components/angular-ui-docs/build/ui-utils.min.js) |
| 53 | +$(call BOWER,bower_components/ng-file-upload/ng-file-upload.min.js) |
| 54 | +$(call BOWER,bower_components/angular-native-dragdrop/draganddrop.js) |
| 55 | +$(call BOWER,bower_components/angular-ui-bootstrap/dist/ui-bootstrap-tpls-0.12.0.min.js) |
| 56 | +$(call BOWER,bower_components/angular-bootstrap-colorpicker/js/bootstrap-colorpicker-module.min.js) |
| 57 | +# Misc |
| 58 | +$(call BOWER,bower_components/hint.css/hint.min.css) |
| 59 | +$(call BOWER,bower_components/crypto-js/crypto-js.js) |
| 60 | +$(call BOWER,bower_components/marked/marked.min.js) |
| 61 | +$(call BOWER,bower_components/FileSaver/FileSaver.min.js) |
| 62 | +$(call BOWER,bower_components/doT/doT.min.js) |
| 63 | +$(call BOWER,bower_components/URLON/src/urlon.js) |
| 64 | + |
16 | 65 |
|
17 | 66 | # Rules to run Stylus on our .css files
|
18 | 67 | css: css/kb.css
|
@@ -54,10 +103,7 @@ test:
|
54 | 103 |
|
55 | 104 | install:
|
56 | 105 | bower install
|
57 |
| - cd bower_components/angular-ui-bootstrap |
58 |
| - npm install |
59 |
| - grunt before-test after-test |
60 |
| - cd ../angular-ui-utils |
61 |
| - npm install |
62 |
| - grunt build |
63 |
| - cd ../.. |
| 106 | + cd bower_components/angular-ui-bootstrap & npm install |
| 107 | + cd bower_components/angular-ui-bootstrap & grunt before-test after-test |
| 108 | + cd bower_components/angular-ui-utils & npm install |
| 109 | + cd bower_components/angular-ui-utils & grunt build |
0 commit comments