@@ -3,7 +3,6 @@ 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
7
6
Q := @
8
7
PREFIX := /usr/local
9
8
LIBDIR := lib
@@ -15,7 +14,17 @@ INSTALL_PROGRAM = $(INSTALL) -m755
15
14
.PHONY : install compile erlang elixir dialyze test clean docs release_docs release_zip check_erlang_release
16
15
.NOTPARALLEL : compile
17
16
18
- # ==> Templates
17
+ # ==> Functions
18
+
19
+ # This check should work for older versions like R16B
20
+ # as well as new verions like 17.1 and 18
21
+ define CHECK_ERLANG_RELEASE
22
+ $(Q ) erl -noshell -eval 'io:fwrite("~s", [erlang:system_info(otp_release)])' -s erlang halt | grep -q '^1[789]'; \
23
+ if [ $$? != 0 ]; then \
24
+ echo "At least Erlang 17.0 is required to build Elixir"; \
25
+ exit 1; \
26
+ fi;
27
+ endef
19
28
20
29
define APP_TEMPLATE
21
30
$(1 ) : lib/$(1 ) /ebin/Elixir.$(2 ) .beam lib/$(1 ) /ebin/$(1 ) .app
@@ -44,18 +53,10 @@ UNICODE:=lib/elixir/ebin/Elixir.String.Unicode.beam
44
53
45
54
default : compile
46
55
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
56
+ compile : lib/elixir/src/elixir.app.src erlang elixir
57
57
58
58
lib/elixir/src/elixir.app.src : src/elixir.app.src
59
+ $(Q ) $(call CHECK_ERLANG_RELEASE)
59
60
$(Q ) rm -rf lib/elixir/src/elixir.app.src
60
61
$(Q ) echo " %% This file is automatically generated from <project_root>/src/elixir.app.src" \
61
62
> lib/elixir/src/elixir.app.src
0 commit comments