diff --git a/Makefile b/Makefile index 5635bff6e8..ae7ba3cdbe 100644 --- a/Makefile +++ b/Makefile @@ -1254,4 +1254,7 @@ include docs/manual/manual.mk .PHONY: $(noconfig_targets) +# .WAIT was introduced in make 4.4. For older make, define it as phony. +.PHONY: .WAIT + endif #umask / $(CURDIR) / $(O) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 5d1c1da128..9947e4cc6d 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -1057,17 +1057,17 @@ endif rm -f $$($(2)_TARGET_INSTALL_IMAGES) rm -f $$($(2)_TARGET_INSTALL_HOST) -$(1)-reinstall: $(1)-clean-for-reinstall $(1) +$(1)-reinstall: $(1)-clean-for-reinstall .WAIT $(1) $(1)-clean-for-rebuild: $(1)-clean-for-reinstall rm -f $$($(2)_TARGET_BUILD) -$(1)-rebuild: $(1)-clean-for-rebuild $(1) +$(1)-rebuild: $(1)-clean-for-rebuild .WAIT $(1) $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild rm -f $$($(2)_TARGET_CONFIGURE) -$(1)-reconfigure: $(1)-clean-for-reconfigure $(1) +$(1)-reconfigure: $(1)-clean-for-reconfigure .WAIT $(1) # define the PKG variable for all targets, containing the # uppercase package variable prefix