Skip to content

Commit 4805794

Browse files
committed
Update erlang.mk
1 parent e9402a4 commit 4805794

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

erlang.mk

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
1818
export ERLANG_MK_FILENAME
1919

20-
ERLANG_MK_VERSION = 2.0.0-pre.2-486-g2b7e434
20+
ERLANG_MK_VERSION = 2.0.0-pre.2-493-g40c2b81
2121
ERLANG_MK_WITHOUT =
2222

2323
# Make 3.81 and 3.82 are deprecated.
@@ -276,7 +276,9 @@ distclean-kerl:
276276
# Allow users to select which version of Erlang/OTP to use for a project.
277277

278278
ifneq ($(strip $(LATEST_ERLANG_OTP)),)
279-
ERLANG_OTP := $(notdir $(lastword $(sort $(filter-out $(KERL_INSTALL_DIR)/OTP_R%,\
279+
# In some environments it is necessary to filter out master.
280+
ERLANG_OTP := $(notdir $(lastword $(sort\
281+
$(filter-out $(KERL_INSTALL_DIR)/master $(KERL_INSTALL_DIR)/OTP_R%,\
280282
$(filter-out %-rc1 %-rc2 %-rc3,$(wildcard $(KERL_INSTALL_DIR)/*[^-native]))))))
281283
endif
282284

@@ -5357,7 +5359,9 @@ endef
53575359
ebin/$(PROJECT).app:: $(ERL_FILES) $(CORE_FILES) $(wildcard src/$(PROJECT).app.src)
53585360
$(eval FILES_TO_COMPILE := $(filter-out src/$(PROJECT).app.src,$?))
53595361
$(if $(strip $(FILES_TO_COMPILE)),$(call compile_erl,$(FILES_TO_COMPILE)))
5360-
$(eval GITDESCRIBE := $(shell git describe --dirty --abbrev=7 --tags --always --first-parent 2>/dev/null || true))
5362+
# Older git versions do not have the --first-parent flag. Do without in that case.
5363+
$(eval GITDESCRIBE := $(shell git describe --dirty --abbrev=7 --tags --always --first-parent 2>/dev/null \
5364+
|| git describe --dirty --abbrev=7 --tags --always 2>/dev/null || true))
53615365
$(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \
53625366
$(filter-out $(ERLC_EXCLUDE_PATHS),$(ERL_FILES) $(CORE_FILES) $(BEAM_FILES)))))))
53635367
ifeq ($(wildcard src/$(PROJECT).app.src),)
@@ -7549,7 +7553,7 @@ ifneq ($(filter shell,$(DEP_TYPES)),)
75497553
$(ERLANG_MK_RECURSIVE_DEPS_LIST): $(ALL_SHELL_DEPS_DIRS)
75507554
endif
75517555

7552-
ERLANG_MK_RECURSIVE_TMP_LIST := $(abspath $(ERLANG_MK_TMP)/recursive-tmp-deps.log)
7556+
ERLANG_MK_RECURSIVE_TMP_LIST := $(abspath $(ERLANG_MK_TMP)/recursive-tmp-deps-$(shell echo $$PPID).log)
75537557

75547558
$(ERLANG_MK_RECURSIVE_DEPS_LIST) \
75557559
$(ERLANG_MK_RECURSIVE_DOC_DEPS_LIST) \
@@ -7558,13 +7562,6 @@ $(ERLANG_MK_RECURSIVE_TEST_DEPS_LIST) \
75587562
$(ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST): | $(ERLANG_MK_TMP)
75597563
ifeq ($(IS_APP)$(IS_DEP),)
75607564
$(verbose) rm -f $(ERLANG_MK_RECURSIVE_TMP_LIST)
7561-
endif
7562-
ifndef IS_APP
7563-
$(verbose) set -e; for dep in $(ALL_APPS_DIRS) ; do \
7564-
$(MAKE) -C $$dep $@ \
7565-
IS_APP=1 \
7566-
ERLANG_MK_RECURSIVE_TMP_LIST=$(ERLANG_MK_RECURSIVE_TMP_LIST); \
7567-
done
75687565
endif
75697566
$(verbose) set -e; for dep in $^ ; do \
75707567
if ! grep -qs ^$$dep$$ $(ERLANG_MK_RECURSIVE_TMP_LIST); then \
@@ -7578,7 +7575,11 @@ endif
75787575
fi \
75797576
done
75807577
ifeq ($(IS_APP)$(IS_DEP),)
7581-
$(verbose) sort < $(ERLANG_MK_RECURSIVE_TMP_LIST) | uniq > $@
7578+
$(verbose) sort < $(ERLANG_MK_RECURSIVE_TMP_LIST) | \
7579+
uniq > $(ERLANG_MK_RECURSIVE_TMP_LIST).sorted
7580+
$(verbose) cmp -s $(ERLANG_MK_RECURSIVE_TMP_LIST).sorted $@ \
7581+
|| mv $(ERLANG_MK_RECURSIVE_TMP_LIST).sorted $@
7582+
$(verbose) rm -f $(ERLANG_MK_RECURSIVE_TMP_LIST).sorted
75827583
$(verbose) rm $(ERLANG_MK_RECURSIVE_TMP_LIST)
75837584
endif
75847585
endif # ifneq ($(SKIP_DEPS),)

0 commit comments

Comments
 (0)