-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
21 lines (19 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
LAYOUT_BREAKER_SRC = layout-breaker.js
LAYOUT_BREAKER_NOSPACE_SRC = layout-breaker-nospace.js
JIBBERISHIFIER_SRC = jibberishifier.js
README_TEMPLATE = README.md.template
README = README.md
LAYOUT_BREAKER_PLACEHOLDER = @@LAYOUT_BREAKER_HERE@@
LAYOUT_BREAKER_NOSPACE_PLACEHOLDER = @@LAYOUT_BREAKER_NOSPACE_HERE@@
JIBBERISHIFIER_PLACEHOLDER = @@JIBBERISHIFIER_HERE@@
URLENCODED_LAYOUT_BREAKER = $(shell cat $(LAYOUT_BREAKER_SRC) | sed -r 's/^\s+//g' | tr -d '\n' | sed -r 's/ /%20/g')
URLENCODED_LAYOUT_BREAKER_WITH_SED_ESCAPES = $(shell echo "$(URLENCODED_LAYOUT_BREAKER)" | sed 's/&/\\\&/g')
URLENCODED_LAYOUT_BREAKER_NOSPACE = $(shell cat $(LAYOUT_BREAKER_NOSPACE_SRC) | sed -r 's/^\s+//g' | tr -d '\n' | sed -r 's/ /%20/g')
URLENCODED_LAYOUT_BREAKER_NOSPACE_WITH_SED_ESCAPES = $(shell echo "$(URLENCODED_LAYOUT_BREAKER_NOSPACE)" | sed 's/&/\\\&/g')
URLENCODED_JIBBERISHIFIER = $(shell cat $(JIBBERISHIFIER_SRC) | sed -r 's/^\s+//g' | tr -d '\n' | sed -r 's/ /%20/g' | sed -r 's/</%3C/g' | sed -r 's/>/%3E/g')
URLENCODED_JIBBERISHIFIER_WITH_SED_ESCAPES = $(shell echo "$(URLENCODED_JIBBERISHIFIER)" | sed 's/&/\\\&/g')
$(README): $(README_TEMPLATE) $(LAYOUT_BREAKER_SRC) $(JIBBERISHIFIER_SRC)
cat $(README_TEMPLATE) | sed "s/$(LAYOUT_BREAKER_PLACEHOLDER)/$(URLENCODED_LAYOUT_BREAKER_WITH_SED_ESCAPES)/g" | sed "s/$(LAYOUT_BREAKER_NOSPACE_PLACEHOLDER)/$(URLENCODED_LAYOUT_BREAKER_NOSPACE_WITH_SED_ESCAPES)/g" | sed "s/$(JIBBERISHIFIER_PLACEHOLDER)/$(URLENCODED_JIBBERISHIFIER_WITH_SED_ESCAPES)/g" > $(README)
.PHONY: clean
clean:
rm $(README)