diff options
author | Loïc Hoguin <[email protected]> | 2016-09-13 14:04:15 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-09-13 14:04:15 +0200 |
commit | c313f4dfb03b4105eed289141a0e7feef42f8612 (patch) | |
tree | 011e6d9466e0eb8bd4aed554c14829e5f9d489e9 /plugins | |
parent | 7c8215d8750913e3f8b774b560c0d22d56fe802a (diff) | |
parent | 6c546accfcb2ad6264c16f62e74d35367dabb72c (diff) | |
download | erlang.mk-c313f4dfb03b4105eed289141a0e7feef42f8612.tar.gz erlang.mk-c313f4dfb03b4105eed289141a0e7feef42f8612.tar.bz2 erlang.mk-c313f4dfb03b4105eed289141a0e7feef42f8612.zip |
Merge branch 'fix-dialyzer-ERLC_OPTS-filtering' of https://github.com/rabbitmq/erlang.mk
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/dialyzer.mk | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/dialyzer.mk b/plugins/dialyzer.mk index 8c2710f..d66bcc0 100644 --- a/plugins/dialyzer.mk +++ b/plugins/dialyzer.mk @@ -27,14 +27,17 @@ help:: # Plugin-specific targets. define filter_opts.erl - Opts = binary:split(<<"$1">>, <<"-">>, [global]), - Filtered = lists:reverse(lists:foldl(fun - (O = <<"pa ", _/bits>>, Acc) -> [O|Acc]; - (O = <<"D ", _/bits>>, Acc) -> [O|Acc]; - (O = <<"I ", _/bits>>, Acc) -> [O|Acc]; - (_, Acc) -> Acc - end, [], Opts)), - io:format("~s~n", [[["-", O] || O <- Filtered]]), + Opts = init:get_plain_arguments(), + {Filtered, _} = lists:foldl(fun + (O, {Os, true}) -> {[O|Os], false}; + (O = "-D", {Os, _}) -> {[O|Os], true}; + (O = [\\$$-, \\$$D, _ | _], {Os, _}) -> {[O|Os], false}; + (O = "-I", {Os, _}) -> {[O|Os], true}; + (O = [\\$$-, \\$$I, _ | _], {Os, _}) -> {[O|Os], false}; + (O = "-pa", {Os, _}) -> {[O|Os], true}; + (_, Acc) -> Acc + end, {[], false}, Opts), + io:format("~s~n", [string:join(lists:reverse(Filtered), " ")]), halt(). endef @@ -51,4 +54,4 @@ dialyze: else dialyze: $(DIALYZER_PLT) endif - $(verbose) dialyzer --no_native `$(call erlang,$(call filter_opts.erl,$(ERLC_OPTS)))` $(DIALYZER_DIRS) $(DIALYZER_OPTS) + $(verbose) dialyzer --no_native `$(ERL) -eval "$(subst $(newline),,$(subst ",\",$(call filter_opts.erl)))" -extra $(ERLC_OPTS)` $(DIALYZER_DIRS) $(DIALYZER_OPTS) |