Manually remove $(BUILT_SOURCES) since no-dist-built-sources doesnt work
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3f717f1..19177cc 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -102,6 +102,9 @@
 
 # All of the libs that don't use Automake need to go in here
 # so they will end up in our release tarballs.
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	d \
 	dart \
diff --git a/lib/c_glib/Makefile.am b/lib/c_glib/Makefile.am
index b2061bb..80a5165 100644
--- a/lib/c_glib/Makefile.am
+++ b/lib/c_glib/Makefile.am
@@ -112,6 +112,9 @@
                             src/thrift/c_glib/processor/thrift_multiplexed_processor.h
 
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
              CMakeLists.txt \
              coding_standards.md \
diff --git a/lib/c_glib/test/Makefile.am b/lib/c_glib/test/Makefile.am
index f3a0c30..c7c67ab 100644
--- a/lib/c_glib/test/Makefile.am
+++ b/lib/c_glib/test/Makefile.am
@@ -401,6 +401,9 @@
     *.gcda                              \
     *.gcov
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
              CMakeLists.txt \
              ContainerTest.thrift
diff --git a/lib/cl/Makefile.am b/lib/cl/Makefile.am
index 34b3886..a54eb92 100644
--- a/lib/cl/Makefile.am
+++ b/lib/cl/Makefile.am
@@ -32,6 +32,9 @@
 	$(RM) run-tests quicklisp.lisp backport-update.zip
 	$(RM) -rf lib externals quicklisp
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	README.md \
 	READMES \
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index c015b0d..2499fdb 100644
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -252,6 +252,9 @@
              libthriftnb.vcxproj.filters \
              3rdparty.props
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
              CMakeLists.txt \
              coding_standards.md \
diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am
index cd401c0..a744039 100644
--- a/lib/cpp/test/Makefile.am
+++ b/lib/cpp/test/Makefile.am
@@ -424,6 +424,9 @@
 clean-local:
 	$(RM) gen-cpp/*
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	concurrency \
 	processor \
diff --git a/lib/d/Makefile.am b/lib/d/Makefile.am
index 0137217..6f014c8 100644
--- a/lib/d/Makefile.am
+++ b/lib/d/Makefile.am
@@ -192,6 +192,9 @@
 precross: all-local
 	$(MAKE) -C test precross
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	src \
 	test \
diff --git a/lib/d/test/Makefile.am b/lib/d/test/Makefile.am
index 44364f9..28f3f3e 100644
--- a/lib/d/test/Makefile.am
+++ b/lib/d/test/Makefile.am
@@ -38,6 +38,8 @@
 $(thrift_test_gen): $(top_srcdir)/test/v0.16/ThriftTest.thrift
 	$(THRIFT) --gen d $<
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
 
 # The actual test targets.
 # There just must be some way to reassign a variable without warnings in
diff --git a/lib/dart/Makefile.am b/lib/dart/Makefile.am
index bd12a92..74f1404 100644
--- a/lib/dart/Makefile.am
+++ b/lib/dart/Makefile.am
@@ -28,6 +28,9 @@
 
 check-local: all
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 dist-hook:
 	$(RM) -r $(distdir)/.pub
 	find $(distdir) -type d -name ".dart_tool" | xargs $(RM) -r
diff --git a/lib/erl/Makefile.am b/lib/erl/Makefile.am
index 23ebb77..4259a1f 100644
--- a/lib/erl/Makefile.am
+++ b/lib/erl/Makefile.am
@@ -78,6 +78,9 @@
 	$(RM) -r $(distdir)/test/gen-erl/
 	$(RM)    $(distdir)/$(THRIFT_OMIT_FILE)
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	include \
 	src \
diff --git a/lib/go/Makefile.am b/lib/go/Makefile.am
index 18b6b75..3bfefbc 100644
--- a/lib/go/Makefile.am
+++ b/lib/go/Makefile.am
@@ -48,6 +48,9 @@
 all-local:
 	$(GO) build $(GOBUILDEXTRA) ./thrift
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	thrift \
 	coding_standards.md \
diff --git a/lib/go/test/Makefile.am b/lib/go/test/Makefile.am
index 379971e..d76f248 100644
--- a/lib/go/test/Makefile.am
+++ b/lib/go/test/Makefile.am
@@ -136,6 +136,9 @@
 client: stubs
 	$(GO) run TestClient.go
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	dontexportrwtest \
 	tests \
diff --git a/lib/go/test/fuzz/Makefile.am b/lib/go/test/fuzz/Makefile.am
index 9677f4f..a481e95 100644
--- a/lib/go/test/fuzz/Makefile.am
+++ b/lib/go/test/fuzz/Makefile.am
@@ -27,6 +27,9 @@
 clean-local:
 	$(RM) -rf gopathfuzz gen-go
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	fuzz.go \
 	fuzz_test.go \
diff --git a/lib/haxe/test/Makefile.am b/lib/haxe/test/Makefile.am
index 2b8b245..8c658ae 100644
--- a/lib/haxe/test/Makefile.am
+++ b/lib/haxe/test/Makefile.am
@@ -69,6 +69,9 @@
 	$(BIN_CPP)
 	php -f $(BIN_PHP)
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
              src \
              cpp.hxml \
diff --git a/lib/java/Makefile.am b/lib/java/Makefile.am
index 1dd42a7..fc63af4 100644
--- a/lib/java/Makefile.am
+++ b/lib/java/Makefile.am
@@ -56,6 +56,9 @@
 		-Pthrift.version=$(PACKAGE_VERSION) \
 		--console=plain
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	build.gradle \
 	gradle.properties \
diff --git a/lib/js/Makefile.am b/lib/js/Makefile.am
index 4906d7d..9b7dfb6 100644
--- a/lib/js/Makefile.am
+++ b/lib/js/Makefile.am
@@ -52,6 +52,9 @@
 	$(RM) -r $(distdir)/test/build/
 	$(RM) -r $(distdir)/test/gen-*/
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	coding_standards.md \
 	Gruntfile.js \
diff --git a/lib/js/test/Makefile.am b/lib/js/test/Makefile.am
index 14927c4..8a817b3 100644
--- a/lib/js/test/Makefile.am
+++ b/lib/js/test/Makefile.am
@@ -24,6 +24,9 @@
 	ANT=$(ANT) ; if test -z "$$ANT" ; then ANT=: ; fi ; \
 	$$ANT $(ANT_FLAGS) clean
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 check-local: all
 	$(ANT) $(ANT_FLAGS) test
 
diff --git a/lib/json/Makefile.am b/lib/json/Makefile.am
index 6c8c0ce..3c7aa8f 100644
--- a/lib/json/Makefile.am
+++ b/lib/json/Makefile.am
@@ -28,6 +28,9 @@
 dist-hook:
 	$(RM) -r $(distdir)/test/build/
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
     schema.json \
     test
diff --git a/lib/json/test/Makefile.am b/lib/json/test/Makefile.am
index bb87a52..16bcfae 100644
--- a/lib/json/test/Makefile.am
+++ b/lib/json/test/Makefile.am
@@ -20,6 +20,9 @@
 check:
 	$(ANT) $(ANT_FLAGS) test
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 # Make sure this doesn't fail if ant is not configured.
 clean-local:
 	ANT=$(ANT) ; if test -z "$$ANT" ; then ANT=: ; fi ; \
diff --git a/lib/kotlin/Makefile.am b/lib/kotlin/Makefile.am
index 720f823..e5685cf 100644
--- a/lib/kotlin/Makefile.am
+++ b/lib/kotlin/Makefile.am
@@ -40,6 +40,9 @@
 		-Pthrift.compiler=$(THRIFT) \
 		--console=plain
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	build.gradle.kts \
 	CMakeLists.txt \
diff --git a/lib/lua/Makefile.am b/lib/lua/Makefile.am
index 3b272f5..ae67d94 100644
--- a/lib/lua/Makefile.am
+++ b/lib/lua/Makefile.am
@@ -57,6 +57,9 @@
 liblualongnumber_la_LDFLAGS = $(AM_LDFLAGS)
 liblualongnumber_la_LIBADD = $(LUA_LIB) -lm
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 		coding_standards.md \
 		TBinaryProtocol.lua \
diff --git a/lib/netstd/Makefile.am b/lib/netstd/Makefile.am
index 47b3803..ccaef9e 100644
--- a/lib/netstd/Makefile.am
+++ b/lib/netstd/Makefile.am
@@ -39,6 +39,9 @@
 	$(RM) -r Tests/Thrift.PublicInterfaces.Compile.Tests/bin
 	$(RM) -r Tests/Thrift.PublicInterfaces.Compile.Tests/obj
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	README.md \
 	Directory.Build.props \
diff --git a/lib/nodejs/Makefile.am b/lib/nodejs/Makefile.am
index 6691579..9503f04 100644
--- a/lib/nodejs/Makefile.am
+++ b/lib/nodejs/Makefile.am
@@ -37,6 +37,9 @@
 	$(RM) -r test/episodic-code-generation-test/gen*
 	$(RM) -r test/episodic-code-generation-test/node_modules
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	examples \
 	lib \
diff --git a/lib/nodets/Makefile.am b/lib/nodets/Makefile.am
index 02d0c11..ac2aa6e 100644
--- a/lib/nodets/Makefile.am
+++ b/lib/nodets/Makefile.am
@@ -41,6 +41,9 @@
 	$(RM) -r $(top_srcdir)/node_modules
 	$(RM) -r test-compiled
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	test \
 	coding_standards.md
diff --git a/lib/perl/Makefile.am b/lib/perl/Makefile.am
index 8b72436..9d762b4 100644
--- a/lib/perl/Makefile.am
+++ b/lib/perl/Makefile.am
@@ -36,6 +36,9 @@
 	$(RM) Makefile-perl.mk.old
 	$(RM) -r gen-perl gen-perl2
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	coding_standards.md \
 	build-cpan-dist.sh \
diff --git a/lib/perl/t/Makefile.am b/lib/perl/t/Makefile.am
index de03971..7e9d8a0 100644
--- a/lib/perl/t/Makefile.am
+++ b/lib/perl/t/Makefile.am
@@ -17,4 +17,7 @@
 # under the License.
 #
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = memory_buffer.t processor.t multiplex.t
diff --git a/lib/php/Makefile.am b/lib/php/Makefile.am
index a618d24..3851294 100644
--- a/lib/php/Makefile.am
+++ b/lib/php/Makefile.am
@@ -134,6 +134,8 @@
 clean-local:
 	if [ -f src/ext/thrift_protocol/Makefile ]; then cd src/ext/thrift_protocol/ && $(MAKE) clean; fi
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
 
 EXTRA_DIST = \
 	lib \
@@ -149,7 +151,8 @@
 	coding_standards.md \
 	thrift_protocol.ini \
 	README.apache.md \
-	README.md
+	README.md \
+	test
 
 
 MAINTAINERCLEANFILES = \
diff --git a/lib/php/test/Makefile.am b/lib/php/test/Makefile.am
index 00d51f6..1e534ca 100644
--- a/lib/php/test/Makefile.am
+++ b/lib/php/test/Makefile.am
@@ -41,6 +41,9 @@
 
 distclean-local:
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 clean-local:
 	$(RM) -r ./Resources/packages
 	$(RM) test-log-junit.xml
diff --git a/lib/py/Makefile.am b/lib/py/Makefile.am
index 9b6d33b..b76a7dc 100644
--- a/lib/py/Makefile.am
+++ b/lib/py/Makefile.am
@@ -69,6 +69,9 @@
 	find $(distdir) -type f \( -iname "*.pyc" \) | xargs rm -f
 	find $(distdir) -type d \( -iname "__pycache__" -or -iname "_trial_temp" \) | xargs rm -rf
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	CMakeLists.txt \
 	MANIFEST.in \
diff --git a/lib/rb/Makefile.am b/lib/rb/Makefile.am
index 1841065..ab5d903 100644
--- a/lib/rb/Makefile.am
+++ b/lib/rb/Makefile.am
@@ -42,6 +42,9 @@
 dist-hook:
 	$(RM) -r $(distdir)/spec/gen-rb/
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	coding_standards.md \
 	Rakefile \
diff --git a/lib/rs/Makefile.am b/lib/rs/Makefile.am
index 7a9b30a..3a13403 100644
--- a/lib/rs/Makefile.am
+++ b/lib/rs/Makefile.am
@@ -45,6 +45,9 @@
 	$(CARGO) clean
 	-$(RM) Cargo.lock
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	src \
 	Cargo.toml \
diff --git a/lib/rs/test/Makefile.am b/lib/rs/test/Makefile.am
index 017a2c4..73fe156 100644
--- a/lib/rs/test/Makefile.am
+++ b/lib/rs/test/Makefile.am
@@ -47,6 +47,9 @@
 	-$(RM) src/identifiers.rs
 	-$(RM) -r bin
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	Cargo.toml \
 	thrifts/Base_One.thrift \
diff --git a/lib/rs/test_recursive/Makefile.am b/lib/rs/test_recursive/Makefile.am
index e676ccd..ec7d4fc 100644
--- a/lib/rs/test_recursive/Makefile.am
+++ b/lib/rs/test_recursive/Makefile.am
@@ -29,5 +29,8 @@
 	$(CARGO) clean
 	-$(RM) Cargo.lock
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	Cargo.toml
diff --git a/lib/rs/test_recursive/src/Makefile.am b/lib/rs/test_recursive/src/Makefile.am
index 4bfd557..eeb81ab 100644
--- a/lib/rs/test_recursive/src/Makefile.am
+++ b/lib/rs/test_recursive/src/Makefile.am
@@ -29,6 +29,9 @@
 clean-local:
 	-$(RM) vehicles.rs
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	lib.rs \
 	Vehicles.thrift
diff --git a/lib/rs/test_recursive/src/maintenance/Makefile.am b/lib/rs/test_recursive/src/maintenance/Makefile.am
index e2526bd..a1f0ae8 100644
--- a/lib/rs/test_recursive/src/maintenance/Makefile.am
+++ b/lib/rs/test_recursive/src/maintenance/Makefile.am
@@ -29,6 +29,9 @@
 clean-local:
 	-$(RM) maintenance_facility.rs
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	mod.rs \
 	MaintenanceFacility.thrift
diff --git a/lib/rs/test_recursive/src/transit/Makefile.am b/lib/rs/test_recursive/src/transit/Makefile.am
index 908becb..217227a 100644
--- a/lib/rs/test_recursive/src/transit/Makefile.am
+++ b/lib/rs/test_recursive/src/transit/Makefile.am
@@ -34,6 +34,9 @@
 	-$(RM) trains.rs
 	-$(RM) transporters.rs
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	mod.rs \
 	Buses.thrift \
diff --git a/lib/rs/test_recursive/src/transit/light/Makefile.am b/lib/rs/test_recursive/src/transit/light/Makefile.am
index 88fd531..b0e3c76 100644
--- a/lib/rs/test_recursive/src/transit/light/Makefile.am
+++ b/lib/rs/test_recursive/src/transit/light/Makefile.am
@@ -31,6 +31,9 @@
 	-$(RM) light_rail.rs
 	-$(RM) streetcars.rs
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	mod.rs \
 	LightRail.thrift \
diff --git a/lib/rs/test_recursive/src/transit/services/Makefile.am b/lib/rs/test_recursive/src/transit/services/Makefile.am
index 12e9e29..a141c6d 100644
--- a/lib/rs/test_recursive/src/transit/services/Makefile.am
+++ b/lib/rs/test_recursive/src/transit/services/Makefile.am
@@ -29,6 +29,9 @@
 clean-local:
 	-$(RM) city_services.rs
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	mod.rs \
 	CityServices.thrift
diff --git a/lib/swift/Makefile.am b/lib/swift/Makefile.am
index 6a6644a..ac61716 100644
--- a/lib/swift/Makefile.am
+++ b/lib/swift/Makefile.am
@@ -35,6 +35,9 @@
 check-local:
 	swift test
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
 	Package.swift \
 	Sources \
diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index 62ea206..05d71e4 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -48,6 +48,9 @@
 	$(RM) -r $(distdir)/test/build/
 	$(RM) -r $(distdir)/test/gen-*/
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
     coding_standards.md \
     Gruntfile.js \
diff --git a/lib/xml/Makefile.am b/lib/xml/Makefile.am
index bcad6bd..6a1503a 100644
--- a/lib/xml/Makefile.am
+++ b/lib/xml/Makefile.am
@@ -24,6 +24,9 @@
 SUBDIRS += test
 endif
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 EXTRA_DIST = \
   thrift-idl.xsd \
   test
diff --git a/lib/xml/test/Makefile.am b/lib/xml/test/Makefile.am
index bb87a52..16bcfae 100644
--- a/lib/xml/test/Makefile.am
+++ b/lib/xml/test/Makefile.am
@@ -20,6 +20,9 @@
 check:
 	$(ANT) $(ANT_FLAGS) test
 
+distdir:
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
 # Make sure this doesn't fail if ant is not configured.
 clean-local:
 	ANT=$(ANT) ; if test -z "$$ANT" ; then ANT=: ; fi ; \