Просмотр исходного кода

Merge branch 'clean_erlang_mk_tmp' of https://github.com/ingwinlu/erlang.mk

Loïc Hoguin 9 лет назад
Родитель
Сommit
79d3bb3ef7
2 измененных файлов с 24 добавлено и 5 удалено
  1. 4 1
      core/core.mk
  2. 20 4
      test/Makefile

+ 4 - 1
core/core.mk

@@ -92,7 +92,10 @@ ifneq ($(wildcard erl_crash.dump),)
 	$(gen_verbose) rm -f erl_crash.dump
 endif
 
-distclean:: clean
+distclean:: clean distclean-tmp
+
+distclean-tmp:
+	$(gen_verbose) rm -rf $(ERLANG_MK_TMP)
 
 help::
 	$(verbose) printf "%s\n" \

+ 20 - 4
test/Makefile

@@ -88,12 +88,12 @@ $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst plugin_%,%,$(wildcard plugin_*.m
 
 # Tests that don't easily fit into other categories.
 
-core:: core-clean-crash-dump core-help
-clean-core:: clean-core-clean-crash-dump clean-core-help
+core:: core-clean-crash-dump core-distclean-tmp core-help
+clean-core:: clean-core-clean-crash-dump clean-core-distclean-tmp clean-core-help
 
-.PHONY: core-clean-crash-dump core-help clean-core-clean-crash-dump clean-core-help
+.PHONY: core-clean-crash-dump core-distclean-tmp core-help clean-core-clean-crash-dump clean-core-distclean-tmp clean-core-help
 
-clean-core-clean-crash-dump clean-core-help:
+clean-core-clean-crash-dump clean-core-distclean-tmp clean-core-help:
 	$t rm -rf $(APP_TO_CLEAN)/
 
 core-clean-crash-dump: build clean-core-clean-crash-dump
@@ -112,6 +112,22 @@ core-clean-crash-dump: build clean-core-clean-crash-dump
 	$i "Check that the crash dump is removed"
 	$t test ! -e $(APP)/erl_crash.dump
 
+core-distclean-tmp: build clean-core-distclean-tmp
+
+	$i "Bootstrap a new OTP application named $(APP)"
+	$t mkdir $(APP)/
+	$t cp ../erlang.mk $(APP)/
+	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap all $v
+
+	$i "Check that a .erlang.mk directory exists"
+	$t test -d $(APP)/.erlang.mk
+
+	$i "Distclean the application"
+	$t $(MAKE) -C $(APP) distclean $v
+
+	$i "Check if .erlang.mk directory got removed"
+	$t test ! -e $(APP)/.erlang.mk
+
 core-help: build clean-core-help
 
 	$i "Bootstrap a new OTP library named $(APP)"