summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Avdey <eiri@eiri.ca>2018-06-15 09:21:56 -0300
committerGitHub <noreply@github.com>2018-06-15 09:21:56 -0300
commitc7d35c3133499fcb2f7989aea0c4c0e9277351f9 (patch)
tree9807e0fc4744883de16103226a9948d0689dd862
parent71c33b15324d3b7878d9965fd5ce4b32526bef69 (diff)
parent41decfa06147bf48f9ac30121cbe9ec02c23d5c7 (diff)
downloadcouchdb-c7d35c3133499fcb2f7989aea0c4c0e9277351f9.tar.gz
Merge pull request #1387 from cloudant/make-bin_opt_info-optional
Add compile's command line options, introduce `ERL_OPTS` and make `bin_opt_info` optional.
-rw-r--r--Makefile11
-rw-r--r--rebar.config.script7
2 files changed, 13 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index abe8fbbb8..1e0ea8224 100644
--- a/Makefile
+++ b/Makefile
@@ -34,16 +34,19 @@ skip_deps=folsom,meck,mochiweb,triq,snappy,bcrypt,hyper
suites=
tests=
+COMPILE_OPTS=$(shell echo "\
+ apps=$(apps) \
+ " | sed -e 's/[a-z_]\{1,\}= / /g')
EUNIT_OPTS=$(shell echo "\
apps=$(apps) \
skip_deps=$(skip_deps) \
suites=$(suites) \
tests=$(tests) \
- " | sed -e 's/[a-z]\+= / /g')
+ " | sed -e 's/[a-z]\{1,\}= / /g')
DIALYZE_OPTS=$(shell echo "\
apps=$(apps) \
skip_deps=$(skip_deps) \
- " | sed -e 's/[a-z]\+= / /g')
+ " | sed -e 's/[a-z]\{1,\}= / /g')
#ignore javascript tests
ignore_js_suites=
@@ -73,9 +76,9 @@ help:
.PHONY: couch
-# target: couch - Build CouchDB core
+# target: couch - Build CouchDB core, use ERL_OPTS to provide custom compiler's options
couch: config.erl
- @COUCHDB_VERSION=$(COUCHDB_VERSION) $(REBAR) compile
+ @COUCHDB_VERSION=$(COUCHDB_VERSION) $(REBAR) compile $(COMPILE_OPTS)
@cp src/couch/priv/couchjs bin/
diff --git a/rebar.config.script b/rebar.config.script
index a3462c990..82f4d70b9 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -87,13 +87,18 @@ MakeDep = fun
{AppName, ".*", {git, Url, Version}, Options}
end,
+ErlOpts = case os:getenv("ERL_OPTS") of
+ false -> [];
+ Opts -> [list_to_atom(O) || O <- string:tokens(Opts, ",")]
+end,
+
AddConfig = [
{require_otp_vsn, "R16B03|R16B03-1|17|18|19|20"},
{deps_dir, "src"},
{deps, lists:map(MakeDep, DepDescs)},
{sub_dirs, SubDirs},
{lib_dirs, ["src"]},
- {erl_opts, [bin_opt_info, debug_info, {i, "../"}]},
+ {erl_opts, [{i, "../"} | ErlOpts]},
{eunit_opts, [verbose]},
{plugins, [eunit_plugin]},
{dialyzer, [