unicorn 0.8.4
[unicorn.git] / local.mk.sample
blob84bcf44b3a28e25271f932ca9b2d059b265917c4
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 DLEXT := so
8 rack_ver := 1.0.0
10 # Avoid loading rubygems to speed up tests because gmake is
11 # fork+exec heavy with Ruby.
12 ifeq ($(r19),)
13   ruby := $(HOME)/bin/ruby
14   RUBYLIB := $(HOME)/lib/ruby/gems/1.8/gems/rack-$(rack_ver)/lib
15 else
16   export PATH := $(HOME)/ruby-1.9/bin:$(PATH)
17   ruby := $(HOME)/ruby-1.9/bin/ruby --disable-gems
18   RUBYLIB := $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/rack-$(rack_ver)/lib
19 endif
21 # pipefail is THE reason to use bash (v3+)
22 SHELL := /bin/bash -e -o pipefail
24 full-test: test-18 test-19
25 test-18:
26         $(MAKE) test test-rails 2>&1 | sed -u -e 's!^!1.8 !'
27 test-19:
28         $(MAKE) test test-rails r19=1 2>&1 | sed -u -e 's!^!1.9 !'
30 # publishes docs to http://unicorn.bogomips.org
31 publish_doc:
32         -git set-file-times
33         $(MAKE) doc
34         $(MAKE) doc_gz
35         rsync -av --delete doc/ dcvr:/srv/unicorn/
36         git ls-files | xargs touch
38 # Create gzip variants of the same timestamp as the original so nginx
39 # "gzip_static on" can serve the gzipped versions directly.
40 doc_gz: suf := html js css
41 doc_gz: globs := $(addprefix doc/*.,$(suf)) $(addprefix doc/*/*.,$(suf))
42 doc_gz: docs := $(wildcard $(globs))
43 doc_gz:
44         for i in $(docs); do gzip < $$i > $$i.gz; touch -r $$i $$i.gz; done