tests: avoid needlessly remaking "rainbows"
[rainbows.git] / local.mk.sample
blobda181b69bf115403ae6dbe77a07a7becba101e64
1 # this is the local.mk file used by Eric Wong on his dev boxes.
2 # GNUmakefile will source local.mk in the top-level source tree
3 # if it is present.
5 # This is depends on a bunch of GNU-isms from bash, sed, touch.
7 DLEXT := so
8 gems := rev-0.3.1 rack-1.0.0 iobuffer-0.1.1
10 # Avoid loading rubygems to speed up tests because gmake is
11 # fork+exec heavy with Ruby.
12 ifeq ($(r19),)
13   ruby := $(HOME)/bin/ruby
14   gem_paths := $(addprefix $(HOME)/lib/ruby/gems/1.8/gems/,$(gems))
15 else
16   export PATH := $(HOME)/ruby-1.9/bin:$(PATH)
17   ruby := $(HOME)/ruby-1.9/bin/ruby --disable-gems
18   gems := $(gems) case-0.5 revactor-0.1.4
19   gem_paths := $(addprefix $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/,$(gems))
20 endif
22 ifdef gem_paths
23   sp :=
24   sp +=
25   export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
26 endif
28 # pipefail is THE reason to use bash (v3+) or never revisions of ksh93
29 # SHELL := /bin/bash -e -o pipefail
30 SHELL := /bin/ksh93 -e -o pipefail
32 # trace execution of tests
33 # TRACER = strace -f -o $(t_pfx).strace -s 100000
34 TRACER = /usr/bin/time -v -o $(t_pfx).time
36 full-test: test-18 test-19
37 test-18:
38         $(MAKE) test 2>&1 | sed -u -e 's!^!1.8 !'
39 test-19:
40         $(MAKE) test r19=t 2>&1 | sed -u -e 's!^!1.9 !'
42 latest: NEWS
43         @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<
45 # publishes docs to http://rainbows.rubyforge.org
46 publish_doc:
47         -git set-file-times
48         $(RM) -r doc
49         $(MAKE) doc
50         $(MAKE) -s latest > doc/LATEST
51         find doc/images doc/js -type f | \
52                 TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
53         $(MAKE) doc_gz
54         chmod 644 $$(find doc -type f)
55         rsync -av --delete doc/ \
56           rubyforge.org:/var/www/gforge-projects/rainbows/
57         git ls-files | xargs touch
59 # Create gzip variants of the same timestamp as the original so nginx
60 # "gzip_static on" can serve the gzipped versions directly.
61 doc_gz: suf := html js css
62 doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
63 doc_gz:
64         touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
65         for i in $(docs); do \
66           gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
68 # launches any of the following shells with RUBYLIB set
69 irb sh bash ksh:
70         $@