ruby_posix_mq.git  about / heads / tags
POSIX message queues for Ruby
blob 4ce6cf8b7ba09feb07dd4c1f772348eabe5a4fc0 2145 bytes (raw)
$ git show v0.1.0:local.mk.sample	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
# this is a sample local.mk file, feel free to modify it for your needs
# GNUmakefile will source local.mk in the top-level source tree
# if it is present.
#
# This is depends on a bunch of GNU-isms from bash, touch.

RSYNC = rsync
DLEXT := so
gems :=

# Avoid loading rubygems to speed up tests because gmake is
# fork+exec heavy with Ruby.
prefix = $(HOME)
ifeq ($(r19),)
  RUBY := $(prefix)/bin/ruby
  gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.8/gems/,$(gems))
else
  prefix := $(prefix)/ruby-1.9
  export PATH := $(prefix)/bin:$(PATH)
  RUBY := $(prefix)/bin/ruby --disable-gems
  gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.9.1/gems/,$(gems))
endif

ifdef gem_paths
  sp :=
  sp +=
  export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
endif

# pipefail is THE reason to use bash (v3+) or never revisions of ksh93
# SHELL := /bin/bash -e -o pipefail
SHELL := /bin/ksh93 -e -o pipefail

# trace execution of tests
# TRACER = strace -f -o $(t_pfx).strace -s 100000
TRACER = /usr/bin/time -v -o $(t_pfx).time

full-test: test-18 test-19
test-18:
	$(MAKE) test 2>&1 | sed -e 's!^!1.8 !'
test-19:
	$(MAKE) test r19=t 2>&1 | sed -e 's!^!1.9 !'

latest: NEWS
	@awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<

# publishes docs to http://bogomips.org/ruby_posix_mq/
publish_doc:
	-git set-file-times
	$(RM) -r doc ChangeLog NEWS
	$(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
	$(MAKE) -s latest > doc/LATEST
	find doc/images doc/js -type f | \
		TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
	$(MAKE) doc_gz
	chmod 644 $$(find doc -type f)
	$(RSYNC) -av doc/ dcvr:/srv/bogomips/ruby_posix_mq/
	git ls-files | xargs touch

# Create gzip variants of the same timestamp as the original so nginx
# "gzip_static on" can serve the gzipped versions directly.
doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
doc_gz:
	touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
	for i in $(docs); do \
	  gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done

# launches any of the following shells with RUBYLIB set
irb sh bash ksh:
	$@

git clone https://yhbt.net/ruby_posix_mq.git