http: move Version: header check into a less common path
[unicorn.git] / local.mk.sample
blob50195766942ff386cbd319dc2e4f91e1379ed821
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 gems := rack-1.1.0
10 # Avoid loading rubygems to speed up tests because gmake is
11 # fork+exec heavy with Ruby.
12 prefix = $(HOME)
13 ifeq ($(r19),)
14   RUBY := $(prefix)/bin/ruby
15   gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.8/gems/,$(gems))
16 else
17   prefix := $(prefix)/ruby-1.9
18   export PATH := $(prefix)/bin:$(PATH)
19   RUBY := $(prefix)/bin/ruby --disable-gems
20   gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.9.1/gems/,$(gems))
21 endif
23 ifdef gem_paths
24   sp :=
25   sp +=
26   export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
27 endif
29 # pipefail is THE reason to use bash (v3+) or never revisions of ksh93
30 # SHELL := /bin/bash -e -o pipefail
31 SHELL := /bin/ksh93 -e -o pipefail
33 full-test: test-18 test-19
34 test-18:
35         $(MAKE) test test-rails 2>&1 | sed -e 's!^!1.8 !'
36 test-19:
37         $(MAKE) test test-rails r19=1 2>&1 | sed -e 's!^!1.9 !'
39 latest: NEWS
40         @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<
42 # publishes docs to http://unicorn.bogomips.org
43 publish_doc:
44         -git set-file-times
45         $(RM) -r doc ChangeLog NEWS
46         $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
47         $(MAKE) -s latest > doc/LATEST
48         find doc/images doc/js -type f | \
49                 TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
50         $(MAKE) doc_gz
51         tar cf - $$(git ls-files examples/) | (cd doc && tar xf -)
52         chmod 644 $$(find doc -type f)
53         rsync -av doc/ dcvr:/srv/unicorn/
54         git ls-files | xargs touch
56 # Create gzip variants of the same timestamp as the original so nginx
57 # "gzip_static on" can serve the gzipped versions directly.
58 doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
59 doc_gz:
60         touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
61         for i in $(docs); do \
62           gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done