--- magic/Makefile.in.orig	2011-08-03 09:55:56.000000000 -0700
+++ magic/Makefile.in	2011-08-18 16:04:14.000000000 -0700
@@ -201,7 +201,7 @@
 MAGIC_FRAGMENT_BASE = Magdir
 MAGIC_DIR = $(top_srcdir)/magic
 MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
-pkgdata_DATA = magic.mgc
+pkgdata_DATA = magic.mgc magic
 EXTRA_DIST = \
 $(MAGIC_DIR)/Header \
 $(MAGIC_DIR)/Localstuff \
@@ -669,6 +669,17 @@
 	$(FILE_COMPILE) -C -m magic
 	@rm -fr magic
 
+magic: $(EXTRA_DIST) ${MAGIC}
+	for frag in $(EXTRA_DIST); do \
+		if test -f $(srcdir)/$$frag; then \
+			f=$(srcdir)/$$frag; \
+		else \
+			f=$$frag; \
+		fi; \
+		cat $$f; \
+	done >> $@
+
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
