1717ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST ) ) )
1818export ERLANG_MK_FILENAME
1919
20- ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185
20+ ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158
2121ERLANG_MK_WITHOUT =
2222
2323# Make 3.81 and 3.82 are deprecated.
@@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git
20232023pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse
20242024pkg_ibrowse_commit = master
20252025
2026+ PACKAGES += idna
2027+ pkg_idna_name = idna
2028+ pkg_idna_description = Erlang IDNA lib
2029+ pkg_idna_homepage = https://github.com/benoitc/erlang-idna
2030+ pkg_idna_fetch = git
2031+ pkg_idna_repo = https://github.com/benoitc/erlang-idna
2032+ pkg_idna_commit = master
2033+
20262034PACKAGES += ierlang
20272035pkg_ierlang_name = ierlang
20282036pkg_ierlang_description = An Erlang language kernel for IPython.
@@ -2298,9 +2306,9 @@ pkg_kvs_commit = master
22982306PACKAGES += lager
22992307pkg_lager_name = lager
23002308pkg_lager_description = A logging framework for Erlang/OTP.
2301- pkg_lager_homepage = https://github.com/basho /lager
2309+ pkg_lager_homepage = https://github.com/erlang-lager /lager
23022310pkg_lager_fetch = git
2303- pkg_lager_repo = https://github.com/basho /lager
2311+ pkg_lager_repo = https://github.com/erlang-lager /lager
23042312pkg_lager_commit = master
23052313
23062314PACKAGES += lager_amqp_backend
@@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master
23142322PACKAGES += lager_syslog
23152323pkg_lager_syslog_name = lager_syslog
23162324pkg_lager_syslog_description = Syslog backend for lager
2317- pkg_lager_syslog_homepage = https://github.com/basho /lager_syslog
2325+ pkg_lager_syslog_homepage = https://github.com/erlang-lager /lager_syslog
23182326pkg_lager_syslog_fetch = git
2319- pkg_lager_syslog_repo = https://github.com/basho /lager_syslog
2327+ pkg_lager_syslog_repo = https://github.com/erlang-lager /lager_syslog
23202328pkg_lager_syslog_commit = master
23212329
23222330PACKAGES += lambdapad
@@ -3786,9 +3794,9 @@ pkg_trie_commit = master
37863794PACKAGES += triq
37873795pkg_triq_name = triq
37883796pkg_triq_description = Trifork QuickCheck
3789- pkg_triq_homepage = https://github.com/krestenkrab /triq
3797+ pkg_triq_homepage = https://github.com/triqng /triq
37903798pkg_triq_fetch = git
3791- pkg_triq_repo = https://github.com/krestenkrab /triq
3799+ pkg_triq_repo = https://github.com/triqng /triq.git
37923800pkg_triq_commit = master
37933801
37943802PACKAGES += tunctl
@@ -4280,7 +4288,7 @@ endef
42804288# if given. Do it for all 3 possible Makefile file names.
42814289ifeq ($(NO_AUTOPATCH_ERLANG_MK ) ,)
42824290define dep_autopatch_erlang_mk
4283- $t for f in Makefile makefile GNUmakefile; do \
4291+ for f in Makefile makefile GNUmakefile; do \
42844292 if [ -f $(DEPS_DIR ) /$1/$$f ]; then \
42854293 sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME ) ,$$(ERLANG_MK_FILENAME ) ,erlang.mk) '/ $(DEPS_DIR ) /$1/$$f; \
42864294 fi \
@@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl
43574365 lists:foreach(fun
43584366 ({d, D}) ->
43594367 Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n");
4368+ ({d, DKey, DVal}) ->
4369+ Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n");
43604370 ({i, I}) ->
43614371 Write(["ERLC_OPTS += -I ", I, "\n"]);
43624372 ({platform_define, Regex, D}) ->
@@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl
45794589 AppSrc = "$(call core_native_path,$(DEPS_DIR ) /$1/src/$1.app.src) ",
45804590 AppSrcScript = AppSrc ++ ".script",
45814591 Bindings = erl_eval:new_bindings(),
4582- {ok, Conf} = file:script(AppSrcScript, Bindings),
4592+ {ok, [ Conf] } = file:script(AppSrcScript, Bindings),
45834593 ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])),
45844594 halt()
45854595endef
@@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log
47314741ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP ) /recursive-test-deps-list.log
47324742ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP ) /recursive-shell-deps-list.log
47334743
4744+ # Copyright (c) 2015-2017, Loïc Hoguin <[email protected] >4745+ # This file is part of erlang.mk and subject to the terms of the ISC License.
4746+
4747+ .PHONY : distclean-kerl
4748+
4749+ KERL_INSTALL_DIR ?= $(HOME ) /erlang
4750+
4751+ ifeq ($(strip $(KERL ) ) ,)
4752+ KERL := $(ERLANG_MK_TMP ) /kerl/kerl
4753+ endif
4754+
4755+ export KERL
4756+
4757+ KERL_GIT ?= https://github.com/kerl/kerl
4758+ KERL_COMMIT ?= master
4759+
4760+ KERL_MAKEFLAGS ?=
4761+
4762+ OTP_GIT ?= https://github.com/erlang/otp
4763+
4764+ define kerl_otp_target
4765+ ifeq ($(wildcard $(KERL_INSTALL_DIR ) /$(1 ) ) ,)
4766+ $(KERL_INSTALL_DIR ) /$(1 ) : $(KERL )
4767+ MAKEFLAGS=" $( KERL_MAKEFLAGS) " $(KERL ) build git $(OTP_GIT ) $(1 ) $(1 )
4768+ $(KERL ) install $(1 ) $(KERL_INSTALL_DIR ) /$(1 )
4769+ endif
4770+ endef
4771+
4772+ define kerl_hipe_target
4773+ ifeq ($(wildcard $(KERL_INSTALL_DIR ) /$1-native) ,)
4774+ $(KERL_INSTALL_DIR ) /$1-native : $(KERL )
4775+ KERL_CONFIGURE_OPTIONS=--enable-native-libs \
4776+ MAKEFLAGS=" $( KERL_MAKEFLAGS) " $(KERL ) build git $(OTP_GIT ) $1 $1 -native
4777+ $(KERL ) install $1 -native $(KERL_INSTALL_DIR ) /$1 -native
4778+ endif
4779+ endef
4780+
4781+ $(KERL ) :
4782+ $(verbose ) mkdir -p $(ERLANG_MK_TMP )
4783+ $(gen_verbose ) git clone --depth 1 $(KERL_GIT ) $(ERLANG_MK_TMP ) /kerl
4784+ $(verbose ) cd $(ERLANG_MK_TMP ) /kerl && git checkout $(KERL_COMMIT )
4785+ $(verbose ) chmod +x $(KERL )
4786+
4787+ distclean :: distclean-kerl
4788+
4789+ distclean-kerl :
4790+ $(gen_verbose ) rm -rf $(KERL )
4791+
4792+ # Allow users to select which version of Erlang/OTP to use for a project.
4793+
4794+ ERLANG_OTP ?=
4795+ ERLANG_HIPE ?=
4796+
4797+ # Use kerl to enforce a specific Erlang/OTP version for a project.
4798+ ifneq ($(strip $(ERLANG_OTP ) ) ,)
4799+ export PATH := $(KERL_INSTALL_DIR ) /$(ERLANG_OTP ) /bin:$(PATH )
4800+ SHELL := env PATH=$(PATH ) $(SHELL )
4801+ $(eval $(call kerl_otp_target,$(ERLANG_OTP)))
4802+
4803+ # Build Erlang/OTP only if it doesn't already exist.
4804+ ifeq ($(wildcard $(KERL_INSTALL_DIR ) /$(ERLANG_OTP ) )$(BUILD_ERLANG_OTP ) ,)
4805+ $(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...)
4806+ $(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2)
4807+ endif
4808+
4809+ else
4810+ # Same for a HiPE enabled VM.
4811+ ifneq ($(strip $(ERLANG_HIPE ) ) ,)
4812+ export PATH := $(KERL_INSTALL_DIR ) /$(ERLANG_HIPE ) -native/bin:$(PATH )
4813+ SHELL := env PATH=$(PATH ) $(SHELL )
4814+ $(eval $(call kerl_hipe_target,$(ERLANG_HIPE)))
4815+
4816+ # Build Erlang/OTP only if it doesn't already exist.
4817+ ifeq ($(wildcard $(KERL_INSTALL_DIR ) /$(ERLANG_HIPE ) )$(BUILD_ERLANG_OTP ) ,)
4818+ $(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...)
4819+ $(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2)
4820+ endif
4821+
4822+ endif
4823+ endif
4824+
47344825# Copyright (c) 2015-2016, Loïc Hoguin <[email protected] >47354826# This file is part of erlang.mk and subject to the terms of the ISC License.
47364827
@@ -5966,10 +6057,10 @@ else
59666057 $(call render_template,bs_erl_nif,src/$n.erl)
59676058endif
59686059
5969- # Copyright (c) 2015-2016 , Loïc Hoguin <[email protected] >6060+ # Copyright (c) 2015-2017 , Loïc Hoguin <[email protected] >59706061# This file is part of erlang.mk and subject to the terms of the ISC License.
59716062
5972- .PHONY : ci ci-prepare ci-setup distclean-kerl
6063+ .PHONY : ci ci-prepare ci-setup
59736064
59746065CI_OTP ?=
59756066CI_HIPE ?=
@@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),)
59876078ci ::
59886079else
59896080
5990- ifeq ($(strip $(KERL ) ) ,)
5991- KERL := $(ERLANG_MK_TMP ) /kerl/kerl
5992- endif
5993-
5994- export KERL
5995-
5996- KERL_GIT ?= https://github.com/kerl/kerl
5997- KERL_COMMIT ?= master
5998-
5999- KERL_MAKEFLAGS ?=
6000-
6001- OTP_GIT ?= https://github.com/erlang/otp
6002-
6003- CI_INSTALL_DIR ?= $(HOME ) /erlang
6004-
60056081ci :: $(addprefix ci-,$(CI_OTP ) $(addsuffix -native,$(CI_HIPE ) ) $(addsuffix -erllvm,$(CI_ERLLVM ) ) )
60066082
6007- ci-prepare : $(addprefix $(CI_INSTALL_DIR ) /,$(CI_OTP ) $(addsuffix -native,$(CI_HIPE ) ) )
6083+ ci-prepare : $(addprefix $(KERL_INSTALL_DIR ) /,$(CI_OTP ) $(addsuffix -native,$(CI_HIPE ) ) )
60086084
60096085ci-setup ::
60106086
@@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1);
60146090ci_verbose = $(ci_verbose_$(V ) )
60156091
60166092define ci_target
6017- ci-$1: $(CI_INSTALL_DIR ) /$2
6093+ ci-$1: $(KERL_INSTALL_DIR ) /$2
60186094 $(verbose ) $(MAKE ) --no-print-directory clean
60196095 $(ci_verbose ) \
6020- PATH="$(CI_INSTALL_DIR ) /$2/bin:$(PATH ) " \
6096+ PATH="$(KERL_INSTALL_DIR ) /$2/bin:$(PATH ) " \
60216097 CI_OTP_RELEASE="$1" \
60226098 CT_OPTS="-label $1" \
60236099 CI_VM="$3" \
@@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp)))
60296105$(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native)))
60306106$(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm)))
60316107
6032- define ci_otp_target
6033- ifeq ($(wildcard $(CI_INSTALL_DIR ) /$(1 ) ) ,)
6034- $(CI_INSTALL_DIR ) /$(1 ) : $(KERL )
6035- MAKEFLAGS=" $( KERL_MAKEFLAGS) " $(KERL ) build git $(OTP_GIT ) $(1 ) $(1 )
6036- $(KERL ) install $(1 ) $(CI_INSTALL_DIR ) /$(1 )
6037- endif
6038- endef
6039-
6040- $(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp))))
6041-
6042- define ci_hipe_target
6043- ifeq ($(wildcard $(CI_INSTALL_DIR ) /$1-native) ,)
6044- $(CI_INSTALL_DIR ) /$1-native : $(KERL )
6045- KERL_CONFIGURE_OPTIONS=--enable-native-libs \
6046- MAKEFLAGS=" $( KERL_MAKEFLAGS) " $(KERL ) build git $(OTP_GIT ) $1 $1 -native
6047- $(KERL ) install $1 -native $(CI_INSTALL_DIR ) /$1 -native
6048- endif
6049- endef
6050-
6051- $(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp))))
6052-
6053- $(KERL ) :
6054- $(verbose ) mkdir -p $(ERLANG_MK_TMP )
6055- $(gen_verbose ) git clone --depth 1 $(KERL_GIT ) $(ERLANG_MK_TMP ) /kerl
6056- $(verbose ) cd $(ERLANG_MK_TMP ) /kerl && git checkout $(KERL_COMMIT )
6057- $(verbose ) chmod +x $(KERL )
6108+ $(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp))))
6109+ $(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp))))
60586110
60596111help ::
60606112 $(verbose ) printf " %s\n" " " \
@@ -6064,10 +6116,6 @@ help::
60646116 " The CI_OTP variable must be defined with the Erlang versions" \
60656117 " that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3"
60666118
6067- distclean :: distclean-kerl
6068-
6069- distclean-kerl :
6070- $(gen_verbose ) rm -rf $(KERL )
60716119endif
60726120
60736121# Copyright (c) 2013-2016, Loïc Hoguin <[email protected] >@@ -6433,6 +6481,60 @@ apps-eunit:
64336481endif
64346482endif
64356483
6484+ # Copyright (c) 2015-2017, Loïc Hoguin <[email protected] >6485+ # This file is part of erlang.mk and subject to the terms of the ISC License.
6486+
6487+ ifeq ($(filter proper,$(DEPS ) $(TEST_DEPS ) ) ,proper)
6488+ .PHONY : proper
6489+
6490+ # Targets.
6491+
6492+ tests :: proper
6493+
6494+ define proper_check.erl
6495+ code:add_pathsa(["$(call core_native_path,$(CURDIR ) /ebin) ", "$(call core_native_path,$(DEPS_DIR ) /* /ebin) "]),
6496+ Module = fun(M) ->
6497+ [true] =:= lists:usort([
6498+ case atom_to_list(F) of
6499+ "prop_" ++ _ ->
6500+ io:format("Testing ~p:~p/0~n", [M, F]),
6501+ proper:quickcheck(M:F());
6502+ _ ->
6503+ true
6504+ end
6505+ || {F, 0} <- M:module_info(exports)])
6506+ end,
6507+ try
6508+ case $(1 ) of
6509+ all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3 ) ) ]]);
6510+ module -> Module($(2 ) );
6511+ function -> proper:quickcheck($(2 ) )
6512+ end
6513+ of
6514+ true -> halt(0);
6515+ _ -> halt(1)
6516+ catch error:undef ->
6517+ io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]),
6518+ halt(0)
6519+ end.
6520+ endef
6521+
6522+ ifdef t
6523+ ifeq (,$(findstring :,$(t ) ))
6524+ proper : test-build
6525+ $(verbose ) $(call erlang,$(call proper_check.erl,module,$(t ) ) )
6526+ else
6527+ proper : test-build
6528+ $(verbose ) echo Testing $(t ) /0
6529+ $(verbose ) $(call erlang,$(call proper_check.erl,function,$(t ) () ) )
6530+ endif
6531+ else
6532+ proper : test-build
6533+ $(eval MODULES := $(patsubst % ,'% ',$(sort $(notdir $(basename $(wildcard ebin/* .beam) ) ) ) ) )
6534+ $(gen_verbose ) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES ) ) )
6535+ endif
6536+ endif
6537+
64366538# Copyright (c) 2013-2016, Loïc Hoguin <[email protected] >64376539# This file is part of erlang.mk and subject to the terms of the ISC License.
64386540
@@ -6443,7 +6545,7 @@ endif
64436545RELX ?= $(ERLANG_MK_TMP ) /relx
64446546RELX_CONFIG ?= $(CURDIR ) /relx.config
64456547
6446- RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19 .0/relx
6548+ RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23 .0/relx
64476549RELX_OPTS ?=
64486550RELX_OUTPUT_DIR ?= _rel
64496551RELX_REL_EXT ?=
@@ -6489,7 +6591,7 @@ distclean-relx-rel:
64896591# Run target.
64906592
64916593ifeq ($(wildcard $(RELX_CONFIG ) ) ,)
6492- run :
6594+ run ::
64936595else
64946596
64956597define get_relx_release.erl
@@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2)
65136615RELX_REL_EXT := .cmd
65146616endif
65156617
6516- run : all
6618+ run :: all
65176619 $(verbose ) $(RELX_OUTPUT_DIR ) /$(RELX_REL_NAME ) /bin/$(RELX_REL_NAME )$(RELX_REL_EXT ) console
65186620
65196621help ::
@@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq)
65796681tests :: triq
65806682
65816683define triq_check.erl
6582- code:add_pathsa(["$(call core_native_path,$(CURDIR ) /ebin) ", "$(call core_native_path,$(DEPS_DIR ) /* /ebin) "]),
6684+ code:add_pathsa([
6685+ "$(call core_native_path,$(CURDIR ) /ebin) ",
6686+ "$(call core_native_path,$(DEPS_DIR ) /* /ebin) ",
6687+ "$(call core_native_path,$(TEST_DIR ) ) "]),
65836688 try
65846689 case $(1 ) of
65856690 all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3 ) ) ]]);
@@ -6590,7 +6695,7 @@ define triq_check.erl
65906695 true -> halt(0);
65916696 _ -> halt(1)
65926697 catch error:undef ->
6593- io:format("Undefined property or module~n" ),
6698+ io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()] ),
65946699 halt(0)
65956700 end.
65966701endef
@@ -6606,7 +6711,8 @@ triq: test-build
66066711endif
66076712else
66086713triq : test-build
6609- $(eval MODULES := $(patsubst % ,'% ',$(sort $(notdir $(basename $(wildcard ebin/* .beam) ) ) ) ) )
6714+ $(eval MODULES := $(patsubst % ,'% ',$(sort $(notdir $(basename \
6715+ $(wildcard ebin/* .beam) $(call core_find,$(TEST_DIR ) /,* .beam) )))))
66106716 $(gen_verbose ) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES ) ) )
66116717endif
66126718endif
0 commit comments