From b867e42578e5cc56f118e6e99d02d72a7f573ac7 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 5 Mar 2014 14:11:07 -0800 Subject: [PATCH 1/2] 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 6894d6dde..dd7fb4a21 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)) From 9402e25b4b69352387d611b21a8fde95c3a0a624 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 5 Mar 2014 14:13:01 -0800 Subject: [PATCH 2/2] configure: add a test for configured source dir prevents out of tree build failures when the source tree has already been configured; modeled after a similar check in autoconf Change-Id: I627eb7243576f4d753141dfcb4ed4e34544d03a7 --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure b/configure index f37615f72..76038e58f 100755 --- a/configure +++ b/configure @@ -164,6 +164,14 @@ if ! perl --version >/dev/null; then die "Perl is required to build" fi + +if [ "`cd ${source_path} && pwd`" != "`pwd`" ]; then + # test to see if source_path already configured + if [ -f ${source_path}/vpx_config.h ]; then + die "source directory already configured; run 'make distclean' there first" + fi +fi + # check installed doxygen version doxy_version=$(doxygen --version 2>/dev/null) doxy_major=${doxy_version%%.*}