@@ -3,6 +3,7 @@ ELIXIRC := bin/elixirc --verbose --ignore-module-conflict
3
3
ERLC := erlc -I lib/elixir/include
4
4
ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
5
5
VERSION := $(strip $(shell cat VERSION) )
6
+ MIN_ERLANG_VERSION := 17
6
7
Q := @
7
8
PREFIX := /usr/local
8
9
LIBDIR := lib
@@ -11,7 +12,7 @@ INSTALL_DIR = $(INSTALL) -m755 -d
11
12
INSTALL_DATA = $(INSTALL ) -m644
12
13
INSTALL_PROGRAM = $(INSTALL ) -m755
13
14
14
- .PHONY : install compile erlang elixir dialyze test clean docs release_docs release_zip
15
+ .PHONY : install compile erlang elixir dialyze test clean docs release_docs release_zip check_erlang_release
15
16
.NOTPARALLEL : compile
16
17
17
18
# ==> Templates
@@ -43,7 +44,16 @@ UNICODE:=lib/elixir/ebin/Elixir.String.Unicode.beam
43
44
44
45
default : compile
45
46
46
- compile : lib/elixir/src/elixir.app.src erlang elixir
47
+ compile : check_erlang_release lib/elixir/src/elixir.app.src erlang elixir
48
+
49
+ # this check should work for older versions like R16B
50
+ # as well as new verions like 17.1 and 18
51
+ check_erlang_release :
52
+ @ erl -noshell -eval ' io:fwrite("~s", [erlang:system_info(otp_release)])' -s erlang halt | grep -q ' ^1[789]' ; \
53
+ if [ $$ ? != 0 ]; then \
54
+ echo " At least Erlang 17.0 is required to build Elixir" ; \
55
+ exit 1; \
56
+ fi
47
57
48
58
lib/elixir/src/elixir.app.src : src/elixir.app.src
49
59
$(Q ) rm -rf lib/elixir/src/elixir.app.src
@@ -61,7 +71,7 @@ elixir: kernel lib/eex/ebin/Elixir.EEx.beam mix ex_unit eex iex
61
71
62
72
kernel : $(KERNEL ) VERSION
63
73
$(KERNEL ) : lib/elixir/lib/* .ex lib/elixir/lib/* /* .ex
64
- $(Q ) if [ ! -f $( KERNEL) ]; then \
74
+ $(Q ) if [ ! -f $( KERNEL) ]; then \
65
75
echo " ==> bootstrap (compile)" ; \
66
76
$(ERL ) -s elixir_compiler core -s erlang halt; \
67
77
fi
0 commit comments