diff --git a/Makefile b/Makefile
index 2ec924adae3b4f44be7d9c4614201ab72f51782b..4bdd337dd2c1d62e036146a281e239ea7d855855 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,6 @@
 # Makefile for creating the source tarball
-# The parent directory must be called dynare-4.x.y
-# WARNING: this makefile will destroy all your .svn subdirectories!
 
-DYNAREBASE=$(shell basename $(shell pwd))
+DYNAREBASE=dynare-4.0.4
 
 srctarball:
 	make -C preprocessor clean
@@ -10,10 +8,4 @@ srctarball:
 	rm -f matlab/dynare_m matlab/dynare_m.exe
 	rm -f mex/2007a/* mex/2007b/* mex/octave/*.mex
 	rm -f windows/*.exe
-	find -name .svn | xargs rm -rf
-	find -type f -name '*~' | xargs rm -f
-	cd ..; tar cvzf $(DYNAREBASE).tgz \
-		$(DYNAREBASE)/preprocessor \
-	  $(DYNAREBASE)/matlab \
-    $(DYNAREBASE)/doc \
-    $(DYNAREBASE)/mex
+	tar cvzf ../$(DYNAREBASE).tar.gz --transform 's,^\./,$(DYNAREBASE)/,' --exclude=debian --exclude='*~' --exclude-vcs .