Permalink
Browse files

Merge branch 'release-0.1.11'

  • Loading branch information...
2 parents 39613d1 + 13bb84e commit 51444a059a917bd931b14777b4d4b3c89c813d88 @tatsuya6502 tatsuya6502 committed Apr 5, 2015
View
@@ -1,4 +1,5 @@
+.eqc-info
TAGS
lib/
-tmp/hibari/
rel/hibari/
+tmp/hibari/
View
@@ -2,3 +2,4 @@ Original authors "Hibari developers", in chronological order, are:
Gemini Mobile Technologies, Inc.
Cloudian, Inc.
+ Tatsuya Kawano
View
@@ -1,4 +1,4 @@
-Copyright (c) 2005-2013 Hibari developers. All rights reserved.
+Copyright (c) 2005-2015 Hibari developers. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
255 Makefile
@@ -1,4 +1,7 @@
-XDIST?=dev
+
+REBAR?=./rebar
+
+XDIST?=release
VSN?=$(shell grep '{rel, "hibari"' rel/reltool.config | sed 's/^.*rel, "hibari", "\(.*\)",/\1/')
ARCH=$(shell erl -noshell -eval 'io:format(erlang:system_info(system_architecture)), halt().')
WORDSIZE=$(shell erl -noshell -eval 'io:format(integer_to_list(try erlang:system_info({wordsize, external}) of Val -> 8*Val catch error:badarg -> 8*erlang:system_info(wordsize) end)), halt().')
@@ -13,6 +16,24 @@ PLT=$(HOME)/.dialyzer_plt.$(OTPREL)
DIALYZE_IGNORE_WARN?=dialyze-ignore-warnings.txt
DIALYZE_NOSPEC_IGNORE_WARN?=dialyze-nospec-ignore-warnings.txt
+ERLDIRS?=./lib
+ERLEUNITDIRS=`find $(ERLDIRS) -name .eunit -print | xargs echo` .eunit
+ERLQCDIRS=`find $(ERLDIRS) -name .qc -print | xargs echo` .qc
+
+DIALYZE_IGNORE_WARN?=dialyze-ignore-warnings.txt
+DIALYZE_NOSPEC_IGNORE_WARN?=dialyze-nospec-ignore-warnings.txt
+
+#TBD DIALYZER_OPTS?=-Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs
+DIALYZER_OPTS?=-Wunmatched_returns -Werror_handling -Wunderspecs
+DIALYZER_NOSPEC_OPTS?=-Wno_undefined_callbacks
+
+dialyzer=dialyzer -q --plt $(PLT) $(DIALYZER_OPTS) -r $(ERLDIRS)
+dialyzer-nospec=dialyzer -q --plt $(PLT) --no_spec $(DIALYZER_NOSPEC_OPTS) -r $(ERLDIRS)
+dialyzer-eunit=dialyzer -q --plt $(PLT) $(DIALYZER_OPTS) -r $(ERLEUNITDIRS)
+dialyzer-eunit-nospec=dialyzer -q --plt $(PLT) --no_spec $(DIALYZER_NOSPEC_OPTS) -r $(ERLEUNITDIRS)
+dialyzer-qc=dialyzer -q --plt $(PLT) $(DIALYZER_OPTS) -r $(ERLQCDIRS)
+dialyzer-qc-nospec=dialyzer -q --plt $(PLT) --no_spec $(DIALYZER_NOSPEC_OPTS) -r $(ERLQCDIRS)
+
ifeq ($(shell uname -s),Darwin)
ifeq ($(shell uname -m),x86_64)
otp_configure_flags= --enable-darwin-64bit
@@ -24,20 +45,23 @@ else
endif
.PHONY: all test \
- compile compile-eqc compile-proper \
- eunit-compile eqc-compile proper-compile \
- eunit eunit-core eunit-thrift \
- eqc proper \
+ bootstrap-package check-package package generate \
+ compile eunit eunit-core eunit-thrift \
+ eqc proper triq \
+ compile-for-eunit comple-for-eqc compile-for-proper compile-for-triq \
doc \
- build-plt check-plt \
- dialyze dialyze-spec dialyze-nospec \
- dialyze-eunit dialyze-eunit-spec dialyze-eunit-nospec \
- dialyze-eqc dialyze-eqc-spec dialyze-eqc-nospec \
- dialyze-proper dialyze-proper-spec dialyze-proper-nospec \
- ctags etags \
clean realclean distclean \
- otp_make_release_tests otp_run_release_tests \
- bootstrap-package check-package package generate
+ ctags etags \
+ dialyze dialyze-nospec \
+ updata-dialyzer-baseline update-dialyzer-nospec-baseline \
+ dialyze-eunit dialyze-eunit-nospec \
+ dialyze-eqc dialyze-eqc-nospec \
+ dialyze-proper dialyze-proper-nospec \
+ dialyze-triq dialyze-triq-nospec \
+ build-plt check-plt \
+ rebar rebar.git \
+ otp otp.git otp-debug otp-valgrind cerl-debug cerl-valgrind \
+ otp_make_release_tests otp_run_release_tests
all: compile
@@ -74,131 +98,145 @@ generate: clean compile
@echo "generating: $(RELPKG) ..."
@find ./lib -name svn -type l | xargs rm -f
@find ./lib -name rr-cache -type l | xargs rm -f
+ @find . -name shallow -type l -exec test ! -e {} \; -print | xargs rm -f
+ @find . -name packed-refs -type l -exec test ! -e {} \; -print | xargs rm -f
+ @rm -f ./lib/ubf/priv/doc/src/asciidoc.js
+ @rm -f ./lib/ubf/priv/doc/src/bootstrap
./rebar generate
@perl -i -pe 's/%% (.* generated) at .*//g;' \
rel/hibari/releases/*/*.rel \
rel/hibari/releases/*/*.script
compile:
@echo "compiling: $(RELPKG) ..."
- ./rebar compile
+ $(REBAR) compile
-compile-eqc:
- @echo "compiling-eqc: $(RELPKG) ..."
- ./rebar compile -D QC -D QC_EQC
+eunit: compile-for-eunit
+ @echo "eunit testing: $(RELPKG) ..."
+ $(REBAR) eunit -r skip_apps='meck,asciiedoc,edown,lager'
-compile-proper:
- @echo "compiling-proper: $(RELPKG) ..."
- ./rebar compile -D QC -D QC_PROPER
+eunit-core: compile-for-eunit
+ @echo "eunit testing (core): $(RELPKG) ..."
+ $(REBAR) eunit -r skip_apps='ubf,gdss_ubf_proto,ubf_thrift,lager,meck,asciiedoc,edown'
-eunit-compile: compile
- @echo "eunit test compiling: $(RELPKG) ..."
- ./rebar eunit-compile
+eunit-thrift: compile-for-eunit
+ @echo "eunit testing (thrift): $(RELPKG) ..."
+ $(REBAR) eunit -r skip_apps='gdss_brick,gdss_client,gdss_admin,cluster_info,partition_detector,congestion_watcher,gmt_util,lager,meck,asciiedoc,edown'
-eqc-compile: compile-eqc
- @echo "eqc test compiling: $(RELPKG) ..."
- ./rebar eunit-compile -D QC -D QC_EQC
+eqc: compile-for-eqc
+ @echo "eqc testing: $(RELPKG) ..."
+ $(REBAR) eqc -r qc_opts=3000 skip_apps='lager,meck,ubf,ubf_thrift'
-proper-compile: compile-proper
- @echo "proper test compiling: $(RELPKG) ..."
- ./rebar eunit-compile -D QC -D QC_PROPER
+eqc-thrift: compile-for-eqc
+ @echo "eqc testing (thrift): $(RELPKG) ..."
+ $(REBAR) eqc -r qc_opts=3000 skip_apps='gdss_brick,gdss_client,gdss_admin,cluster_info,partition_detector,congestion_watcher,gmt_util,lager,meck'
-eunit: eunit-compile
- @echo "eunit testing: $(RELPKG) ..."
- ./rebar eunit skip_apps=meck
+proper: compile-for-proper
+ @echo "proper testing: $(RELPKG) ..."
+ $(REBAR) proper -r skip_apps='meck,ubf,ubf_thrift'
-eunit-core: eunit-compile
- @echo "eunit testing (core): $(RELPKG) ..."
- ./rebar eunit skip_apps='meck,asciiedoc,edown,gdss_ubf_proto,ubf_thrift,ubf'
+triq: compile-for-triq
+ @echo "triq testing: $(RELPKG) ..."
+ $(REBAR) triq -r skip_apps='meck,ubf,ubf_thrift'
-eunit-thrift: eunit-compile
- @echo "eunit testing (thrift): $(RELPKG) ..."
- ./rebar eunit skip_apps='gdss_brick,gdss_client,gdss_admin,cluster_info,partition_detector,congestion_watcher,gmt_util,riak_err,meck,asciiedoc,edown'
+compile-for-eunit:
+ @echo "compiling-eunit: $(RELPKG) ..."
+ $(REBAR) compile -r eunit compile_only=true skip_apps='meck,ubf,ubf_thrift'
+
+compile-for-eqc:
+ @echo "compiling-eqc: $(RELPKG) ..."
+ $(REBAR) -D QC -D QC_EQC compile eqc -r compile_only=true skip_apps='meck,ubf,ubf_thrift'
-eqc: eqc-compile
- @echo "eqc testing: $(RELPKG) ... not implemented yet"
+compile-for-proper:
+ @echo "compiling-proper: $(RELPKG) ..."
+ $(REBAR) -D QC -D QC_PROPER compile eqc compile_only=true
-proper: proper-compile
- @echo "proper testing: $(RELPKG) ... not implemented yet"
+compile-for-triq:
+ @echo "compiling-triq: $(RELPKG) ..."
+ $(REBAR) -D QC -D QC_TRIQ compile triq compile_only=true
doc: compile
@echo "edoc generating: $(RELPKG) ..."
- ./rebar doc
+ $(REBAR) doc
-build-plt: $(PLT)
+clean:
+ @echo "cleaning: $(RELPKG) ..."
+ $(REBAR) -r clean
-check-plt: $(PLT)
- dialyzer --plt $(PLT) --check_plt
+realclean: clean
+ @echo "realcleaning: $(RELPKG) ..."
+ rm -f $(PLT) TAGS
-dialyze: dialyze-spec
+distclean:
+ @echo "distcleaning: $(RELPKG) ..."
+ repo forall -v -c 'git clean -fdx --exclude=lib/'
-dialyze-spec: build-plt clean compile
- @echo "dialyzing w/spec: $(RELPKG) ..."
- dialyzer --plt $(PLT) -Wunmatched_returns -r ./lib | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+#
+# tags
+#
-dialyze-nospec: build-plt clean compile
- @echo "dialyzing w/o spec: $(RELPKG) ..."
- dialyzer --plt $(PLT) --no_spec -Wno_undefined_callbacks -r ./lib | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+ctags:
+ find $(ERLDIRS) -name "*.[he]rl" -print | fgrep -v .eunit | fgrep -v .qc | ctags -
+ find $(ERLDIRS) -name "*.app.src" -print | fgrep -v .eunit | fgrep -v .qc | ctags -a -
+ find $(ERLDIRS) -name "*.config" -print | fgrep -v .eunit | fgrep -v .qc | ctags -a -
+ find $(ERLDIRS) -name "*.[ch]" -print | fgrep -v .eunit | fgrep -v .qc | ctags -a -
+ find $(ERLDIRS) -name "*.con" -print | fgrep -v .eunit | fgrep -v .qc | ctags -a -
-dialyze-eunit: dialyze-eunit-spec
+etags:
+ find $(ERLDIRS) -name "*.[he]rl" -print | fgrep -v .eunit | fgrep -v .qc | etags -
+ find $(ERLDIRS) -name "*.app.src" -print | fgrep -v .eunit | fgrep -v .qc | etags -a -
+ find $(ERLDIRS) -name "*.config" -print | fgrep -v .eunit | fgrep -v .qc | etags -a -
+ find $(ERLDIRS) -name "*.[ch]" -print | fgrep -v .eunit | fgrep -v .qc | etags -a -
+ find $(ERLDIRS) -name "*.con" -print | fgrep -v .eunit | fgrep -v .qc | etags -a -
-dialyze-eunit-spec: build-plt clean eunit-compile
- @echo "dialyzing .eunit w/spec: $(RELPKG) ..."
- #TODO dialyzer --plt $(PLT) -Wunmatched_returns -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
- dialyzer --plt $(PLT) -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+#
+# dialyzer
+#
-dialyze-eunit-nospec: build-plt clean eunit-compile
- @echo "dialyzing .eunit w/o spec: $(RELPKG) ..."
- ./rebar eunit-compile
- dialyzer --plt $(PLT) --no_spec -Wno_undefined_callbacks -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+dialyze: build-plt clean compile
+ -$(dialyzer) | grep -v '^ *$$' | tee $(DIALYZE_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_IGNORE_WARN)
-dialyze-eqc: dialyze-eqc-spec
+dialyze-nospec: build-plt clean compile
+ -$(dialyzer-nospec) | grep -v '^ *$$' | tee $(DIALYZE_NOSPEC_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
-dialyze-eqc-spec: build-plt clean eqc-compile
- @echo "dialyzing .eqc w/spec: $(RELPKG) ..."
- #TODO dialyzer --plt $(PLT) -Wunmatched_returns -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
- dialyzer --plt $(PLT) -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+update-dialyzer-baseline: dialyze
+ mv -f $(DIALYZE_IGNORE_WARN).log $(DIALYZE_IGNORE_WARN)
-dialyze-eqc-nospec: build-plt clean eqc-compile
- @echo "dialyzing .eqc w/o spec: $(RELPKG) ..."
- ./rebar eqc-compile
- dialyzer --plt $(PLT) --no_spec -Wno_undefined_callbacks -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+update-dialyzer-nospec-baseline: dialyze-nospec
+ mv -f $(DIALYZE_NOSPEC_IGNORE_WARN).log $(DIALYZE_NOSPEC_IGNORE_WARN)
-dialyze-proper: dialyze-proper-spec
+dialyze-eunit: build-plt clean compile-for-eunit
+ -$(dialyzer-eunit) | grep -v '^ *$$' | tee $(DIALYZE_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_IGNORE_WARN)
-dialyze-proper-spec: build-plt clean proper-compile
- @echo "dialyzing .proper w/spec: $(RELPKG) ..."
- #TODO dialyzer --plt $(PLT) -Wunmatched_returns -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
- dialyzer --plt $(PLT) -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_IGNORE_WARN)
+dialyze-eunit-nospec: build-plt clean compile-for-eunit
+ -$(dialyzer-eunit-nospec) | grep -v '^ *$$' | tee $(DIALYZE_NOSPEC_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
-dialyze-proper-nospec: build-plt clean proper-compile
- @echo "dialyzing .proper w/o spec: $(RELPKG) ..."
- ./rebar proper-compile
- dialyzer --plt $(PLT) --no_spec -Wno_undefined_callbacks -r `find ./lib -name .eunit -print | xargs echo` | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+dialyze-eqc: build-plt clean compile-for-eqc
+ -$(dialyzer-qc) | grep -v '^ *$$' | tee $(DIALYZE_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_IGNORE_WARN)
-ctags:
- find ./lib -name "*.[he]rl" -print | fgrep -v .eunit | ctags -
- find ./lib -name "*.app.src" -print | fgrep -v .eunit | ctags -a -
- find ./lib -name "*.config" -print | fgrep -v .eunit | ctags -a -
- find ./lib -name "*.[ch]" -print | fgrep -v .eunit | ctags -a -
+dialyze-eqc-nospec: build-plt clean compile-for-eqc
+ -$(dialyzer-qc-nospec) | grep -v '^ *$$' | tee $(DIALYZE_NOSPEC_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
-etags:
- find ./lib -name "*.[he]rl" -print | fgrep -v .eunit | etags -
- find ./lib -name "*.app.src" -print | fgrep -v .eunit | etags -a -
- find ./lib -name "*.config" -print | fgrep -v .eunit | etags -a -
- find ./lib -name "*.[ch]" -print | fgrep -v .eunit | etags -a -
+dialyze-proper: build-plt clean compile-for-proper
+ -$(dialyzer-qc) | grep -v '^ *$$' | tee $(DIALYZE_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_IGNORE_WARN)
-clean:
- @echo "cleaning: $(RELPKG) ..."
- ./rebar clean
+dialyze-proper-nospec: build-plt clean compile-for-proper
+ -$(dialyzer-qc-nospec) | grep -v '^ *$$' | tee $(DIALYZE_NOSPEC_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
-realclean: clean
- @echo "realcleaning: $(RELPKG) ..."
- rm -f $(PLT) TAGS
+dialyze-triq: build-plt clean compile-for-triq
+ -$(dialyzer-qc) | grep -v '^ *$$' | tee $(DIALYZE_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_IGNORE_WARN)
-distclean:
- @echo "distcleaning: $(RELPKG) ..."
- repo forall -v -c 'git clean -fdx --exclude=lib/'
+dialyze-triq-nospec: build-plt clean compile-for-triq
+ -$(dialyzer-qc-nospec) | grep -v '^ *$$' | tee $(DIALYZE_NOSPEC_IGNORE_WARN).log | fgrep -v -f $(DIALYZE_NOSPEC_IGNORE_WARN)
+
+#
+# dialyzer PLT
+#
+
+build-plt: $(PLT)
+
+check-plt: $(PLT)
+ dialyzer -q --plt $(PLT) --check_plt
$(PLT):
@echo "building: $(PLT) ..."
@@ -228,6 +266,25 @@ $(PLT):
webtool \
xmerl
+#
+# rebar
+#
+
+# $ rm -rf rebar rebar.git
+# $ make -f rebar.mk rebar
+rebar: rebar.git
+ (source ~/erlang/r15b03-1/activate && cd $(CURDIR)/rebar.git && make clean && make && cp -f rebar ..)
+ $(REBAR) -V
+ echo git commit -m \"Update rebar \(`./rebar -V | cut -d ' ' -f 6`\)\" rebar
+
+rebar.git:
+ rm -rf $(CURDIR)/rebar
+ git clone git://github.com/basho/rebar.git rebar.git
+
+#
+# Erlang/OTP
+#
+
otp: otp.git
make -C $(CURDIR)/otp.git install
Oops, something went wrong.

0 comments on commit 51444a0

Please sign in to comment.