--- magic/Makefile.am.orig	2024-10-06 12:04:42.000000000 -0500
+++ magic/Makefile.am	2024-12-02 02:41:40.000000000 -0600
@@ -5,7 +5,7 @@
 MAGIC_DIR = $(top_srcdir)/magic
 MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
 
-pkgdata_DATA = magic.mgc
+pkgdata_DATA = magic.mgc magic
 
 MAGIC_FRAGMENTS = \
 $(MAGIC_DIR)/Header \
@@ -388,3 +388,14 @@
 	  fi)
 	$(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 >> $@
+
