* builds/toplevel.mk (version): Protect against `distclean' target.
diff --git a/ChangeLog b/ChangeLog
index dd84b19..0cd1e63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-12-10 Werner Lemberg <wl@gnu.org>
+
+ * builds/toplevel.mk (version): Protect against `distclean' target.
+
2006-12-09 Werner Lemberg <wl@gnu.org>
* builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat'
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index f8306a0..d5ca530 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -163,7 +163,8 @@ include $(TOP_DIR)/builds/modules.mk
# Not to be run by a normal user -- there are no attempts to make it
# generic.
-ifneq ($(findstring dist,$(MAKECMDGOALS)),)
+# we check for `dist', not `distclean'
+ifneq ($(findstring distx,$(MAKECMDGOALS)x),)
FT_H := include/freetype/freetype.h
major := $(shell sed -n 's/.*FREETYPE_MAJOR.*\([0-9]\+\)/\1/p' < $(FT_H))