-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
38 lines (35 loc) · 1.05 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
.PHONY : help build
BUILDID=$(shell date +%F.%H%M)
help:
@echo "make build:"
@echo " build the webpage"
@echo "make clean:"
@echo "
build: clean
build:
@echo "Building..."
mkdir build
# Copy images
cp -r src/img build
# Copy CSS
cp -r src/css build
# Copy HTML
cd src && find -type f -name \*.html -exec cp {} ../build --parents \; && cd ..
# Copy farbtastic
cd src && cp -r js/lib/farbtastic js/lib/modernizr.js ../build --parents && cd ..
# Concat & minify JS
jammit -c jammit.yml -o build/js
# Uncomment minified js / remove dev.js
sed -i 's/<!-- scripts concatenated/<!-- scripts concatenated -->/' build/*.html
sed -i 's/\/scripts concatenated -->/<!-- \/scripts concatenated -->/' build/*.html
sed -i '/<!-- scripts development -->/,/<!-- \/scripts development -->/d' build/*.html
# Add cache busting querystring to assets
sed -i 's/{{BUILDID}}/'"$(BUILDID)"'/' build/*.html
# Create a tar-ball
tar -czvf "twitterfontana.$(BUILDID).tgz" build
@echo "Done!"
clean:
@echo "Cleaning..."
-rm -rf ./build
-rm twitterfontana.*.tgz
@echo "Done!"