1 # use GNU Make to run tests in parallel, and without depending on Rubygems
3 RSYNC_DEST
:= bogomips.org
:/srv
/bogomips
/mogilefs-client
4 git_version_gen
:= $(shell .
/GIT-VERSION-GEN
)
6 T
:= $(wildcard test/test*.rb
)
7 TO
:= $(subst .rb
,.log
,$(T
))
10 @cat
$(TO
) | ruby
test/aggregate.rb
13 $(RM
) $(TO
) $(addsuffix +,$(TO
))
17 quiet_pre
= @echo
'* $@';
18 quiet_post
= >$(t
) 2>&1
20 # we can't rely on -o pipefail outside of bash 3+,
21 # so we use a stamp file to indicate success and
22 # have rm fail if the stamp didn't get created
23 stamp
= $@
$(log_suffix
).ok
24 quiet_pre
= @echo
$(ruby
) $@
$(TEST_OPTS
); ! test -f
$(stamp
) && (
25 quiet_post
= && > $(stamp
) )>&2 | tee
$(t
); rm $(stamp
) 2>/dev
/null
28 run_test
= $(quiet_pre
) setsid
$(ruby
) -w
$@
$(TEST_OPTS
) $(quiet_post
) || \
29 (sed
"s,^,$(extra): ," >&2 < $(t
); exit
1)
31 $(T
): t
= $(subst .rb
,.log
,$@
)
32 $(T
): export RUBYLIB
:= $(CURDIR
)/lib
:$(RUBYLIB
)
36 RUBY_VERSION_FILE
= lib
/mogilefs
/version.rb
38 git diff
--exit-code HEAD^
0
43 libs
:= $(wildcard lib
/*.rb lib
/*/*.rb
)
53 @
(for i in
$$(git ls-files
'*.rb'| grep
-v
'^setup\.rb$$'); \
54 do ruby
-d
-W2
-c
$$i; done
) | grep
-v
'^Syntax OK$$' ||
:
58 doc
:: .document .wrongdoc.yml
$(pkg_extra
)
59 -find lib
-type f
-name
'*.rbc' -exec
rm -f
'{}' ';'
62 install -m644
$(shell LC_ALL
=C grep
'^[A-Z]' .document
) doc
/
64 ln
-s README README.txt
&& \
65 ln
-s README.html README_txt.html
&& \
66 ln
-s LICENSE LICENSE.txt
&& \
67 ln
-s LICENSE.html LICENSE_txt.html
&& \
68 ln
-s History History.txt
&& \
69 ln
-s History.html History_txt.html
71 # Create gzip variants of the same timestamp as the original so nginx
72 # "gzip_static on" can serve the gzipped versions directly.
73 doc_gz
: docs
= $(shell find doc
-type f
! -regex
'^.*\.\(gif\|jpg\|png\|gz\)$$')
75 for i in
$(docs
); do \
76 gzip
--rsyncable
-9 < $$i > $$i.gz
; touch
-r
$$i $$i.gz
; done
78 # this requires GNU coreutils variants
79 ifneq ($(RSYNC_DEST
),)
83 find doc
/images
-type f | \
84 TZ
=UTC xargs touch
-d
'1970-01-01 00:00:06' doc
/rdoc.css
86 $(RSYNC
) -av doc
/ $(RSYNC_DEST
)/
87 git ls-files | xargs touch
90 .PHONY
: doc .FORCE-GIT-VERSION-FILE