1 # this is a sample local.mk file, feel free to modify it for your needs
2 # GNUmakefile will source local.mk in the top-level source tree
5 # This is depends on a bunch of GNU-isms from bash, touch.
11 # Avoid loading rubygems to speed up tests because gmake is
12 # fork+exec heavy with Ruby.
15 RUBY := $(prefix)/bin/ruby
16 gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.8/gems/,$(gems))
18 prefix := $(prefix)/ruby-1.9
19 export PATH := $(prefix)/bin:$(PATH)
20 RUBY := $(prefix)/bin/ruby --disable-gems
21 gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.9.1/gems/,$(gems))
27 export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
30 # pipefail is THE reason to use bash (v3+) or never revisions of ksh93
31 # SHELL := /bin/bash -e -o pipefail
32 SHELL := /bin/ksh93 -e -o pipefail
34 # trace execution of tests
35 # TRACER = strace -f -o $(t_pfx).strace -s 100000
36 TRACER = /usr/bin/time -v -o $(t_pfx).time
39 @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
41 # publishes docs to http://bogomips.org/ruby_io_splice/
44 $(RM) -r doc ChangeLog NEWS
45 $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
46 $(MAKE) -s latest > doc/LATEST
47 find doc/images doc/js -type f | \
48 TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
50 chmod 644 $$(find doc -type f)
51 $(RSYNC) -av doc/ dcvr:/srv/bogomips/ruby_io_splice/
52 git ls-files | xargs touch
54 # Create gzip variants of the same timestamp as the original so nginx
55 # "gzip_static on" can serve the gzipped versions directly.
56 doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
58 touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
59 for i in $(docs); do \
60 gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
62 # launches any of the following shells with RUBYLIB set