From b867e42578e5cc56f118e6e99d02d72a7f573ac7 Mon Sep 17 00:00:00 2001
From: James Zern <jzern@google.com>
Date: Wed, 5 Mar 2014 14:11:07 -0800
Subject: [PATCH] Makefile: add distclean target

wipes out configure generated files

Change-Id: I55d5865b84c6dfc19f13011e66e3483c54bf6a15
---
 build/make/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/build/make/Makefile b/build/make/Makefile
index 6894d6dde7..dd7fb4a213 100644
--- a/build/make/Makefile
+++ b/build/make/Makefile
@@ -94,6 +94,16 @@ clean::
 	rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s)
 	rm -f $(CLEAN-OBJS)
 
+.PHONY: clean
+distclean: clean
+	if [ -z "$(target)" ]; then \
+      rm -f Makefile; \
+      rm -f config.log config.mk; \
+      rm -f vpx_config.[hc] vpx_config.asm; \
+    else \
+      rm -f $(target)-$(TOOLCHAIN).mk; \
+    fi
+
 .PHONY: dist
 dist:
 .PHONY: install
@@ -307,7 +317,7 @@ endef
 ifneq ($(target),)
 include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
 endif
-ifeq ($(filter clean,$(MAKECMDGOALS)),)
+ifeq ($(filter %clean,$(MAKECMDGOALS)),)
   # Older versions of make don't like -include directives with no arguments
   ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
     -include $(filter %.d,$(OBJS-yes:.o=.d))
-- 
GitLab