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
5 # This is depends on a bunch of GNU-isms from bash, sed, touch.
10 # if you have a decent amount of RAM, setting TMPDIR to be on tmpfs
11 # can significantly improve performance because uploads take a lot
12 # of disk I/O due to the rewindability requirement in Rack.
16 # Avoid loading rubygems to speed up tests because gmake is
17 # fork+exec heavy with Ruby.
22 RUBY := $(prefix)/bin/ruby
24 prefix := $(prefix)/ruby-1.9
25 export PATH := $(prefix)/bin:$(PATH)
26 RUBY := $(prefix)/bin/ruby --disable-gems
29 prefix := $(prefix)/ruby-1.9.2
30 export PATH := $(prefix)/bin:$(PATH)
31 RUBY := $(prefix)/bin/ruby --disable-gems
32 gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.9.1/gems/,$(gems))
36 x := $(shell test -d t/ && \
37 PATH=$(PATH) NO_ISOLATE=T $(MAKE) -s isolate RUBY:="$(RUBY)")
40 RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
42 updir := $(shell git rev-parse --show-cdup)
43 gem_paths := $(wildcard $(updir)tmp/isolate/ruby-$(RUBY_VERSION)/gems/*-*)
48 export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
51 # pipefail is THE reason to use bash (v3+) or never revisions of ksh93
52 # SHELL := /bin/bash -e -o pipefail
53 SHELL := /bin/ksh93 -e -o pipefail
55 # trace execution of tests
56 # TRACER = strace -f -o $(t_pfx).strace -s 100000
57 TRACER = /usr/bin/time -v -o $(t_pfx).time
59 full-test: test-18 test-191 test-192
61 $(MAKE) test 2>&1 | sed -e 's!^!1.8 !'
63 $(MAKE) test r19=T 2>&1 | sed -e 's!^!1.9.1 !'
65 $(MAKE) test r192=T 2>&1 | sed -e 's!^!1.9.2 !'
68 @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<
70 # publishes docs to http://rainbows.rubyforge.org
73 $(RM) -r doc ChangeLog NEWS
74 $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
75 $(MAKE) -s latest > doc/LATEST
76 find doc/images doc/js -type f | \
77 TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
79 chmod 644 $$(find doc -type f)
80 $(RSYNC) -av doc/ rubyforge.org:/var/www/gforge-projects/rainbows/
81 $(RSYNC) -av doc/ dcvr:/srv/rainbows/
82 git ls-files | xargs touch
84 # Create gzip variants of the same timestamp as the original so nginx
85 # "gzip_static on" can serve the gzipped versions directly.
86 doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
88 touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
89 for i in $(docs); do \
90 gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
92 # launches any of the following shells with RUBYLIB set