refactor threaded models to use blocking accept() if possible
[rainbows.git] / local.mk.sample
blobb02506dfa7100ef2b40890336200e49a8e8729cc
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 RSYNC = rsync
8 DLEXT := so
9 gems := rack-1.0.1
10 # gems += unicorn-0.95.1 # installed via setup.rb
11 gems += rev-0.3.1
12 gems += iobuffer-0.1.1
13 gems += eventmachine-0.12.10
14 gems += async_sinatra-0.1.5 sinatra-0.9.4
16 # Avoid loading rubygems to speed up tests because gmake is
17 # fork+exec heavy with Ruby.
18 prefix = $(HOME)
19 ifeq ($(r19),)
20   RUBY := $(prefix)/bin/ruby
21   gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.8/gems/,$(gems))
22 else
23   prefix := $(prefix)/ruby-1.9
24   export PATH := $(prefix)/bin:$(PATH)
25   RUBY := $(prefix)/bin/ruby --disable-gems
26   gems += case-0.5 revactor-0.1.5
27   gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.9.1/gems/,$(gems))
28 endif
30 ifdef gem_paths
31   sp :=
32   sp +=
33   export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
34 endif
36 # pipefail is THE reason to use bash (v3+) or never revisions of ksh93
37 # SHELL := /bin/bash -e -o pipefail
38 SHELL := /bin/ksh93 -e -o pipefail
40 # trace execution of tests
41 # TRACER = strace -f -o $(t_pfx).strace -s 100000
42 TRACER = /usr/bin/time -v -o $(t_pfx).time
44 full-test: test-18 test-19
45 test-18:
46         $(MAKE) test 2>&1 | sed -u -e 's!^!1.8 !'
47 test-19:
48         $(MAKE) test r19=t 2>&1 | sed -u -e 's!^!1.9 !'
50 latest: NEWS
51         @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<
53 # publishes docs to http://rainbows.rubyforge.org
54 publish_doc:
55         -git set-file-times
56         $(RM) -r doc ChangeLog NEWS
57         $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
58         $(MAKE) -s latest > doc/LATEST
59         find doc/images doc/js -type f | \
60                 TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
61         $(MAKE) doc_gz
62         chmod 644 $$(find doc -type f)
63         $(RSYNC) -av doc/ rubyforge.org:/var/www/gforge-projects/rainbows/
64         $(RSYNC) -av doc/ dcvr:/srv/rainbows/
65         git ls-files | xargs touch
67 # Create gzip variants of the same timestamp as the original so nginx
68 # "gzip_static on" can serve the gzipped versions directly.
69 doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
70 doc_gz:
71         touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
72         for i in $(docs); do \
73           gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
75 # launches any of the following shells with RUBYLIB set
76 irb sh bash ksh:
77         $@