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