THRIFT-389. Make "make dist" work properly for Subversion working copies


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758560 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/Makefile.am b/Makefile.am
index 0a677d3..1669f1e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,9 @@
 ACLOCAL_AMFLAGS = -I ./aclocal
 
 SUBDIRS = compiler/cpp lib test
-## Don't run make dist from a subversion working copy
-## because it will pull in your .svn directories.
+
+dist-hook:
+	find $(distdir) -name '.[a-zA-Z0-9]*' | xargs rm -rf
+
 EXTRA_DIST = bootstrap.sh cleanup.sh print_version.sh doc tutorial contrib \
              CONTRIBUTORS LICENSE