speedup Makefile resolution
parent
dfbc24e2d0
commit
a033f0fa87
8
Makefile
8
Makefile
|
@ -1,11 +1,5 @@
|
||||||
# Erlang Nif Stuff
|
|
||||||
ifeq ($(ERL_EI_INCLUDE_DIR),)
|
ifeq ($(ERL_EI_INCLUDE_DIR),)
|
||||||
ERL_ROOT_DIR = $(shell erl -eval "io:format(\"~s~n\", [code:root_dir()])" -s init stop -noshell)
|
$(error ERL_EI_INCLUDE_DIR not set. Invoke via mix)
|
||||||
ifeq ($(ERL_ROOT_DIR),)
|
|
||||||
$(error Could not find the Erlang installation. Check to see that 'erl' is in your PATH)
|
|
||||||
endif
|
|
||||||
ERL_EI_INCLUDE_DIR = "$(ERL_ROOT_DIR)/usr/include"
|
|
||||||
ERL_EI_LIBDIR = "$(ERL_ROOT_DIR)/usr/lib"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Set Erlang-specific compile and linker flags
|
# Set Erlang-specific compile and linker flags
|
||||||
|
|
17
mix.exs
17
mix.exs
|
@ -27,8 +27,9 @@ defmodule Farmbot.Mixfile do
|
||||||
app: :farmbot,
|
app: :farmbot,
|
||||||
description: "The Brains of the Farmbot Project",
|
description: "The Brains of the Farmbot Project",
|
||||||
package: package(),
|
package: package(),
|
||||||
compilers: compilers(),
|
|
||||||
make_clean: ["clean"],
|
make_clean: ["clean"],
|
||||||
|
make_env: make_env(),
|
||||||
|
compilers: [:elixir_make] ++ Mix.compilers,
|
||||||
test_coverage: [tool: ExCoveralls],
|
test_coverage: [tool: ExCoveralls],
|
||||||
version: @version,
|
version: @version,
|
||||||
target: @target,
|
target: @target,
|
||||||
|
@ -41,7 +42,6 @@ defmodule Farmbot.Mixfile do
|
||||||
build_path: "_build/#{@target}",
|
build_path: "_build/#{@target}",
|
||||||
lockfile: "mix.lock.#{@target}",
|
lockfile: "mix.lock.#{@target}",
|
||||||
config_path: "config/config.exs",
|
config_path: "config/config.exs",
|
||||||
lockfile: "mix.lock",
|
|
||||||
elixirc_paths: elixirc_paths(Mix.env(), @target),
|
elixirc_paths: elixirc_paths(Mix.env(), @target),
|
||||||
aliases: aliases(Mix.env(), @target),
|
aliases: aliases(Mix.env(), @target),
|
||||||
deps: deps() ++ deps(@target),
|
deps: deps() ++ deps(@target),
|
||||||
|
@ -81,11 +81,14 @@ defmodule Farmbot.Mixfile do
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
defp compilers do
|
defp make_env do
|
||||||
case :init.get_plain_arguments() |> List.last() do
|
case System.get_env("ERL_EI_INCLUDE_DIR") do
|
||||||
a when a in ['mix', 'compile', 'firmware'] ->
|
nil ->
|
||||||
[:elixir_make] ++ Mix.compilers
|
%{
|
||||||
_ -> Mix.compilers
|
"ERL_EI_INCLUDE_DIR" => "#{:code.root_dir()}/usr/include",
|
||||||
|
"ERL_EI_LIBDIR" => "#{:code.root_dir()}/usr/lib"
|
||||||
|
}
|
||||||
|
_ -> %{}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue