diff options
-rw-r--r-- | Makefile | 102 | ||||
-rw-r--r-- | Makefile.d/jquery-1.8.3.min.js.preamble | 2 | ||||
-rw-r--r-- | Makefile.d/jquery.tablesorter-2.7.min.js.preamble | 2 | ||||
-rw-r--r-- | sitestatic/.gitignore | 18 | ||||
-rw-r--r-- | sitestatic/rss.png | bin | 707 -> 0 bytes | |||
-rw-r--r-- | sitestatic/rss@2x.png | bin | 1466 -> 0 bytes | |||
-rw-r--r-- | visualize/.gitignore | 2 |
7 files changed, 70 insertions, 56 deletions
@@ -1,12 +1,7 @@ # Where are we? -topdir := $(dir $(lastword $(MAKEFILE_LIST))) -www = $(topdir)/../web-cache/www -artwork = $(topdir)/../web-cache/artwork -branding = $(artwork)/official-2013/optimized-text - - -# Where is the the Javascript minimizer? -JSMIN = { sed -n '1,/\*\//p' $1; closure-compiler --js $1; } > $2 +dl-cache = ../download-cache +www = $(dl-cache)/www +bin = $(dl-cache)/bin # What versions of 3rd party libraries are we using? jquery-ver=1.8.3 @@ -16,7 +11,19 @@ d3-ver=3.0.6 konami-ver=c0f686e647765860ff4d2fcb7b48122785432b75 # What files do we make? -javascripts = \ +branding-images = \ + sitestatic/favicon.ico sitestatic/silhouette.png \ + sitestatic/archnavbar/archlogo.png \ + 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/.gitignore visualize/.gitignore \ + sitestatic/rss.png \ + sitestatic/rss@2x.png \ sitestatic/bootstrap-typeahead.js \ sitestatic/homepage.js \ sitestatic/jquery-$(jquery-ver).min.js \ @@ -25,51 +32,78 @@ javascripts = \ sitestatic/konami.min.js \ visualize/static/d3-$(d3-ver).js \ visualize/static/d3-$(d3-ver).min.js -images += sitestatic/favicon.ico sitestatic/silhouette.png -images += sitestatic/archnavbar/archlogo.png -images += \ - 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 -javascript_basenames = $(sort $(patsubst %.min,%,$(patsubst %.js,%,$(javascripts)))) -targets = $(foreach i,$(javascript_basenames),$i.js $i.min.js) $(images) +js-basenames = $(sort $(patsubst %.min,%,$(patsubst %.js,%,$(filter %.js,$(targets))))) +generated = $(sort $(targets) $(foreach f,$(js-basenames),$f.js $f.min.js)) + +generated := $(generated) +targets := $(generated) # The base rules -all: $(targets) sitestatic/.gitignore visualize/.gitignore -clean: sitestatic/.gitignore visualize/.gitignore - rm -f -- $(targets) -.PHONY: all clean +all: $(targets) +.PHONY: all + +clean: + rm -f -- $(generated) +.PHONY: clean %/.gitignore: $(MAKEFILE_LIST) - printf -- '%s\n' $(patsubst $*%,%,$(filter $*/%,$(targets))) | LC_COLLATE=C sort > $@ + printf -- '%s\n' $(patsubst $*%,%,$(filter $*/%,$(generated))) | LC_COLLATE=C sort > $@ + +# Make directories +$(dl-cache) $(bin): + mkdir -p '$@' + +# Don't have non-minimized .js stick around unless we asked for them. +.INTERMEDIATE: $(filter-out $(targets),$(generated)) # Turn on sane error handling .DELETE_ON_ERROR: +.PHONY: FORCE + # How to download files + mangle = $(subst %,^25,$(subst :,^3A,$(subst =,^3D,$(subst ^,^5E,$1)))) +unmangle = $(subst ^5E,^,$(subst ^3D,=,$(subst ^3A,:,$(subst ^25,%,$1)))) + $(www)/http/%: mkdir -p '$(@D)' - wget 'http://$*' -O '$@' - touch '$@' + wget 'http://$(call unmangle,$*)' -O '$@' + test -f '$@' && touch '$@' $(www)/https/%: mkdir -p '$(@D)' - wget 'https://$*' -O '$@' - touch '$@' + wget 'https://$(call unmangle,$*)' -O '$@' + test -f '$@' && touch '$@' -$(branding)/%: - gitget checkout 'git://projects.parabola.nu/artwork.git#branch=master' '$(artwork)' - make -C '$(branding)' +$(www)/git/%: FORCE + mkdir -p '$(@D)' + gitget checkout 'git://$(call unmangle,$*)' '$@' || { rm -rf -- '$@'; false; } + test -d '$@' || { rm -rf -- '$@'; false; } -# Non-minimized files +# Downloaded images + +$(dl-cache)/unzip/Feedicons_v.2/%: $(www)/https/web.archive.org/web/20120514074507/http^3A//www.zeusboxstudio.com/file_download/1/Feedicons_v.2.zip + mkdir -p '$(@D)' + bsdtar xfO $< 'Feedicons v.2/$*' > '$@' +sitestatic/rss.png: $(dl-cache)/unzip/Feedicons_v.2/RSS_16.png + cp $< $@ +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 + 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-minimized .js files sitestatic/bootstrap-typeahead.js: sitestatic/%: $(www)/https/raw.github.com/twitter/bootstrap/v$(bootstrap-ver)/js/% Makefile.d/%.patch cp $< $@ patch -i Makefile.d/$*.patch $@ @@ -94,10 +128,10 @@ sitestatic/homepage.js: sitestatic/bootstrap-typeahead.min.js sitestatic/konami. visualize/static/d3-$(d3-ver).js: %: $(www)/https/raw.github.com/mbostock/d3/v$(d3-ver)/d3.js cp $< $@ -$(foreach i,$(images),$(eval $i: $$(branding)/$(notdir $i); install -Dm644 $$< $$@)) - # The minimization processes +JSMIN = { sed -n '1,/\*\//p' $1; closure-compiler --js $1; } > $2 + %.min.js: %.js $(call JSMIN,$<,$@) diff --git a/Makefile.d/jquery-1.8.3.min.js.preamble b/Makefile.d/jquery-1.8.3.min.js.preamble index ca451d71..ae08a973 100644 --- a/Makefile.d/jquery-1.8.3.min.js.preamble +++ b/Makefile.d/jquery-1.8.3.min.js.preamble @@ -1 +1 @@ -/*! jQuery v1.8.3 jquery.com | jquery.org/license */
\ No newline at end of file +/*! jQuery v1.8.3 jquery.com | jquery.org/license */
diff --git a/Makefile.d/jquery.tablesorter-2.7.min.js.preamble b/Makefile.d/jquery.tablesorter-2.7.min.js.preamble index e57e2d88..a6e11689 100644 --- a/Makefile.d/jquery.tablesorter-2.7.min.js.preamble +++ b/Makefile.d/jquery.tablesorter-2.7.min.js.preamble @@ -1,4 +1,4 @@ /*! * TableSorter 2.7 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach -*/
\ No newline at end of file +*/ diff --git a/sitestatic/.gitignore b/sitestatic/.gitignore deleted file mode 100644 index 5d3b3cb6..00000000 --- a/sitestatic/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -/archnavbar/archlogo.png -/bootstrap-typeahead.js -/bootstrap-typeahead.min.js -/favicon.ico -/homepage.js -/homepage.min.js -/jquery-1.8.3.js -/jquery-1.8.3.min.js -/jquery.tablesorter-2.7.js -/jquery.tablesorter-2.7.min.js -/konami.js -/konami.min.js -/logos/apple-touch-icon-114x114.png -/logos/apple-touch-icon-144x144.png -/logos/apple-touch-icon-57x57.png -/logos/apple-touch-icon-72x72.png -/logos/icon-transparent-64x64.png -/silhouette.png diff --git a/sitestatic/rss.png b/sitestatic/rss.png Binary files differdeleted file mode 100644 index a6f114cd..00000000 --- a/sitestatic/rss.png +++ /dev/null diff --git a/sitestatic/rss@2x.png b/sitestatic/rss@2x.png Binary files differdeleted file mode 100644 index ffd6feba..00000000 --- a/sitestatic/rss@2x.png +++ /dev/null diff --git a/visualize/.gitignore b/visualize/.gitignore deleted file mode 100644 index 5b990033..00000000 --- a/visualize/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/static/d3-3.0.6.js -/static/d3-3.0.6.min.js |