avoid partial writes on IO.vmsplice unless F_NONBLOCK
[ruby_io_splice.git] / local.mk.sample
blob04e46c0780bc25fb480f249c24927e7c4c7c51d9
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
3 # if it is present.
5 # This is depends on a bunch of GNU-isms from bash, touch.
7 RSYNC = rsync
8 DLEXT := so
9 gems :=
11 # Avoid loading rubygems to speed up tests because gmake is
12 # fork+exec heavy with Ruby.
13 prefix = $(HOME)
14 ifeq ($(r19),)
15   RUBY := $(prefix)/bin/ruby
16   gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.8/gems/,$(gems))
17 else
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))
22 endif
24 ifdef gem_paths
25   sp :=
26   sp +=
27   export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
28 endif
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
38 latest: NEWS
39         @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
41 # publishes docs to http://bogomips.org/ruby_io_splice/
42 publish_doc:
43         -git set-file-times
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
49         $(MAKE) doc_gz
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\)$$')
57 doc_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
63 irb sh bash ksh:
64         $@