Makefile: Use FORCE instead of PHONY for wildcard targets
PHONY does not support wildcards. Make the catch-all target depend on an
unsatisfiable target instead. This was causing problems with targets
that match a file name, like 'linux'.
Test: make linux
Change-Id: I306a94184f143f8f626d08eeb57fa2e561a884b5
diff --git a/Makefile b/Makefile
index 8f0cca7..56fcb0d 100644
--- a/Makefile
+++ b/Makefile
@@ -21,13 +21,15 @@
MAKE := $(ROOTDIR)/prebuilts/linux-x86/make/bin/make
MAKEFILE := $(ROOTDIR)/build/Makefile.root
-.PHONY: all %
+.PHONY: FORCE
+FORCE:
# At least one target must be defined for `make` (no arguments) to succeed.
# The name must match the default rule in $MAKEFILE.
-default:
+.DEFAULT_GOAL := default
+default: FORCE
$(MAKE) -f $(MAKEFILE) $@
# Catch-all target that propagates the call to the root Makefile.
-%:
+%: FORCE
$(MAKE) -f $(MAKEFILE) $@