forked from ideaweb/firefox-safari-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (52 loc) · 2.19 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
SHELL := /bin/bash
SASS := $(shell which sass >/dev/null && which sass || echo "false";)
MD5SUM := $(shell which md5sum >/dev/null && which md5sum || echo "false";)
usage:
@echo "Usage:"
@echo ""
@echo "# Creates all files"
@echo "make all"
@echo ""
@echo "# Watches for changes"
@echo "make watch"
files:
@echo -n "userChrome.css... "; \
cat scss/userChrome.scss | $(SASS) --no-source-map - css/userChrome.css && echo "done" || echo "\033[31mfailed\033[0m"; \
echo -n "userChrome-theme.css... "; \
cat scss/userChrome.scss | sed "s/firefox-safari-style-support-themes: false/firefox-safari-style-support-themes: true/g" | $(SASS) --no-source-map - css/userChrome-theme.css && echo "done" || echo "\033[31mfailed\033[0m"; \
echo -n "userChrome-vibrancy.css... "; \
cat scss/userChrome.scss | sed "s/firefox-safari-style-vibrancy: false/firefox-safari-style-vibrancy: all/g" | $(SASS) --no-source-map - css/userChrome-vibrancy.css && echo "done" || echo "\033[31mfailed\033[0m"; \
# echo -n "userChrome-vibrancy-tabs.css... "; \
# cat scss/userChrome.scss | sed "s/firefox-safari-style-vibrancy: false/firefox-safari-style-vibrancy: tabs/g" | $(SASS) --no-source-map - css/userChrome-vibrancy-tabs.css && echo "done" || echo "\033[31mfailed\033[0m"; \
all:
ifneq ($(SASS),false)
@echo "Checking for SASS compiler... $(SASS)"; \
$(MAKE) -s files;
else
@echo -e "Checking for SASS compiler... \033[31mfailed\033[0m"
@echo -e "\033[31mERROR - \"sass\" not found!\033[0m"
endif
watch:
ifneq ($(SASS),false)
@echo "Checking for SASS compiler... $(SASS)"
ifneq ($(MD5SUM),false)
@echo "Checking for Md5 checksums tool... $(MD5SUM)"; \
$(MAKE) -s files; \
echo "Sass is watching for changes. Press Ctrl-C to stop."; \
m1=$$(md5sum ./scss/userChrome.scss); \
while true; do \
sleep 0.5; \
m2=$$(md5sum ./scss/userChrome.scss); \
if [ "$$m1" != "$$m2" ] ; then \
m1=$$(md5sum ./scss/userChrome.scss); \
$(MAKE) -s files; \
fi; \
done;
else
@echo -e "Checking for Md5 checksums tool... \033[31mfailed\033[0m"
@echo -e "\033[31mERROR - \"md5sum\" not found!\033[0m"
endif
else
@echo -e "Checking for SASS compiler... \033[31mfailed\033[0m"
@echo -e "\033[31mERROR - \"sass\" not found!\033[0m"
endif