summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile65
1 files changed, 29 insertions, 36 deletions
diff --git a/Makefile b/Makefile
index 6d0e7322..d39e856d 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,18 @@ tablesorter-ver=2.7
d3-ver=3.0.6
konami-ver=c0f686e647765860ff4d2fcb7b48122785432b75
+# What files do we make?
+branding-images = \
+ sitestatic/favicon.ico sitestatic/silhouette.png \
+ sitestatic/archnavbar/archlogo.png \
+ sitestatic/archnavbar/archlogo.svg \
+ sitestatic/logos/apple-touch-icon-114x114.png \
+ sitestatic/logos/apple-touch-icon-144x144.png \
+ sitestatic/logos/apple-touch-icon-57x57.png \
+ sitestatic/logos/apple-touch-icon-72x72.png \
+ sitestatic/logos/icon-transparent-64x64.png
targets = \
+ $(branding-images) \
sitestatic/rss.png \
sitestatic/rss@2x.png \
sitestatic/bootstrap-typeahead.js \
@@ -54,7 +65,7 @@ clean:
.PHONY: clean
# Make directories
-$(dl-cache) $(bin):
+$(dl-cache) $(dl-cache)/unzip $(bin):
mkdir -p '$@'
# Don't clean up the pre-minified files
@@ -63,6 +74,8 @@ $(dl-cache) $(bin):
# Turn on sane error handling
.DELETE_ON_ERROR:
+.PHONY: FORCE
+
# How to download files
@@ -79,31 +92,10 @@ $(www)/https/%:
wget 'https://$(call unmangle,$*)' -O '$@'
test -f '$@' && touch '$@'
-$(www)/git/%:
+$(www)/git/%: FORCE
mkdir -p '$(@D)'
gitget checkout 'git://$(call unmangle,$*)' '$@' || { rm -rf -- '$@'; false; }
- test -d '$@' && touch '$@' || { rm -rf -- '$@'; false; }
-
-
-# How to install any of the minifiers in use
-
-# Any of the UglifyJS 1.3.x releases will produce the same output for these inputs
-$(bin)/uglifyjs-1.3: $(www)/git/github.com/mishoo/UglifyJS.git\#tag=v1.3.5 | $(bin)
- printf '%s\n' '#!/bin/sh' 'exec $</bin/uglifyjs --no-copyright --ascii --max-line-len 0 "$$@"' | install -m755 /dev/stdin '$@'
-
-# Any of the UglifyJS 2.2.x releases will produce the same output for these inputs
-$(dl-cache)/uglifyjs-2.2: $(www)/git/github.com/mishoo/UglifyJS2.git\#tag=v2.2.5 | $(dl-cache)
- cp -r $< $@ || { rm -rf -- '$@'; false; }
- cd $@ && npm install || { rm -rf -- '$@'; false; }
-$(bin)/uglifyjs-2.2: $(dl-cache)/uglifyjs-2.2 | $(bin)
- printf '%s\n' '#!/bin/sh' 'exec $</bin/uglifyjs --mangle --compress -- "$$@"' | install -m755 /dev/stdin '$@'
-
-# Closure compiler 20121212 produces the same output
-$(dl-cache)/unzip/compiler-20121212/%: $(www)/https/web.archive.org/web/20151226141014/https^3A//closure-compiler.googlecode.com/files/compiler-20121212.tar.gz
- mkdir -p '$(@D)'
- bsdtar xfO '$<' '$*' > '$@'
-$(bin)/closure-compiler: $(dl-cache)/unzip/compiler-20121212/compiler.jar | $(bin)
- printf '%s\n' '#!/bin/sh' 'exec java -jar $< "$$@"' | install -m755 /dev/stdin '$@'
+ test -d '$@' || { rm -rf -- '$@'; false; }
# The meat of the Makefile
@@ -117,6 +109,13 @@ sitestatic/rss.png: $(dl-cache)/unzip/Feedicons_v.2/RSS_16.png
sitestatic/rss@2x.png: $(dl-cache)/unzip/Feedicons_v.2/RSS_32.png
pngcrush $< $@
+$(dl-cache)/unzip/parabola-artwork: $(www)/git/projects.parabola.nu/artwork.git\#branch=official/2013 | $(dl-cache)/unzip
+ cp -rT '$<' '$@'
+ make -C '$@'
+$(dl-cache)/unzip/parabola-artwork/%: $(dl-cache)/unzip/parabola-artwork
+ test -e $@ && touch $@
+$(foreach i,$(branding-images),$(eval $i: $$(dl-cache)/unzip/parabola-artwork/$(notdir $i); install -Dm644 $$< $$@))
+
# Non-minified JavaScript
sitestatic/bootstrap-typeahead.js: sitestatic/%: $(www)/https/raw.github.com/twitter/bootstrap/v$(bootstrap-ver)/js/% Makefile.d/%.patch
cp $< $@
@@ -132,18 +131,9 @@ visualize/static/d3-$(d3-ver).js: %: $(www)/https/raw.github.com/mbostock/d3/v$(
cp $< $@
# JavaScript minification
-sitestatic/bootstrap-typeahead.min.js: %.min.js: $(bin)/uglifyjs-1.3 %.js
- $^ > $@
-sitestatic/jquery-$(jquery-ver).min.js: sitestatic/%.min.js: sitestatic/%.js Makefile.d/%.min.js.preamble
- { cat Makefile.d/$*.min.js.preamble && $(bin)/uglifyjs-1.3 $<; } > $@
-sitestatic/jquery.tablesorter-$(tablesorter-ver).min.js: sitestatic/%.min.js: sitestatic/%.js Makefile.d/%.min.js.preamble $(bin)/closure-compiler
- @# The tr/sed is to turn all of the newlines except for the last one into spaces
- { cat Makefile.d/$*.min.js.preamble && $(bin)/closure-compiler $< | tr '\n' ' ' | sed 's, $$,\n,'; } > $@
-sitestatic/konami.min.js: %.min.js: $(bin)/uglifyjs-2.2 %.js
- @# The sed is to insert newlines and whitespace at the correct places; presumably to match Dan copy/pasting into an editor.
- $^ | sed -r -e 's:e\.iphone\.stop_x|s=this\.tap===:\n\t&:g' -e 's,return"string",\n&,' | sed -e 's,;$$,,' -e '$$s,$$,\n,' > $@
-visualize/static/d3-$(d3-ver).min.js: %.min.js: $(bin)/uglifyjs-2.2 %.js
- $^ > $@
+JSMIN = { sed -n '1,/\*\//p' $1; uglifyjs --mangle --compress < $1; } > $2
+%.min.js: %.js
+ $(call JSMIN,$<,$@)
# Files that make use of that minified JavaScript
retro/static/2013/konami.min.e165c814457d.js: sitestatic/konami.min.js
@@ -153,9 +143,12 @@ retro/static/2013/bootstrap-typeahead.min.1aacd3d7f4db.js: sitestatic/bootstrap-
< $< sed 's/;$$//' | perl -pe 'chomp if eof' > $@
sitestatic/homepage.js: sitestatic/bootstrap-typeahead.min.js sitestatic/konami.min.js Makefile.d/homepage.js.in
{ \
+ echo '/* bootstrap-typeahead.min.js: */' && \
cat sitestatic/bootstrap-typeahead.min.js && \
echo && \
+ echo '/* konami.min.js: */' && \
sed -e 's,^\s*,,' -e 's,^return.*,&;,' sitestatic/konami.min.js && \
echo && \
+ echo '/* Main homepage.js content: */' && \
cat Makefile.d/homepage.js.in ; \
} > $@