summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 95d73ed..fb76c8a 100644
--- a/Makefile
+++ b/Makefile
@@ -53,14 +53,21 @@ else
minify:
@if [[ -z "$(FILE)" ]];then echo "FILE=<file to minify>" >&2; exit 1;fi
@echo "Minifying $(FILE) ..."
- @sed -e "s|/\*\(\\\\\)\?\*/|/~\1~/|g" \
+ @sed \
+ -e "s|/\*\(\\\\\)\?\*/|/~\1~/|g" \
-e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" \
-e "s|\([^:/]\)//.*$$|\1|" -e "s|^//.*$$||" \
"$(FILE)" >"$(FILE)".tmp
@cat "$(FILE)".tmp > "$(FILE)"
@tr '\n' ' ' <"$(FILE)" > "$(FILE)".tmp
- @sed -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|/\~\(\\\\\)\?\~/|/*\1*/|g" \
- -e "s|\s\+| |g" -e "s| \([{;:,]\)|\1|g" -e "s|\([{;:,]\) |\1|g" -i "$(FILE).tmp"
+ @sed \
+ -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" \
+ -e "s|/\~\(\\\\\)\?\~/|/*\1*/|g" \
+ -e "s|\s\+| |g" \
+ -e "s| \([{;:,]\)|\1|g" \
+ -e "s|\([{;:,]\) |\1|g" \
+ -e "s/^ *//;s/ *$$//" \
+ -i "$(FILE).tmp"
@cat "$(FILE)".tmp > "$(FILE)"
@rm "$(FILE)".tmp