Browse Source

Prevent kerl from being deleted uncorrectly

Loïc Hoguin 6 years ago
parent
commit
c3306b9b60
1 changed files with 6 additions and 2 deletions
  1. 6 2
      core/kerl.mk

+ 6 - 2
core/kerl.mk

@@ -9,6 +9,8 @@ ifeq ($(strip $(KERL)),)
 KERL := $(ERLANG_MK_TMP)/kerl/kerl
 KERL := $(ERLANG_MK_TMP)/kerl/kerl
 endif
 endif
 
 
+KERL_DIR = $(ERLANG_MK_TMP)/kerl
+
 export KERL
 export KERL
 
 
 KERL_GIT ?= https://github.com/kerl/kerl
 KERL_GIT ?= https://github.com/kerl/kerl
@@ -35,7 +37,9 @@ $(KERL_INSTALL_DIR)/$1-native: $(KERL)
 endif
 endif
 endef
 endef
 
 
-$(KERL):
+$(KERL): $(KERL_DIR)
+
+$(KERL_DIR):
 	$(verbose) mkdir -p $(ERLANG_MK_TMP)
 	$(verbose) mkdir -p $(ERLANG_MK_TMP)
 	$(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl
 	$(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl
 	$(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT)
 	$(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT)
@@ -44,7 +48,7 @@ $(KERL):
 distclean:: distclean-kerl
 distclean:: distclean-kerl
 
 
 distclean-kerl:
 distclean-kerl:
-	$(gen_verbose) rm -rf $(KERL)
+	$(gen_verbose) rm -rf $(KERL_DIR)
 
 
 # Allow users to select which version of Erlang/OTP to use for a project.
 # Allow users to select which version of Erlang/OTP to use for a project.