Skip to content

Commit 9176d57

Browse files
michaelklishinmergify[bot]
authored andcommitted
Bump erlang.mk with 'gmake erlang-mk'
(cherry picked from commit 36674f1) # Conflicts: # erlang.mk
1 parent 5505399 commit 9176d57

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

erlang.mk

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
1818
export ERLANG_MK_FILENAME
1919

20+
<<<<<<< HEAD
2021
ERLANG_MK_VERSION = e13b4c7
22+
=======
23+
ERLANG_MK_VERSION = 7cef74a
24+
>>>>>>> 36674f112 (Bump erlang.mk with 'gmake erlang-mk')
2125
ERLANG_MK_WITHOUT =
2226

2327
# Make 3.81 and 3.82 are deprecated.
@@ -940,10 +944,11 @@ define dep_autopatch_rebar.erl
940944
Write(io_lib:format("COMPILE_FIRST +=~s\n", [Names]))
941945
end
942946
end(),
943-
Write("\n\nrebar_dep: preprocess pre-deps deps pre-app app\n"),
947+
Write("\n\nrebar_dep: preprocess pre-deps deps pre-app app post-app\n"),
944948
Write("\npreprocess::\n"),
945949
Write("\npre-deps::\n"),
946950
Write("\npre-app::\n"),
951+
Write("\npost-app::\n"),
947952
PatchHook = fun(Cmd) ->
948953
Cmd2 = re:replace(Cmd, "^([g]?make)(.*)( -C.*)", "\\\\1\\\\3\\\\2", [{return, list}]),
949954
case Cmd2 of
@@ -974,6 +979,24 @@ define dep_autopatch_rebar.erl
974979
end || H <- Hooks]
975980
end
976981
end(),
982+
fun() ->
983+
case lists:keyfind(post_hooks, 1, Conf) of
984+
false -> ok;
985+
{_, Hooks} ->
986+
[case H of
987+
{compile, Cmd} ->
988+
Write("\npost-app::\n\tCC=$$\(CC) " ++ PatchHook(Cmd) ++ "\n");
989+
{{pc, compile}, Cmd} ->
990+
Write("\npost-app::\n\tCC=$$\(CC) " ++ PatchHook(Cmd) ++ "\n");
991+
{Regex, compile, Cmd} ->
992+
case rebar_utils:is_arch(Regex) of
993+
true -> Write("\npost-app::\n\tCC=$$\(CC) " ++ PatchHook(Cmd) ++ "\n");
994+
false -> ok
995+
end;
996+
_ -> ok
997+
end || H <- Hooks]
998+
end
999+
end(),
9771000
ShellToMk = fun(V0) ->
9781001
V1 = re:replace(V0, "[$$][(]", "$$\(shell ", [global]),
9791002
V = re:replace(V1, "([$$])(?![(])(\\\\w*)", "\\\\1(\\\\2)", [global]),
@@ -1952,7 +1975,8 @@ define dep_autopatch_mix.erl
19521975
endef
19531976

19541977
define dep_autopatch_mix
1955-
sed 's|\(defmodule.*do\)|\1\n try do\n Code.compiler_options(on_undefined_variable: :warn)\n rescue _ -> :ok\n end\n|g' -i $(DEPS_DIR)/$(1)/mix.exs; \
1978+
sed 's|\(defmodule.*do\)|\1\n try do\n Code.compiler_options(on_undefined_variable: :warn)\n rescue _ -> :ok\n end\n|g' $(DEPS_DIR)/$(1)/mix.exs > $(DEPS_DIR)/$(1)/mix.exs.new; \
1979+
mv $(DEPS_DIR)/$(1)/mix.exs.new $(DEPS_DIR)/$(1)/mix.exs; \
19561980
$(MAKE) $(DEPS_DIR)/hex_core/ebin/dep_built; \
19571981
MIX_ENV="$(if $(MIX_ENV),$(strip $(MIX_ENV)),prod)" \
19581982
$(call erlang,$(call dep_autopatch_mix.erl,$1))

0 commit comments

Comments
 (0)