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