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

Simplify cleaning in the test suite

Not only simpler but also faster, especially on Windows.
Loïc Hoguin 9 лет назад
Родитель
Сommit
51e1c5bc12

+ 9 - 16
test/Makefile

@@ -12,8 +12,7 @@ endif
 
 # Temporary application name, taken from rule name.
 
-APP = $(subst -,_,$@)
-APP_TO_CLEAN = $(subst -,_,$(patsubst clean-%,%,$@))
+APP = test_$(subst -,_,$@)
 
 # Erlang, quickly!
 
@@ -93,8 +92,8 @@ endif
 
 all:: core
 
-clean:: clean-core
-	$t rm -rf erl_crash.dump packages/
+clean::
+	$t rm -rf erl_crash.dump packages/ test_*/
 
 build:
 	$i "Generate a bleeding edge Erlang.mk"
@@ -102,11 +101,10 @@ build:
 
 # Core.
 
-.PHONY: core clean-core
+.PHONY: core
 
 define include_core
 core:: core-$1
-clean-core:: clean-core-$1
 
 include core_$1.mk
 
@@ -118,7 +116,6 @@ $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst core_%,%,$(wildcard core_*.mk)))
 
 define include_plugin
 all:: $1
-clean:: clean-$1
 
 include plugin_$1.mk
 
@@ -129,14 +126,10 @@ $(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-distclean-tmp core-help
-clean-core:: clean-core-clean-crash-dump clean-core-distclean-tmp 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
+.PHONY: core-clean-crash-dump core-distclean-tmp 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
+core-clean-crash-dump: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -152,7 +145,7 @@ 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
+core-distclean-tmp: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -168,7 +161,7 @@ core-distclean-tmp: build clean-core-distclean-tmp
 	$i "Check that .erlang.mk directory got removed"
 	$t test ! -e $(APP)/.erlang.mk
 
-core-help: build clean-core-help
+core-help: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -188,7 +181,7 @@ packages: $(addprefix pkg-,$(PACKAGES))
 define pkg_target
 .PHONY: pkg-$1
 
-pkg-$1: clean build
+pkg-$1: build clean
 
 # Make sure $@ is defined inside the define.
 	$(eval @ = pkg-$1)

+ 23 - 29
test/core_app.mk

@@ -2,19 +2,13 @@
 
 CORE_APP_CASES = appsrc-change asn1 auto-git-id erlc-exclude erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive makefile-change mib no-app no-makedep pt pt-erlc-opts xrl xrl-include yrl yrl-include
 CORE_APP_TARGETS = $(addprefix core-app-,$(CORE_APP_CASES))
-CORE_APP_CLEAN_TARGETS = $(addprefix clean-,$(CORE_APP_TARGETS))
 
-.PHONY: core-app $(CORE_APP_TARGETS) clean-core-app $(CORE_APP_CLEAN_TARGETS)
-
-clean-core-app: $(CORE_APP_CLEAN_TARGETS)
-
-$(CORE_APP_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: core-app $(CORE_APP_TARGETS)
 
 core-app: $(CORE_APP_TARGETS)
 
 ifdef LEGACY
-core-app-appsrc-change: build clean-core-app-appsrc-change
+core-app-appsrc-change: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -34,7 +28,7 @@ core-app-appsrc-change: build clean-core-app-appsrc-change
 	$t rm $(APP)/EXPECT
 endif
 
-core-app-asn1: build clean-core-app-asn1
+core-app-asn1: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -155,7 +149,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-auto-git-id: build clean-core-app-auto-git-id
+core-app-auto-git-id: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -203,7 +197,7 @@ endif
 		true = ID =/= [], \
 		halt()"
 
-core-app-erlc-exclude: build clean-core-app-erlc-exclude
+core-app-erlc-exclude: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -231,7 +225,7 @@ core-app-erlc-exclude: build clean-core-app-erlc-exclude
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-erlc-opts: build clean-core-app-erlc-opts
+core-app-erlc-opts: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -258,7 +252,7 @@ core-app-erlc-opts: build clean-core-app-erlc-opts
 		false = proplists:is_defined(debug_info, proplists:get_value(options, girl:module_info(compile))), \
 		halt()"
 
-core-app-erlc-opts-filter: build clean-core-app-erlc-opts-filter
+core-app-erlc-opts-filter: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -285,7 +279,7 @@ core-app-erlc-opts-filter: build clean-core-app-erlc-opts-filter
 		false = proplists:is_defined(debug_info, proplists:get_value(options, girl:module_info(compile))), \
 		halt()"
 
-core-app-error: build clean-core-app-error
+core-app-error: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -302,7 +296,7 @@ core-app-error: build clean-core-app-error
 	$i "Check that trying to build returns non-zero"
 	$t ! $(MAKE) -C $(APP) $v
 
-core-app-generate-erl: build clean-core-app-generate-erl
+core-app-generate-erl: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -408,7 +402,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-generate-erl-include: build clean-core-app-generate-erl-include
+core-app-generate-erl-include: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -470,7 +464,7 @@ core-app-generate-erl-include: build clean-core-app-generate-erl-include
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-generate-erl-prepend: build clean-core-app-generate-erl-prepend
+core-app-generate-erl-prepend: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -579,7 +573,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-hrl: build clean-core-app-hrl
+core-app-hrl: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -668,7 +662,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-hrl-recursive: build clean-core-app-hrl-recursive
+core-app-hrl-recursive: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -759,7 +753,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-makefile-change: build clean-core-app-makefile-change
+core-app-makefile-change: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -784,7 +778,7 @@ core-app-makefile-change: build clean-core-app-makefile-change
 	$t find $(APP) -type f -newer $(APP)/Makefile | sort | diff $(APP)/EXPECT -
 	$t rm $(APP)/EXPECT
 
-core-app-mib: build clean-core-app-mib
+core-app-mib: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -892,7 +886,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-no-app: build clean-core-app-no-app
+core-app-no-app: build clean
 
 	$i "Bootstrap a project without an OTP library"
 	$t mkdir $(APP)/
@@ -903,7 +897,7 @@ core-app-no-app: build clean-core-app-no-app
 	$i "Build the project"
 	$t $(MAKE) -C $(APP) $v
 
-core-app-no-makedep: build clean-core-app-no-makedep
+core-app-no-makedep: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1016,7 +1010,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-pt: build clean-core-app-pt
+core-app-pt: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1049,7 +1043,7 @@ core-app-pt: build clean-core-app-pt
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-pt-erlc-opts: build clean-core-app-pt-erlc-opts
+core-app-pt-erlc-opts: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1089,7 +1083,7 @@ core-app-pt-erlc-opts: build clean-core-app-pt-erlc-opts
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-xrl: build clean-core-app-xrl
+core-app-xrl: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1190,7 +1184,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-xrl-include: build clean-core-app-xrl-include
+core-app-xrl-include: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1334,7 +1328,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-yrl: build clean-core-app-yrl
+core-app-yrl: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1432,7 +1426,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-app-yrl-include: build clean-core-app-yrl-include
+core-app-yrl-include: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 7 - 13
test/core_compat.mk

@@ -4,20 +4,14 @@
 
 CORE_COMPAT_CASES = auto-rebar rebar rebar-deps rebar-deps-pkg rebar-erlc-opts rebar-pt
 CORE_COMPAT_TARGETS = $(addprefix core-compat-,$(CORE_COMPAT_CASES))
-CORE_COMPAT_CLEAN_TARGETS = $(addprefix clean-,$(CORE_COMPAT_TARGETS))
 
 REBAR_BINARY = https://github.com/rebar/rebar/releases/download/2.6.0/rebar
 
-.PHONY: core-compat $(CORE_COMPAT_TARGETS) clean-core-compat $(CORE_COMPAT_CLEAN_TARGETS)
-
-clean-core-compat: $(CORE_COMPAT_CLEAN_TARGETS)
-
-$(CORE_COMPAT_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: core-compat $(CORE_COMPAT_TARGETS)
 
 core-compat: $(CORE_COMPAT_TARGETS)
 
-core-compat-auto-rebar: build clean-core-compat-auto-rebar
+core-compat-auto-rebar: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -59,7 +53,7 @@ core-compat-auto-rebar: build clean-core-compat-auto-rebar
 	$i "Use rebar to build the application"
 	$t cd $(APP) && ./rebar compile $v
 
-core-compat-rebar: build clean-core-compat-rebar
+core-compat-rebar: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -98,7 +92,7 @@ core-compat-rebar: build clean-core-compat-rebar
 	$i "Use rebar to build the application"
 	$t cd $(APP) && ./rebar compile $v
 
-core-compat-rebar-deps: build clean-core-compat-rebar-deps
+core-compat-rebar-deps: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -130,7 +124,7 @@ core-compat-rebar-deps: build clean-core-compat-rebar-deps
 	$i "Use rebar to build the application"
 	$t cd $(APP) && ./rebar get-deps compile $v
 
-core-compat-rebar-deps-pkg: build clean-core-compat-rebar-deps-pkg
+core-compat-rebar-deps-pkg: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -162,7 +156,7 @@ core-compat-rebar-deps-pkg: build clean-core-compat-rebar-deps-pkg
 	$i "Use rebar to build the application"
 	$t cd $(APP) && ./rebar get-deps compile $v
 
-core-compat-rebar-erlc-opts: build clean-core-compat-rebar-erlc-opts
+core-compat-rebar-erlc-opts: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -211,7 +205,7 @@ core-compat-rebar-erlc-opts: build clean-core-compat-rebar-erlc-opts
 	$i "Use rebar to build the application"
 	$t cd $(APP) && ./rebar compile $v
 
-core-compat-rebar-pt: build clean-core-compat-rebar-pt
+core-compat-rebar-pt: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 42 - 54
test/core_deps.mk

@@ -2,24 +2,12 @@
 
 CORE_DEPS_CASES = apps apps-conflict apps-deep-conflict apps-dir apps-new-app apps-new-lib apps-new-tpl apps-only autopatch-rebar build-c-8cc build-c-imagejs build-erl build-js dep-commit dir doc fetch-cp fetch-custom fetch-fail-bad fetch-fail-unknown fetch-git fetch-git-submodule fetch-hex fetch-hg fetch-legacy fetch-svn ignore mv mv-rebar no-autopatch no-autopatch-erlang-mk no-autopatch-rebar order-first order-top otp pkg rel search shell skip test
 CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
-CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
 
-.PHONY: core-deps $(CORE_DEPS_TARGETS) clean-core-deps $(CORE_DEPS_CLEAN_TARGETS)
-
-clean-core-deps: $(CORE_DEPS_CLEAN_TARGETS) clean-core-deps-mv-moved clean-core-deps-mv-rebar-moved
-
-$(CORE_DEPS_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
-
-clean-core-deps-mv-moved:
-	$t rm -rf core_deps_mv-moved/
-
-clean-core-deps-mv-rebar-moved:
-	$t rm -rf core_deps_mv_rebar-moved/
+.PHONY: core-deps $(CORE_DEPS_TARGETS)
 
 core-deps: $(CORE_DEPS_TARGETS)
 
-core-deps-apps: build clean-core-deps-apps
+core-deps-apps: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -113,7 +101,7 @@ endif
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-deps-apps-conflict: build clean-core-deps-apps-conflict
+core-deps-apps-conflict: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -132,7 +120,7 @@ core-deps-apps-conflict: build clean-core-deps-apps-conflict
 	$i "Check that Cowlib wasn't fetched"
 	$t test ! -e $(APP)/deps/cowlib
 
-core-deps-apps-deep-conflict: build clean-core-deps-apps-deep-conflict
+core-deps-apps-deep-conflict: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -151,7 +139,7 @@ core-deps-apps-deep-conflict: build clean-core-deps-apps-deep-conflict
 	$i "Check that Cowlib wasn't fetched"
 	$t test ! -e $(APP)/deps/cowlib
 
-core-deps-apps-dir: build clean-core-deps-apps-dir
+core-deps-apps-dir: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -222,7 +210,7 @@ endif
 	$i "Check that all relevant files were removed"
 	$t test ! -e $(APP)/deps
 
-core-deps-apps-new-app: build clean-core-deps-apps-new-app
+core-deps-apps-new-app: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -267,7 +255,7 @@ endif
 		{module, my_server} = code:load_file(my_server), \
 		halt()"
 
-core-deps-apps-new-lib: build clean-core-deps-apps-new-lib
+core-deps-apps-new-lib: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -306,7 +294,7 @@ endif
 		{module, my_server} = code:load_file(my_server), \
 		halt()"
 
-core-deps-apps-new-tpl: build clean-core-deps-apps-new-tpl
+core-deps-apps-new-tpl: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -338,7 +326,7 @@ core-deps-apps-new-tpl: build clean-core-deps-apps-new-tpl
 		[{module, M} = code:load_file(M) || M <- Mods], \
 		halt()"
 
-core-deps-apps-only: build clean-core-deps-apps-only
+core-deps-apps-only: build clean
 
 	$i "Create a multi application repository with no root application"
 	$t mkdir $(APP)/
@@ -391,7 +379,7 @@ core-deps-apps-only: build clean-core-deps-apps-only
 	$i "Check that all relevant files were removed"
 	$t test ! -e $(APP)/deps
 
-core-deps-autopatch-rebar: build clean-core-deps-autopatch-rebar
+core-deps-autopatch-rebar: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -412,7 +400,7 @@ ifneq ($(PLATFORM),msys2)
 endif
 
 ifneq ($(PLATFORM),msys2)
-core-deps-build-c-8cc: build clean-core-deps-build-c-8cc
+core-deps-build-c-8cc: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -440,7 +428,7 @@ core-deps-build-c-8cc: build clean-core-deps-build-c-8cc
 endif
 
 ifneq ($(PLATFORM),freebsd)
-core-deps-build-c-imagejs: build clean-core-deps-build-c-imagejs
+core-deps-build-c-imagejs: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -468,7 +456,7 @@ core-deps-build-c-imagejs: build clean-core-deps-build-c-imagejs
 		halt()"
 endif
 
-core-deps-build-erl: build clean-core-deps-build-erl
+core-deps-build-erl: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -491,7 +479,7 @@ core-deps-build-erl: build clean-core-deps-build-erl
 		false = lists:member(cowlib, Deps), \
 		halt()"
 
-core-deps-build-js: build clean-core-deps-build-js
+core-deps-build-js: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -514,7 +502,7 @@ core-deps-build-js: build clean-core-deps-build-js
 		false = lists:member(jquery, Deps), \
 		halt()"
 
-core-deps-dep-commit: build clean-core-deps-dep-commit
+core-deps-dep-commit: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -545,7 +533,7 @@ endif
 		{ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
 		halt()"
 
-core-deps-dir: build clean-core-deps-dir
+core-deps-dir: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -575,7 +563,7 @@ endif
 		true = lists:member(cowboy, Deps), \
 		halt()"
 
-core-deps-doc: build clean-core-deps-doc
+core-deps-doc: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -612,7 +600,7 @@ core-deps-doc: build clean-core-deps-doc
 	$t test -f $(APP)/doc/boy.md
 	$t test -f $(APP)/doc/girl.md
 
-core-deps-fetch-cp: build clean-core-deps-fetch-cp
+core-deps-fetch-cp: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -645,7 +633,7 @@ endif
 		true = lists:member(my_dep, Deps), \
 		halt()"
 
-core-deps-fetch-custom: build clean-core-deps-fetch-custom
+core-deps-fetch-custom: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -673,7 +661,7 @@ endif
 		true = lists:member(boop, Deps), \
 		halt()"
 
-core-deps-fetch-fail-bad: build clean-core-deps-fetch-fail-bad
+core-deps-fetch-fail-bad: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -686,7 +674,7 @@ core-deps-fetch-fail-bad: build clean-core-deps-fetch-fail-bad
 	$i "Check that building the application fails"
 	$t ! $(MAKE) -C $(APP) $v
 
-core-deps-fetch-fail-unknown: build clean-core-deps-fetch-fail-unknown
+core-deps-fetch-fail-unknown: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -699,7 +687,7 @@ core-deps-fetch-fail-unknown: build clean-core-deps-fetch-fail-unknown
 	$i "Check that building the application fails"
 	$t ! $(MAKE) -C $(APP) $v
 
-core-deps-fetch-git: build clean-core-deps-fetch-git
+core-deps-fetch-git: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -730,7 +718,7 @@ endif
 		{ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
 		halt()"
 
-core-deps-fetch-git-submodule: build clean-core-deps-fetch-git-submodule
+core-deps-fetch-git-submodule: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -784,7 +772,7 @@ endif
 		true = lists:member(my_dep, Deps), \
 		halt()"
 
-core-deps-fetch-hex: build clean-core-deps-fetch-hex
+core-deps-fetch-hex: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -815,7 +803,7 @@ endif
 		{ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
 		halt()"
 
-core-deps-fetch-hg: build clean-core-deps-fetch-hg
+core-deps-fetch-hg: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -845,7 +833,7 @@ endif
 		halt()"
 
 # Legacy must fail for the top-level application, but work for dependencies.
-core-deps-fetch-legacy: build clean-core-deps-fetch-legacy
+core-deps-fetch-legacy: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -861,7 +849,7 @@ core-deps-fetch-legacy: build clean-core-deps-fetch-legacy
 	$i "Check that building the application works with IS_DEP=1"
 	$t $(MAKE) -C $(APP) IS_DEP=1 $v
 
-core-deps-fetch-svn: build clean-core-deps-fetch-svn
+core-deps-fetch-svn: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -890,7 +878,7 @@ endif
 		{ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
 		halt()"
 
-core-deps-ignore: build clean-core-deps-ignore
+core-deps-ignore: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -919,7 +907,7 @@ endif
 	$i "Check that the correct dependencies were fetched"
 	$t test -d $(APP)/deps/ranch
 
-core-deps-mv: build clean-core-deps-mv clean-core-deps-mv-moved
+core-deps-mv: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -941,7 +929,7 @@ core-deps-mv: build clean-core-deps-mv clean-core-deps-mv-moved
 	$i "Build the application"
 	$t $(MAKE) -C $(APP)-moved $v
 
-core-deps-mv-rebar: build clean-core-deps-mv-rebar clean-core-deps-mv-rebar-moved
+core-deps-mv-rebar: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -966,7 +954,7 @@ core-deps-mv-rebar: build clean-core-deps-mv-rebar clean-core-deps-mv-rebar-move
 
 # A lower-level dependency of the first dependency always
 # wins over a lower-level dependency of the second dependency.
-core-deps-order-first: build clean-core-deps-order-first
+core-deps-order-first: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1007,7 +995,7 @@ endif
 		halt()"
 
 # A higher-level dependency always wins.
-core-deps-order-top: build clean-core-deps-order-top
+core-deps-order-top: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1038,7 +1026,7 @@ endif
 		{ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
 		halt()"
 
-core-deps-no-autopatch: build clean-core-deps-no-autopatch
+core-deps-no-autopatch: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1059,7 +1047,7 @@ core-deps-no-autopatch: build clean-core-deps-no-autopatch
 	$i "Check that Cowlib was not autopatched"
 	$t grep -q Hoguin $(APP)/deps/cowlib/erlang.mk
 
-core-deps-no-autopatch-erlang-mk: build clean-core-deps-no-autopatch-erlang-mk
+core-deps-no-autopatch-erlang-mk: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1078,7 +1066,7 @@ core-deps-no-autopatch-erlang-mk: build clean-core-deps-no-autopatch-erlang-mk
 	$i "Check that Erlang.mk was not autopatched"
 	$t grep -q Hoguin $(APP)/deps/cowlib/erlang.mk
 
-core-deps-no-autopatch-rebar: build clean-core-deps-no-autopatch-rebar
+core-deps-no-autopatch-rebar: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1100,7 +1088,7 @@ core-deps-no-autopatch-rebar: build clean-core-deps-no-autopatch-rebar
 	$t if grep -q erlang\.mk $(APP)/deps/lager/Makefile; then false; fi
 
 ifndef LEGACY
-core-deps-otp: build clean-core-deps-otp
+core-deps-otp: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1124,7 +1112,7 @@ core-deps-otp: build clean-core-deps-otp
 		halt()"
 endif
 
-core-deps-pkg: build clean-core-deps-pkg
+core-deps-pkg: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1154,7 +1142,7 @@ endif
 		true = lists:member(cowboy, Deps), \
 		halt()"
 
-core-deps-rel: build clean-core-deps-rel
+core-deps-rel: build clean
 
 	$i "Bootstrap a new release-enabled OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1215,7 +1203,7 @@ else
 	$t $(APP)/_rel/$(APP)_release/bin/$(APP)_release stop $v
 endif
 
-core-deps-search: build clean-core-deps-search
+core-deps-search: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1228,7 +1216,7 @@ core-deps-search: build clean-core-deps-search
 	$i "Run 'make search q=cowboy' and check that it prints packages"
 	$t test -n "`$(MAKE) -C $(APP) search q=cowboy`"
 
-core-deps-shell: build clean-core-deps-shell
+core-deps-shell: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1267,7 +1255,7 @@ core-deps-shell: build clean-core-deps-shell
 		false = lists:member(tddreloader, Deps), \
 		halt()"
 
-core-deps-skip: build clean-core-deps-skip
+core-deps-skip: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -1304,7 +1292,7 @@ endif
 	$t test -d $(APP)/deps/cowboy
 	$t test -d $(APP)/deps/ranch
 
-core-deps-test: build clean-core-deps-test
+core-deps-test: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 3 - 9
test/core_plugins.mk

@@ -2,18 +2,12 @@
 
 CORE_PLUGINS_CASES = all one
 CORE_PLUGINS_TARGETS = $(addprefix core-plugins-,$(CORE_PLUGINS_CASES))
-CORE_PLUGINS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_PLUGINS_TARGETS))
 
-.PHONY: core-plugins $(CORE_PLUGINS_TARGETS) clean-core-plugins $(CORE_PLUGINS_CLEAN_TARGETS)
-
-clean-core-plugins: $(CORE_PLUGINS_CLEAN_TARGETS)
-
-$(CORE_PLUGINS_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: core-plugins $(CORE_PLUGINS_TARGETS)
 
 core-plugins: $(CORE_PLUGINS_TARGETS)
 
-core-plugins-all: build clean-core-plugins-all
+core-plugins-all: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -45,7 +39,7 @@ core-plugins-all: build clean-core-plugins-all
 	$i "Run 'make plugin2' and check that it prints plugin2"
 	$t test -n "`$(MAKE) -C $(APP) plugin2 | grep plugin2`"
 
-core-plugins-one: build clean-core-plugins-one
+core-plugins-one: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 7 - 13
test/core_upgrade.mk

@@ -2,18 +2,12 @@
 
 CORE_UPGRADE_CASES = conflicting-configs custom-build-dir custom-config custom-repo no-config renamed-config
 CORE_UPGRADE_TARGETS = $(addprefix core-upgrade-,$(CORE_UPGRADE_CASES))
-CORE_UPGRADE_CLEAN_TARGETS = $(addprefix clean-,$(CORE_UPGRADE_TARGETS))
 
-.PHONY: core-upgrade $(CORE_UPGRADE_TARGETS) clean-core-upgrade $(CORE_UPGRADE_CLEAN_TARGETS)
-
-clean-core-upgrade: $(CORE_UPGRADE_CLEAN_TARGETS)
-
-$(CORE_UPGRADE_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: core-upgrade $(CORE_UPGRADE_TARGETS)
 
 core-upgrade: $(CORE_UPGRADE_TARGETS)
 
-core-upgrade-conflicting-configs: build clean-core-upgrade-conflicting-configs
+core-upgrade-conflicting-configs: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -42,7 +36,7 @@ core-upgrade-conflicting-configs: build clean-core-upgrade-conflicting-configs
 	$i "Check that the bootstrap plugin is gone"
 	$t ! $(MAKE) -C $(APP) list-templates $v
 
-core-upgrade-custom-build-dir: build clean-core-upgrade-custom-build-dir
+core-upgrade-custom-build-dir: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -68,7 +62,7 @@ core-upgrade-custom-build-dir: build clean-core-upgrade-custom-build-dir
 	$i "Check that the custom build directory is gone"
 	$t test ! -d $(APP)/custom/
 
-core-upgrade-custom-config: build clean-core-upgrade-custom-config
+core-upgrade-custom-config: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -84,7 +78,7 @@ core-upgrade-custom-config: build clean-core-upgrade-custom-config
 	$i "Check that the bootstrap plugin is gone"
 	$t ! $(MAKE) -C $(APP) list-templates $v
 
-core-upgrade-custom-repo: build clean-core-upgrade-custom-repo
+core-upgrade-custom-repo: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -110,7 +104,7 @@ core-upgrade-custom-repo: build clean-core-upgrade-custom-repo
 	$i "Check our modification is there"
 	$t grep -q "# Copyright (c) erlang.mk Testsuite!" $(APP)/erlang.mk
 
-core-upgrade-no-config: build clean-core-upgrade-no-config
+core-upgrade-no-config: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -129,7 +123,7 @@ core-upgrade-no-config: build clean-core-upgrade-no-config
 	$i "Check that the rule is gone"
 	$t ! $(MAKE) -C $(APP) erlang_mk_upgrade_test_rule $v
 
-core-upgrade-renamed-config: build clean-core-upgrade-renamed-config
+core-upgrade-renamed-config: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 7 - 13
test/plugin_bootstrap.mk

@@ -2,18 +2,12 @@
 
 BOOTSTRAP_CASES = app lib rel sp tab templates
 BOOTSTRAP_TARGETS = $(addprefix bootstrap-,$(BOOTSTRAP_CASES))
-BOOTSTRAP_CLEAN_TARGETS = $(addprefix clean-,$(BOOTSTRAP_TARGETS))
 
-.PHONY: bootstrap $(BOOTSTRAP_TARGETS) clean-bootstrap $(BOOTSTRAP_CLEAN_TARGETS)
-
-clean-bootstrap: $(BOOTSTRAP_CLEAN_TARGETS)
-
-$(BOOTSTRAP_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: bootstrap $(BOOTSTRAP_TARGETS)
 
 bootstrap: $(BOOTSTRAP_TARGETS)
 
-bootstrap-app: build clean-bootstrap-app
+bootstrap-app: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -44,7 +38,7 @@ endif
 		{module, $(APP)_sup} = code:load_file($(APP)_sup), \
 		halt()"
 
-bootstrap-lib: build clean-bootstrap-lib
+bootstrap-lib: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -69,7 +63,7 @@ endif
 		{ok, []} = application:get_key($(APP), modules), \
 		halt()"
 
-bootstrap-rel: build clean-bootstrap-rel
+bootstrap-rel: build clean
 
 	$i "Bootstrap a new release-enabled OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -116,7 +110,7 @@ endif
 	$i "Check that there's no erl_crash.dump file"
 	$t test ! -f $(APP)/_rel/$(APP)_release/erl_crash.dump
 
-bootstrap-sp: build clean-bootstrap-sp
+bootstrap-sp: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -155,7 +149,7 @@ endif
 		{module, $(APP)_sup} = code:load_file($(APP)_sup), \
 		halt()"
 
-bootstrap-tab: build clean-bootstrap-tab
+bootstrap-tab: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -177,7 +171,7 @@ endif
 	$t test "`awk -F "\t" 'NF > 1' $(APP)/src/$(APP)_app.erl`"
 	$t test "`awk -F "\t" 'NF > 1' $(APP)/src/$(APP)_sup.erl`"
 
-bootstrap-templates: build clean-bootstrap-templates
+bootstrap-templates: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 2 - 9
test/plugin_c_src.mk

@@ -2,20 +2,13 @@
 
 C_SRC_CASES = cpp custom dir env nif port
 C_SRC_TARGETS = $(addprefix c-src-,$(C_SRC_CASES))
-C_SRC_CLEAN_TARGETS = $(addprefix clean-,$(C_SRC_TARGETS))
 
-.PHONY: c-src $(C_SRC_TARGETS) clean-c-src $(C_SRC_CLEAN_TARGETS)
-
-clean-c-src: $(C_SRC_CLEAN_TARGETS)
-clean-c_src: clean-c-src
-
-$(C_SRC_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: c-src $(C_SRC_TARGETS)
 
 c-src: $(C_SRC_TARGETS)
 c_src: c-src
 
-c-src-nif: build clean-c-src-nif
+c-src-nif: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 11 - 17
test/plugin_dialyzer.mk

@@ -2,22 +2,16 @@
 
 DIALYZER_CASES = app apps-only apps-with-local-deps check custom-plt deps erlc-opts local-deps opts plt-apps
 DIALYZER_TARGETS = $(addprefix dialyzer-,$(DIALYZER_CASES))
-DIALYZER_CLEAN_TARGETS = $(addprefix clean-,$(DIALYZER_TARGETS))
 
 ifneq ($(shell which sem 2>/dev/null),)
 	DIALYZER_MUTEX = sem --fg --id dialyzer
 endif
 
-.PHONY: dialyzer $(C_SRC_TARGETS) clean-dialyzer $(DIALYZER_CLEAN_TARGETS)
-
-clean-dialyzer: $(DIALYZER_CLEAN_TARGETS)
-
-$(DIALYZER_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: dialyzer $(C_SRC_TARGETS)
 
 dialyzer: $(DIALYZER_TARGETS)
 
-dialyzer-app: build clean-dialyzer-app
+dialyzer-app: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -44,7 +38,7 @@ dialyzer-app: build clean-dialyzer-app
 	$i "Check that the PLT file was removed"
 	$t test ! -e $(APP)/.$(APP).plt
 
-dialyzer-apps-only: build clean-dialyzer-apps-only
+dialyzer-apps-only: build clean
 
 	$i "Create a multi application repository with no root application"
 	$t mkdir $(APP)/
@@ -77,7 +71,7 @@ dialyzer-apps-only: build clean-dialyzer-apps-only
 	$i "Confirm that Dialyzer errors out"
 	$t ! $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v
 
-dialyzer-apps-with-local-deps: build clean-dialyzer-apps-with-local-deps
+dialyzer-apps-with-local-deps: build clean
 
 	$i "Create a multi application repository with no root application"
 	$t mkdir $(APP)/
@@ -102,7 +96,7 @@ dialyzer-apps-with-local-deps: build clean-dialyzer-apps-with-local-deps
 	$i "Confirm that my_core_app was NOT included in the PLT"
 	$t ! dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q my_core_app
 
-dialyzer-check: build clean-dialyzer-check
+dialyzer-check: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -123,7 +117,7 @@ dialyzer-check: build clean-dialyzer-check
 	$i "Confirm that Dialyzer errors out on 'make check'"
 	$t ! $(DIALYZER_MUTEX) $(MAKE) -C $(APP) check $v
 
-dialyzer-custom-plt: build clean-dialyzer-custom-plt
+dialyzer-custom-plt: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -145,7 +139,7 @@ dialyzer-custom-plt: build clean-dialyzer-custom-plt
 	$i "Check that the PLT file was removed"
 	$t test ! -e $(APP)/custom.plt
 
-dialyzer-deps: build clean-dialyzer-deps
+dialyzer-deps: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -164,7 +158,7 @@ dialyzer-deps: build clean-dialyzer-deps
 	$i "Confirm that Cowlib was included in the PLT"
 	$t dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q cowlib
 
-dialyzer-erlc-opts: build clean-dialyzer-erlc-opts
+dialyzer-erlc-opts: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -188,7 +182,7 @@ dialyzer-erlc-opts: build clean-dialyzer-erlc-opts
 	$i "Run Dialyzer"
 	$t $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v
 
-dialyzer-local-deps: build clean-dialyzer-local-deps
+dialyzer-local-deps: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -204,7 +198,7 @@ dialyzer-local-deps: build clean-dialyzer-local-deps
 	$i "Confirm that runtime_tools was included in the PLT"
 	$t dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q runtime_tools
 
-dialyzer-opts: build clean-dialyzer-opts
+dialyzer-opts: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -229,7 +223,7 @@ dialyzer-opts: build clean-dialyzer-opts
 	$i "Check that the output file was created"
 	$t test -f $(APP)/output.txt
 
-dialyzer-plt-apps: build clean-dialyzer-plt-apps
+dialyzer-plt-apps: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/

+ 3 - 9
test/plugin_erlydtl.mk

@@ -2,18 +2,12 @@
 
 ERLYDTL_CASES = compile full-path
 ERLYDTL_TARGETS = $(addprefix erlydtl-,$(ERLYDTL_CASES))
-ERLYDTL_CLEAN_TARGETS = $(addprefix clean-,$(ERLYDTL_TARGETS))
 
-.PHONY: erlydtl $(ERLYDTL_TARGETS) clean-erlydtl $(ERLYDTL_CLEAN_TARGETS)
-
-clean-erlydtl: $(ERLYDTL_CLEAN_TARGETS)
-
-$(ERLYDTL_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: erlydtl $(ERLYDTL_TARGETS)
 
 erlydtl: $(ERLYDTL_TARGETS)
 
-erlydtl-compile: build clean-erlydtl-compile
+erlydtl-compile: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -41,7 +35,7 @@ erlydtl-compile: build clean-erlydtl-compile
 		{ok, [$(APP_)_one_dtl, $(APP)_two_dtl]} = application:get_key($(APP), modules), \
 		halt()"
 
-erlydtl-full-path: build clean-erlydtl-full-path
+erlydtl-full-path: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/

+ 9 - 15
test/plugin_eunit.mk

@@ -2,18 +2,12 @@
 
 EUNIT_CASES = all apps-only check erl-opts fun mod test-dir tests
 EUNIT_TARGETS = $(addprefix eunit-,$(EUNIT_CASES))
-EUNIT_CLEAN_TARGETS = $(addprefix clean-,$(EUNIT_TARGETS))
 
-.PHONY: eunit $(EUNIT_TARGETS) clean-eunit $(EUNIT_CLEAN_TARGETS)
-
-clean-eunit: $(EUNIT_CLEAN_TARGETS)
-
-$(EUNIT_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: eunit $(EUNIT_TARGETS)
 
 eunit: $(EUNIT_TARGETS)
 
-eunit-all: build clean-eunit-all
+eunit-all: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -50,7 +44,7 @@ eunit-all: build clean-eunit-all
 	$i "Check that EUnit errors out"
 	$t ! $(MAKE) -C $(APP) eunit $v
 
-eunit-apps-only: build clean-eunit-apps-only
+eunit-apps-only: build clean
 
 	$i "Create a multi application repository with no root application"
 	$t mkdir $(APP)/
@@ -85,7 +79,7 @@ eunit-apps-only: build clean-eunit-apps-only
 	$i "Check that EUnit runs tests"
 	$t $(MAKE) -C $(APP) eunit | grep -q "Test passed."
 
-eunit-check: build clean-eunit-check
+eunit-check: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -103,7 +97,7 @@ eunit-check: build clean-eunit-check
 	$i "Check that EUnit runs on 'make check'"
 	$t $(MAKE) -C $(APP) check | grep -q "Test passed."
 
-eunit-erl-opts: build clean-eunit-erl-opts
+eunit-erl-opts: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -124,7 +118,7 @@ eunit-erl-opts: build clean-eunit-erl-opts
 	$i "Check that EUnit uses EUNIT_ERL_OPTS"
 	$t $(MAKE) -C $(APP) eunit | grep -q "hello"
 
-eunit-fun: build clean-eunit-fun
+eunit-fun: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -143,7 +137,7 @@ eunit-fun: build clean-eunit-fun
 	$i "Check that we can run EUnit on a specific test"
 	$t $(MAKE) -C $(APP) eunit t=$(APP):ok_test $v
 
-eunit-mod: build clean-eunit-mod
+eunit-mod: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -169,7 +163,7 @@ eunit-mod: build clean-eunit-mod
 	$i "Check that we can run EUnit on a specific module"
 	$t $(MAKE) -C $(APP) eunit t=$(APP) $v
 
-eunit-test-dir: build clean-eunit-test-dir
+eunit-test-dir: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/
@@ -197,7 +191,7 @@ eunit-test-dir: build clean-eunit-test-dir
 	$i "Check that tests were both run only once"
 	$t printf "%s\n" $(APP) $(APP)_tests | cmp $(APP)/eunit.log -
 
-eunit-tests: build clean-eunit-tests
+eunit-tests: build clean
 
 	$i "Bootstrap a new OTP application named $(APP)"
 	$t mkdir $(APP)/

+ 3 - 9
test/plugin_shell.mk

@@ -2,18 +2,12 @@
 
 SHELL_CASES = default kjell
 SHELL_TARGETS = $(addprefix shell-,$(SHELL_CASES))
-SHELL_CLEAN_TARGETS = $(addprefix clean-,$(SHELL_TARGETS))
 
-.PHONY: shell $(C_SRC_TARGETS) clean-shell $(SHELL_CLEAN_TARGETS)
-
-clean-shell: $(SHELL_CLEAN_TARGETS)
-
-$(SHELL_CLEAN_TARGETS):
-	$t rm -rf $(APP_TO_CLEAN)
+.PHONY: shell $(C_SRC_TARGETS)
 
 shell: $(SHELL_TARGETS)
 
-shell-default: build clean-shell-default
+shell-default: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/
@@ -23,7 +17,7 @@ shell-default: build clean-shell-default
 	$i "Run the shell"
 	$t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval 'halt()'" $v
 
-shell-kjell: build clean-shell-kjell
+shell-kjell: build clean
 
 	$i "Bootstrap a new OTP library named $(APP)"
 	$t mkdir $(APP)/