|
@@ -13,20 +13,31 @@ dist: ## Create a distribution for live usage
|
|
|
@mkdir -p dist/css dist/js dist/tags
|
|
@mkdir -p dist/css dist/js dist/tags
|
|
|
# --- Combine CSS ---
|
|
# --- Combine CSS ---
|
|
|
@for file in $$(cat css/app.css | sed "$(CSS_FILES)"); do \
|
|
@for file in $$(cat css/app.css | sed "$(CSS_FILES)"); do \
|
|
|
- cat css/$$file >> dist/css/app.css; \
|
|
|
|
|
|
|
+ cat css/$$file >> dist/css/app.css; \
|
|
|
done
|
|
done
|
|
|
# --- Combine Javascript ---
|
|
# --- Combine Javascript ---
|
|
|
@for file in $$(grep "$(JS_TAGS)" index.html | sed "$(JS_FILES)"); do \
|
|
@for file in $$(grep "$(JS_TAGS)" index.html | sed "$(JS_FILES)"); do \
|
|
|
- cat $$file >> dist/js/app.js; \
|
|
|
|
|
|
|
+ cat $$file >> dist/js/app.js; \
|
|
|
|
|
+ done
|
|
|
|
|
+ # --- Combine Riot Tags ---
|
|
|
|
|
+ @for file in $$(grep "$(RIOT_TAGS)" index.html | sed "$(RIOT_FILES)"); do \
|
|
|
|
|
+ cat $$file >> dist/tags/app.tag; \
|
|
|
done
|
|
done
|
|
|
- # --- Copy Riot Tags ---
|
|
|
|
|
- @cp tags/*.tag dist/tags/
|
|
|
|
|
# --- Modify Index Page ---
|
|
# --- Modify Index Page ---
|
|
|
- @sed "/$(JS_TAGS)/D" index.html | sed "s|$(APPJS_PH)|$(APPJS_TAG)|" > dist/index.html
|
|
|
|
|
|
|
+ @# Output is piped/redirected as BSD and GNU `sed -i` differ.
|
|
|
|
|
+ @cp index.html dist/temp.html
|
|
|
|
|
+ @sed "/$(JS_TAGS)/D" dist/temp.html | sed "s|$(APPJS_PH)|$(APPJS_TAG)|" > dist/index.html
|
|
|
|
|
+ @cp dist/index.html dist/temp.html
|
|
|
|
|
+ @sed "/$(RIOT_TAGS)/D" dist/temp.html | sed "s|$(APPTAG_PH)|$(APPTAG_TAG)|" > dist/index.html
|
|
|
|
|
+ @rm dist/temp.html
|
|
|
@echo "All Done!"
|
|
@echo "All Done!"
|
|
|
|
|
|
|
|
CSS_FILES = s|@import.*[\'\"]\(.*\)[\'\"].*|\1|
|
|
CSS_FILES = s|@import.*[\'\"]\(.*\)[\'\"].*|\1|
|
|
|
JS_TAGS = <script .*src=[\'\"].*\.js[\'\"]
|
|
JS_TAGS = <script .*src=[\'\"].*\.js[\'\"]
|
|
|
JS_FILES = s|.*src=[\'\"]\(.*\.js\)[\'\"].*|\1|
|
|
JS_FILES = s|.*src=[\'\"]\(.*\.js\)[\'\"].*|\1|
|
|
|
|
|
+RIOT_TAGS = <script .*src=[\'\"].*\.tag[\'\"]
|
|
|
|
|
+RIOT_FILES = s|.*src=[\'\"]\(.*\.tag\)[\'\"].*|\1|
|
|
|
APPJS_PH = <!-- appjsplaceholder -->
|
|
APPJS_PH = <!-- appjsplaceholder -->
|
|
|
APPJS_TAG = <script type='text/javascript' src='js/app.js'></script>
|
|
APPJS_TAG = <script type='text/javascript' src='js/app.js'></script>
|
|
|
|
|
+APPTAG_PH = <!-- apptagplaceholder -->
|
|
|
|
|
+APPTAG_TAG = <script type='riot/tag' src='tags/app.tag'></script>
|