From 7d46f9b9a709d353f7a0cc5c3847fa3b91bef16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 3 Oct 2016 22:58:45 +0200 Subject: Update Erlang.mk Includes some small maintenance tweaks to Makefile etc. --- Makefile | 3 +- circle.yml | 18 ------------ ebin/cowlib.app | 1 - erlang.mk | 90 ++++++++++++++++++++++++++++++++++++++++++--------------- 4 files changed, 69 insertions(+), 43 deletions(-) delete mode 100644 circle.yml diff --git a/Makefile b/Makefile index 25a56ac..45d4970 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ PROJECT_VERSION = 1.3.0 #ERLC_OPTS += +bin_opt_info OTP_DEPS = crypto DIALYZER_OPTS = -Werror_handling -Wunmatched_returns -CI_OTP = OTP-18.0.3 + +CI_OTP ?= OTP-19.1.1 OTP-19.0.7 OTP-18.3.4.4 OTP-18.2.4.1 OTP-18.1.5 OTP-18.0.3 TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' +'{parse_transform, horse_autoexport}' TEST_DEPS = horse triq diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 7775bcf..0000000 --- a/circle.yml +++ /dev/null @@ -1,18 +0,0 @@ -dependencies: - cache_directories: - - "~/.kerl" - - "~/erlang" - - pre: - - sudo apt-get update - - sudo apt-get install autoconf2.59 - - cd $HOME/bin && ln -s /usr/bin/autoconf2.59 autoconf - - cd $HOME/bin && ln -s /usr/bin/autoheader2.59 autoheader - - make ci-prepare: - timeout: 3600 - -test: - override: - - source $HOME/erlang/OTP-18.0.3/activate && make dialyze - - make -k ci: - timeout: 3600 diff --git a/ebin/cowlib.app b/ebin/cowlib.app index 83ff3cc..3eb4d45 100644 --- a/ebin/cowlib.app +++ b/ebin/cowlib.app @@ -1,7 +1,6 @@ {application, cowlib, [ {description, "Support library for manipulating Web protocols."}, {vsn, "1.3.0"}, - {id, "1.3.0-18-g41949dd-dirty"}, {modules, ['cow_cookie','cow_date','cow_hpack','cow_http','cow_http2','cow_http_hd','cow_http_te','cow_mimetypes','cow_multipart','cow_qs','cow_spdy','cow_uri','cow_ws']}, {registered, []}, {applications, [kernel,stdlib,crypto]} diff --git a/erlang.mk b/erlang.mk index bfa298c..c957e62 100644 --- a/erlang.mk +++ b/erlang.mk @@ -12,11 +12,11 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.PHONY: all app deps search rel docs install-docs check tests clean distclean help erlang-mk +.PHONY: all app apps deps search rel docs install-docs check tests clean distclean help erlang-mk ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) -ERLANG_MK_VERSION = 2.0.0-pre.2-120-ge6868d1 +ERLANG_MK_VERSION = 2.0.0-pre.2-140-gc313f4d # Core configuration. @@ -24,6 +24,7 @@ PROJECT ?= $(notdir $(CURDIR)) PROJECT := $(strip $(PROJECT)) PROJECT_VERSION ?= rolling +PROJECT_MOD ?= $(PROJECT)_app # Verbosity. @@ -515,6 +516,14 @@ pkg_chronos_fetch = git pkg_chronos_repo = https://github.com/lehoff/chronos pkg_chronos_commit = master +PACKAGES += chumak +pkg_chumak_name = chumak +pkg_chumak_description = Pure Erlang implementation of ZeroMQ Message Transport Protocol. +pkg_chumak_homepage = http://choven.ca +pkg_chumak_fetch = git +pkg_chumak_repo = https://github.com/chovencorp/chumak +pkg_chumak_commit = master + PACKAGES += classifier pkg_classifier_name = classifier pkg_classifier_description = An Erlang Bayesian Filter and Text Classifier @@ -1675,6 +1684,14 @@ pkg_feeder_fetch = git pkg_feeder_repo = https://github.com/michaelnisi/feeder pkg_feeder_commit = master +PACKAGES += find_crate +pkg_find_crate_name = find_crate +pkg_find_crate_description = Find Rust libs and exes in Erlang application priv directory +pkg_find_crate_homepage = https://github.com/goertzenator/find_crate +pkg_find_crate_fetch = git +pkg_find_crate_repo = https://github.com/goertzenator/find_crate +pkg_find_crate_commit = master + PACKAGES += fix pkg_fix_name = fix pkg_fix_description = http://fixprotocol.org/ implementation. @@ -3323,6 +3340,14 @@ pkg_rlimit_fetch = git pkg_rlimit_repo = https://github.com/jlouis/rlimit pkg_rlimit_commit = master +PACKAGES += rust_mk +pkg_rust_mk_name = rust_mk +pkg_rust_mk_description = Build Rust crates in an Erlang application +pkg_rust_mk_homepage = https://github.com/goertzenator/rust.mk +pkg_rust_mk_fetch = git +pkg_rust_mk_repo = https://github.com/goertzenator/rust.mk +pkg_rust_mk_commit = master + PACKAGES += safetyvalve pkg_safetyvalve_name = safetyvalve pkg_safetyvalve_description = A safety valve for your erlang node @@ -4112,19 +4137,35 @@ dep_verbose = $(dep_verbose_$(V)) # Core targets. -ifneq ($(SKIP_DEPS),) -deps:: +ifdef IS_APP +apps:: else -deps:: $(ALL_DEPS_DIRS) -ifndef IS_APP - for dep in $(ALL_APPS_DIRS) ; do \ - mkdir -p $$dep/ebin; \ +apps:: $(ALL_APPS_DIRS) +ifeq ($(IS_APP)$(IS_DEP),) + $(verbose) rm -f $(ERLANG_MK_TMP)/apps.log +endif + $(verbose) mkdir -p $(ERLANG_MK_TMP) +# Create ebin directory for all apps to make sure Erlang recognizes them +# as proper OTP applications when using -include_lib. This is a temporary +# fix, a proper fix would be to compile apps/* in the right order. + $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ + mkdir -p $$dep/ebin || exit $$?; \ done $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ - $(MAKE) -C $$dep IS_APP=1 || exit $$?; \ + if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/apps.log; then \ + :; \ + else \ + echo $$dep >> $(ERLANG_MK_TMP)/apps.log; \ + $(MAKE) -C $$dep IS_APP=1 || exit $$?; \ + fi \ done endif -ifneq ($(IS_DEP),1) + +ifneq ($(SKIP_DEPS),) +deps:: +else +deps:: $(ALL_DEPS_DIRS) apps +ifeq ($(IS_APP)$(IS_DEP),) $(verbose) rm -f $(ERLANG_MK_TMP)/deps.log endif $(verbose) mkdir -p $(ERLANG_MK_TMP) @@ -4813,7 +4854,7 @@ app:: clean deps $(PROJECT).d $(verbose) $(MAKE) --no-print-directory app-build endif -ifeq ($(wildcard src/$(PROJECT)_app.erl),) +ifeq ($(wildcard src/$(PROJECT_MOD).erl),) define app_file {application, $(PROJECT), [ {description, "$(PROJECT_DESCRIPTION)"}, @@ -4833,7 +4874,7 @@ define app_file {modules, [$(call comma_list,$(2))]}, {registered, [$(call comma_list,$(PROJECT)_sup $(PROJECT_REGISTERED))]}, {applications, [$(call comma_list,kernel stdlib $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS))]}, - {mod, {$(PROJECT)_app, []}} + {mod, {$(PROJECT_MOD), []}} ]}. endef endif @@ -6066,14 +6107,17 @@ help:: # Plugin-specific targets. define filter_opts.erl - Opts = binary:split(<<"$1">>, <<"-">>, [global]), - Filtered = lists:reverse(lists:foldl(fun - (O = <<"pa ", _/bits>>, Acc) -> [O|Acc]; - (O = <<"D ", _/bits>>, Acc) -> [O|Acc]; - (O = <<"I ", _/bits>>, Acc) -> [O|Acc]; - (_, Acc) -> Acc - end, [], Opts)), - io:format("~s~n", [[["-", O] || O <- Filtered]]), + Opts = init:get_plain_arguments(), + {Filtered, _} = lists:foldl(fun + (O, {Os, true}) -> {[O|Os], false}; + (O = "-D", {Os, _}) -> {[O|Os], true}; + (O = [\\$$-, \\$$D, _ | _], {Os, _}) -> {[O|Os], false}; + (O = "-I", {Os, _}) -> {[O|Os], true}; + (O = [\\$$-, \\$$I, _ | _], {Os, _}) -> {[O|Os], false}; + (O = "-pa", {Os, _}) -> {[O|Os], true}; + (_, Acc) -> Acc + end, {[], false}, Opts), + io:format("~s~n", [string:join(lists:reverse(Filtered), " ")]), halt(). endef @@ -6090,7 +6134,7 @@ dialyze: else dialyze: $(DIALYZER_PLT) endif - $(verbose) dialyzer --no_native `$(call erlang,$(call filter_opts.erl,$(ERLC_OPTS)))` $(DIALYZER_DIRS) $(DIALYZER_OPTS) + $(verbose) dialyzer --no_native `$(ERL) -eval "$(subst $(newline),,$(subst ",\",$(call filter_opts.erl)))" -extra $(ERLC_OPTS)` $(DIALYZER_DIRS) $(DIALYZER_OPTS) # Copyright (c) 2013-2015, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6405,9 +6449,9 @@ endif # Configuration. ifeq ($(XREF_CONFIG),) - XREF_ARGS := + XREFR_ARGS := else - XREF_ARGS := -c $(XREF_CONFIG) + XREFR_ARGS := -c $(XREF_CONFIG) endif XREFR ?= $(CURDIR)/xrefr -- cgit v1.2.3