-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 777 Bytes
/
Makefile
File metadata and controls
33 lines (27 loc) · 777 Bytes
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
OFILE = style.css
OFILEMIN = style.min.css
#CSS = $(foreach dir,src,$(wildcard $(dir)/*.css))
ifeq ($(USECONF), yes)
include config.mk
endif
default: clean
cat src/*.css >> $(OFILE)
minify: clean
@# strip comments
sed 's/\/\*.*\*\///g' src/*.css >> $(OFILEMIN)
@# replace \n and 2 or more spaces
sed -zi 's/\n\| \{2,\}//g' $(OFILEMIN)
@# sub colon+space with just colon
sed -i 's/: /:/g' $(OFILEMIN)
@# sub comma+space with just comma
sed -i 's/, /,/g' $(OFILEMIN)
@# sub space+curlyboi with just curlyboi
sed -i 's/ {/{/g' $(OFILEMIN)
@# sub curlyboi+space with just curlyboi
sed -i 's/ }/}/g' $(OFILEMIN)
@# sub semi-colon+space
sed -i 's/; /;/g' $(OFILEMIN)
clean:
rm -f $(OFILE) $(OFILEMIN)
all: clean default minify
.PHONY: default minify clean all