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