forked from jgraichen/redmine_dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (50 loc) · 1.63 KB
/
Makefile
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
SHELL := /bin/bash
RUBY := ruby
NODE := node
SASS := bundle exec sass
BROWSERIFY := $(NODE) node_modules/.bin/browserify
EXORCIST := $(NODE) node_modules/.bin/exorcist
UGLIFYJS := $(NODE) node_modules/.bin/uglifyjs
SOURCE := app/assets
BUILD := assets
SASS_CMD := $(SASS) -rbourbon -Inode_modules -I$(SOURCE)
BROWSERIFY_CMD := $(BROWSERIFY) -i jquery -t coffeeify --extension=".coffee" -t browserify-data -t envify
REDMINE_VERSION := ${REDMINE_VERSION:-2.6.0}
SOURCE = app/assets
BUILD = assets
.PHONY: default
default: build
.PHONY: all
all: build min
.PHONY: js
js: $(BUILD)/main.js
.PHONY: css
css: fonts $(BUILD)/main.css
$(BUILD):
mkdir -p $(BUILD)
.PHONY: fonts
fonts: $(BUILD)
mkdir -p $(BUILD)/fonts
cp node_modules/font-awesome/fonts/*-webfont* $(BUILD)/fonts
.PHONY: $(BUILD)/main.js
$(BUILD)/main.js: $(BUILD)
NODE_PATH=.:$(SOURCE) NODE_ENV=development $(BROWSERIFY_CMD) --debug $(SOURCE)/main.coffee | $(EXORCIST) $(BUILD)/main.js.map > $(BUILD)/main.js
.PHONY: $(BUILD)/main.css
$(BUILD)/main.css: $(BUILD)
$(SASS_CMD) --style nested $(SOURCE)/main.sass $(BUILD)/main.css
.PHONY: $(BUILD)/main.min.js
$(BUILD)/main.min.js: $(BUILD)
NODE_PATH=.:$(SOURCE) NODE_ENV=production $(BROWSERIFY_CMD) $(SOURCE)/main.coffee | $(UGLIFYJS) -m -c > $(BUILD)/main.min.js 2> /dev/null
.PHONY: $(BUILD)/main.min.css
$(BUILD)/main.min.css: $(BUILD)
$(SASS_CMD) --style compressed $(SOURCE)/main.sass $(BUILD)/main.min.css
.PHONY: build
build: fonts $(BUILD)/main.css $(BUILD)/main.js
.PHONY: min
min: fonts $(BUILD)/main.min.css $(BUILD)/main.min.js
.PHONY: clean
clean:
rm -rf $(BUILD)/*
.PHONY: distclean
distclean:
rm -rf node_modules