forked from unl/wdntemplates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (59 loc) · 1.99 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
71
72
73
74
75
76
export PATH := $(PATH):build/bin
ENV := /usr/bin/env
TEMPLATE_DIR := wdn/templates_4.0
TEMPLATE_LESS := $(TEMPLATE_DIR)/less
TEMPLATE_CSS := $(TEMPLATE_DIR)/css
TEMPLATE_JS := $(TEMPLATE_DIR)/scripts
TEMPLATE_RJS := $(TEMPLATE_JS)/compressed
GIT := git
PERL := perl
LESSC := lessc
LESSC_FLAGS := --yui-compress --line-numbers=comments
LESSC_SHELL := $(ENV) PATH=$(PATH) $(LESSC)
LESS_MIXINS := $(TEMPLATE_LESS)/_mixins/all.less
LESS_MIXINS_DEPS := $(filter %.less, $(shell $(LESSC_SHELL) -M $(LESS_MIXINS) .tmp))
LESS_ALL := all.less
LESS_ALL_OUT := all.css
LESS_ALL_OUT_IE := all_oldie.css
CSS_OBJS := \
$(TEMPLATE_CSS)/$(LESS_ALL_OUT) \
$(TEMPLATE_CSS)/$(LESS_ALL_OUT_IE) \
$(TEMPLATE_CSS)/ie.css \
$(TEMPLATE_CSS)/print.css \
$(TEMPLATE_CSS)/layouts/events.css \
$(TEMPLATE_CSS)/layouts/formvalidator.css \
$(TEMPLATE_CSS)/layouts/monthwidget.css \
$(TEMPLATE_CSS)/layouts/unlalert.css \
$(TEMPLATE_CSS)/modules/notices.css
MQ_STRIP := build/mq-strip.pl
RJS := r.js
RJS_FLAGS :=
RJS_BUILD_CONF := build/build.js
JS_ALL_OUT := $(TEMPLATE_RJS)/all.js
JS_DEPS := $(TEMPLATE_JS)/*.js
SMUDGE_STATUS := $(shell $(GIT) config filter.rcs-keywords.smudge)
all: less js
less: $(CSS_OBJS)
$(shell $(LESSC_SHELL) -M $(TEMPLATE_LESS)/$(LESS_ALL) $(TEMPLATE_CSS)/$(LESS_ALL_OUT))
$(shell $(LESSC_SHELL) -M $(TEMPLATE_LESS)/$(LESS_ALL) $(TEMPLATE_CSS)/$(LESS_ALL_OUT_IE))
$(ENV) $(LESSC) $(TEMPLATE_LESS)/$(LESS_ALL) | $(MQ_STRIP) | $(ENV) $(LESSC) $(LESSC_FLAGS) - > $@
$(TEMPLATE_CSS)/%.css: $(TEMPLATE_LESS)/%.less $(LESS_MIXINS_DEPS)
@mkdir -p $(@D)
$(ENV) $(LESSC) $(LESSC_FLAGS) $< $@
js: $(JS_ALL_OUT)
$(JS_ALL_OUT): $(RJS_BUILD_CONF) $(JS_DEPS)
$(ENV) $(RJS) -o $< $(RJS_FLAGS)
clean:
rm -rf $(TEMPLATE_CSS)
rm -rf $(TEMPLATE_RJS)
dist: all
@if test -z "$(SMUDGE_STATUS)"; then \
./scripts/smudge.sh; \
fi
zip -qr downloads/wdn.zip wdn
zip -qr downloads/UNLTemplates.zip Templates sharedcode
@if test -z "$(SMUDGE_STATUS)"; then \
./scripts/clean.sh; \
fi
.PHONY: all clean less js dist
.SUFFIXES: