forked from prism-break/prism-break
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (81 loc) · 2.62 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# COMMANDS (more in README.md)
# make all build /tmp and copy to /public
# make clean destroy built files
# make uber destroy built files and rebuild everything
# make watch_css run "stylus --watch" for css edits
# BINARIES
BIN = ./node_modules/.bin/
LIVESCRIPT_BIN = $(BIN)lsc
LIVESCRIPT_PARAMS = -cob
STYLUS_BIN = $(BIN)stylus
STYLUS_PARAMS = -c -u ./node_modules/nib/
STYLUS_WATCH_PARAMS = -c -w source/stylesheets/screen.styl -u ./node_modules/nib/ -o public/assets/css/
# INPUTS
BUILD_DIR = ./source/functions/build/site-
STYL = ./source/stylesheets/screen.styl
# OUTPUTS
CSS = ./tmp/assets/css/screen.css
mkdirs:
mkdir -p tmp/assets/css tmp/assets/js
copy_assets:
cp -r source/assets/fonts tmp/assets/fonts
cp -r source/assets/icons tmp/assets/ico
cp -r source/assets/images tmp/assets/img
watch_css:
$(STYLUS_BIN) $(STYLUS_WATCH_PARAMS)
build_css:
$(STYLUS_BIN) $(STYLUS_PARAMS) <$(STYL) >$(CSS)
build_test:
$(LIVESCRIPT_BIN) $(BUILD_DIR)en.ls
mkdir -p public
cp -r source/dotfiles/.htaccess public
cp -r tmp/* public/
rm -rf tmp
build_html:
$(LIVESCRIPT_BIN) $(BUILD_DIR)ar.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)ca.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)de.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)el.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)en.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)eo.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)es.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)fa.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)fi.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)fr.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)he.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)hi.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)io.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)it.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)ja.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)nl.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)no.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)pl.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)pt.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)ru.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)sr-Cyrl.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)sr.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)sv.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)tr.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)zh-CN.ls
$(LIVESCRIPT_BIN) $(BUILD_DIR)zh-TW.ls
mkdir -p public
cp -r source/dotfiles/.htaccess public
cp -r tmp/* public/
rm -rf tmp
clean_tmp:
rm -rf tmp/*
clean_public:
rm -rf public/*
# copy ./public to another repository and commit changes
sync:
rsync -azru --delete --stats public/ ../prism-break-static/public/
(cd ../prism-break-static; git add -A; git commit -m 'regenerate'; git push)
# ORGANIZE
build_all: build_css build_html
# MAIN COMMANDS
all: clean_tmp mkdirs copy_assets build_all
test: clean_tmp mkdirs copy_assets build_test
clean: clean_tmp clean_public
reset: clean_public all
# PHONY
.PHONY: watch_css render_html clean_tmp clean_public