Browse Source

Delete $(ERLANG_MK_TMP) directory after 'make erlang-mk'

This allows refreshing tools at the same time Erlang.mk
gets updated.
Loïc Hoguin 6 years ago
parent
commit
671052aaa9
2 changed files with 20 additions and 0 deletions
  1. 1 0
      core/core.mk
  2. 19 0
      test/core_upgrade.mk

+ 1 - 0
core/core.mk

@@ -209,6 +209,7 @@ endif
 	$(gen_verbose) $(MAKE) --no-print-directory -C $(ERLANG_MK_BUILD_DIR) WITHOUT='$(strip $(WITHOUT))' UPGRADE=1
 	$(verbose) cp $(ERLANG_MK_BUILD_DIR)/erlang.mk ./erlang.mk
 	$(verbose) rm -rf $(ERLANG_MK_BUILD_DIR)
+	$(verbose) rm -rf $(ERLANG_MK_TMP)
 
 # The erlang.mk package index is bundled in the default erlang.mk build.
 # Search for the string "copyright" to skip to the rest of the code.

+ 19 - 0
test/core_upgrade.mk

@@ -127,6 +127,25 @@ core-upgrade-custom-repo: build clean
 	$i "Check our modification is there"
 	$t grep -q "# Copyright (c) erlang.mk Testsuite!" $(APP)/erlang.mk
 
+core-upgrade-delete-tmp-dir: build clean
+
+	$i "Bootstrap a new OTP library named $(APP)"
+	$t mkdir $(APP)/
+	$t cp ../erlang.mk $(APP)/
+	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+	$i "Build the application"
+	$t $(MAKE) -C $(APP) $v
+
+	$i "Check that the .erlang.mk directory exists"
+	$t test -e $(APP)/.erlang.mk/
+
+	$i "Upgrade Erlang.mk"
+	$t $(MAKE) -C $(APP) erlang-mk $v
+
+	$i "Check that the .erlang.mk directory was removed"
+	$t ! test -e $(APP)/.erlang.mk/
+
 core-upgrade-no-config: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"