|
17 | 17 | ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) |
18 | 18 | export ERLANG_MK_FILENAME |
19 | 19 |
|
20 | | -ERLANG_MK_VERSION = 16d60fa |
| 20 | +ERLANG_MK_VERSION = d3485e7 |
21 | 21 | ERLANG_MK_WITHOUT = |
22 | 22 |
|
23 | 23 | # Make 3.81 and 3.82 are deprecated. |
@@ -184,8 +184,9 @@ core_http_get = curl -Lf$(if $(filter-out 0,$(V)),,s)o $(call core_native_path,$ |
184 | 184 |
|
185 | 185 | core_eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) |
186 | 186 |
|
187 | | -# We skip files that contain spaces or '#' because they end up causing issues. |
188 | | -core_find = $(if $(wildcard $1),$(shell find $(1:%/=%) \( -type l -o -type f \) -name $(subst *,\*,$2) -not -name "*[ \#]*")) |
| 187 | +# We skip files that contain spaces because they end up causing issues. |
| 188 | +# Files that begin with a dot are already ignored by the wildcard function. |
| 189 | +core_find = $(foreach f,$(wildcard $(1:%/=%)/*),$(if $(wildcard $f/.),$(call core_find,$f,$2),$(if $(filter $(subst *,%,$2),$f),$(if $(wildcard $f),$f)))) |
189 | 190 |
|
190 | 191 | core_lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(1))))))))))))))))))))))))))) |
191 | 192 |
|
@@ -800,7 +801,7 @@ pkg_cuttlefish_description = cuttlefish configuration abstraction |
800 | 801 | pkg_cuttlefish_homepage = https://github.com/Kyorai/cuttlefish |
801 | 802 | pkg_cuttlefish_fetch = git |
802 | 803 | pkg_cuttlefish_repo = https://github.com/Kyorai/cuttlefish |
803 | | -pkg_cuttlefish_commit = master |
| 804 | +pkg_cuttlefish_commit = main |
804 | 805 |
|
805 | 806 | PACKAGES += damocles |
806 | 807 | pkg_damocles_name = damocles |
@@ -3564,8 +3565,10 @@ export DEPS_DIR |
3564 | 3565 | REBAR_DEPS_DIR = $(DEPS_DIR) |
3565 | 3566 | export REBAR_DEPS_DIR |
3566 | 3567 |
|
| 3568 | +# When testing Erlang.mk and updating these, make sure |
| 3569 | +# to delete test/test_rebar_git before running tests again. |
3567 | 3570 | REBAR3_GIT ?= https://github.com/erlang/rebar3 |
3568 | | -REBAR3_COMMIT ?= 06aaecd51b0ce828b66bb65a74d3c1fd7833a4ba # 3.22.1 + OTP-27 fixes |
| 3571 | +REBAR3_COMMIT ?= bde4b54248d16280b2c70a244aca3bb7566e2033 # 3.23.0 |
3569 | 3572 |
|
3570 | 3573 | CACHE_DEPS ?= 0 |
3571 | 3574 |
|
@@ -4439,6 +4442,49 @@ ERLANG_MK_QUERY_REL_DEPS_FILE = $(ERLANG_MK_TMP)/query-rel-deps.log |
4439 | 4442 | ERLANG_MK_QUERY_TEST_DEPS_FILE = $(ERLANG_MK_TMP)/query-test-deps.log |
4440 | 4443 | ERLANG_MK_QUERY_SHELL_DEPS_FILE = $(ERLANG_MK_TMP)/query-shell-deps.log |
4441 | 4444 |
|
| 4445 | +# Copyright (c) 2024, Loïc Hoguin <[email protected]> |
| 4446 | +# This file is part of erlang.mk and subject to the terms of the ISC License. |
| 4447 | + |
| 4448 | +.PHONY: beam-cache-restore-app beam-cache-restore-test clean-beam-cache distclean-beam-cache |
| 4449 | + |
| 4450 | +BEAM_CACHE_DIR ?= $(ERLANG_MK_TMP)/beam-cache |
| 4451 | +PROJECT_BEAM_CACHE_DIR = $(BEAM_CACHE_DIR)/$(PROJECT) |
| 4452 | + |
| 4453 | +clean:: clean-beam-cache |
| 4454 | + |
| 4455 | +clean-beam-cache: |
| 4456 | + $(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR) |
| 4457 | + |
| 4458 | +distclean:: distclean-beam-cache |
| 4459 | + |
| 4460 | +$(PROJECT_BEAM_CACHE_DIR): |
| 4461 | + $(verbose) mkdir -p $(PROJECT_BEAM_CACHE_DIR) |
| 4462 | + |
| 4463 | +distclean-beam-cache: |
| 4464 | + $(gen_verbose) rm -rf $(BEAM_CACHE_DIR) |
| 4465 | + |
| 4466 | +beam-cache-restore-app: | $(PROJECT_BEAM_CACHE_DIR) |
| 4467 | + $(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR)/ebin-test |
| 4468 | +ifneq ($(wildcard ebin/),) |
| 4469 | + $(verbose) mv ebin/ $(PROJECT_BEAM_CACHE_DIR)/ebin-test |
| 4470 | +endif |
| 4471 | +ifneq ($(wildcard $(PROJECT_BEAM_CACHE_DIR)/ebin-app),) |
| 4472 | + $(gen_verbose) mv $(PROJECT_BEAM_CACHE_DIR)/ebin-app ebin/ |
| 4473 | +else |
| 4474 | + $(verbose) $(MAKE) --no-print-directory clean-app |
| 4475 | +endif |
| 4476 | + |
| 4477 | +beam-cache-restore-test: | $(PROJECT_BEAM_CACHE_DIR) |
| 4478 | + $(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR)/ebin-app |
| 4479 | +ifneq ($(wildcard ebin/),) |
| 4480 | + $(verbose) mv ebin/ $(PROJECT_BEAM_CACHE_DIR)/ebin-app |
| 4481 | +endif |
| 4482 | +ifneq ($(wildcard $(PROJECT_BEAM_CACHE_DIR)/ebin-test),) |
| 4483 | + $(gen_verbose) mv $(PROJECT_BEAM_CACHE_DIR)/ebin-test ebin/ |
| 4484 | +else |
| 4485 | + $(verbose) $(MAKE) --no-print-directory clean-app |
| 4486 | +endif |
| 4487 | + |
4442 | 4488 | # Copyright (c) 2013-2016, Loïc Hoguin <[email protected]> |
4443 | 4489 | # This file is part of erlang.mk and subject to the terms of the ISC License. |
4444 | 4490 |
|
@@ -4494,7 +4540,7 @@ ifneq ($(wildcard src/),) |
4494 | 4540 |
|
4495 | 4541 | # Targets. |
4496 | 4542 |
|
4497 | | -app:: $(if $(wildcard ebin/test),clean) deps |
| 4543 | +app:: $(if $(wildcard ebin/test),beam-cache-restore-app) deps |
4498 | 4544 | $(verbose) $(MAKE) --no-print-directory $(PROJECT).d |
4499 | 4545 | $(verbose) $(MAKE) --no-print-directory app-build |
4500 | 4546 |
|
@@ -4881,14 +4927,17 @@ define compile_test_erl |
4881 | 4927 | endef |
4882 | 4928 |
|
4883 | 4929 | ERL_TEST_FILES = $(call core_find,$(TEST_DIR)/,*.erl) |
| 4930 | + |
4884 | 4931 | $(ERLANG_MK_TMP)/$(PROJECT).last-testdir-build: $(ERL_TEST_FILES) $(MAKEFILE_LIST) |
4885 | | - $(eval FILES_TO_COMPILE := $(if $(filter $(MAKEFILE_LIST),$?),$(filter $(ERL_TEST_FILES),$^),$?)) |
| 4932 | +# When we have to recompile files in src/ the .d file always gets rebuilt. |
| 4933 | +# Therefore we want to ignore it when rebuilding test files. |
| 4934 | + $(eval FILES_TO_COMPILE := $(if $(filter $(filter-out $(PROJECT).d,$(MAKEFILE_LIST)),$?),$(filter $(ERL_TEST_FILES),$^),$(filter $(ERL_TEST_FILES),$?))) |
4886 | 4935 | $(if $(strip $(FILES_TO_COMPILE)),$(call compile_test_erl,$(FILES_TO_COMPILE)) && touch $@) |
4887 | 4936 | endif |
4888 | 4937 |
|
4889 | 4938 | test-build:: IS_TEST=1 |
4890 | 4939 | test-build:: ERLC_OPTS=$(TEST_ERLC_OPTS) |
4891 | | -test-build:: $(if $(wildcard src),$(if $(wildcard ebin/test),,clean)) $(if $(IS_APP),,deps test-deps) |
| 4940 | +test-build:: $(if $(wildcard src),$(if $(wildcard ebin/test),,beam-cache-restore-test)) $(if $(IS_APP),,deps test-deps) |
4892 | 4941 | # We already compiled everything when IS_APP=1. |
4893 | 4942 | ifndef IS_APP |
4894 | 4943 | ifneq ($(wildcard src),) |
@@ -5492,7 +5541,7 @@ endif |
5492 | 5541 | $(verbose) mkdir config/ |
5493 | 5542 | $(verbose) $(call core_render,bs_sys_config,config/sys.config) |
5494 | 5543 | $(verbose) $(call core_render,bs_vm_args,config/vm.args) |
5495 | | - $(verbose) awk '/^include erlang.mk/ && !ins {print "BUILD_DEPS += relx";ins=1};{print}' Makefile > Makefile.bak |
| 5544 | + $(verbose) awk '/^include erlang.mk/ && !ins {print "REL_DEPS += relx";ins=1};{print}' Makefile > Makefile.bak |
5496 | 5545 | $(verbose) mv Makefile.bak Makefile |
5497 | 5546 |
|
5498 | 5547 | new-app: |
|
0 commit comments