about summary refs log tree commit homepage
path: root/local.mk.sample
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-02 20:44:03 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-02 21:21:28 -0700
commit37a12997628fcab722512f8a6370b92d44e33529 (patch)
tree9ced4ceaee3d4d6ce21dd1742f037d1d79a01e61 /local.mk.sample
downloadrainbows-37a12997628fcab722512f8a6370b92d44e33529.tar.gz
No tests yet, but the old "gossamer" and "rainbows" branches
seem to be basically working.
Diffstat (limited to 'local.mk.sample')
-rw-r--r--local.mk.sample54
1 files changed, 54 insertions, 0 deletions
diff --git a/local.mk.sample b/local.mk.sample
new file mode 100644
index 0000000..86c0e80
--- /dev/null
+++ b/local.mk.sample
@@ -0,0 +1,54 @@
+# this is the local.mk file used by Eric Wong on his dev boxes.
+# GNUmakefile will source local.mk in the top-level source tree
+# if it is present.
+#
+# This is depends on a bunch of GNU-isms from bash, sed, touch.
+
+DLEXT := so
+rack_ver := 1.0.0
+
+# Avoid loading rubygems to speed up tests because gmake is
+# fork+exec heavy with Ruby.
+ifeq ($(r19),)
+  ruby := $(HOME)/bin/ruby
+  RUBYLIB := $(HOME)/lib/ruby/gems/1.8/gems/rack-$(rack_ver)/lib
+else
+  export PATH := $(HOME)/ruby-1.9/bin:$(PATH)
+  ruby := $(HOME)/ruby-1.9/bin/ruby --disable-gems
+  RUBYLIB := $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/rack-$(rack_ver)/lib
+endif
+
+# pipefail is THE reason to use bash (v3+)
+SHELL := /bin/bash -e -o pipefail
+
+full-test: test-18 test-19
+test-18:
+        $(MAKE) test test-rails 2>&1 | sed -u -e 's!^!1.8 !'
+test-19:
+        $(MAKE) test test-rails r19=1 2>&1 | sed -u -e 's!^!1.9 !'
+
+latest: NEWS
+        @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<
+
+# publishes docs to http://rainbows.rubyforge.org
+publish_doc:
+        -git set-file-times
+        $(RM) -r doc
+        $(MAKE) doc
+        $(MAKE) -s latest > doc/LATEST
+        find doc/images doc/js -type f | \
+                TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
+        $(MAKE) doc_gz
+        chmod 644 $$(find doc -type f)
+        rsync -av --delete doc/ \
+          rubyforge.org:/var/www/gforge-projects/rainbows/
+        git ls-files | xargs touch
+
+# Create gzip variants of the same timestamp as the original so nginx
+# "gzip_static on" can serve the gzipped versions directly.
+doc_gz: suf := html js css
+doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
+doc_gz:
+        touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
+        for i in $(docs); do \
+          gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done