From: Lady Date: Sat, 6 Jan 2024 02:31:17 +0000 (-0500) Subject: Fix magic file generation in non‐default location X-Git-Tag: 0.2.1^0 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/3d56020bffefecf41aceb500f74de4547e35b842?ds=sidebyside;hp=4a0e5671fe44e12a563c4b8403b87db66566f005 Fix magic file generation in non‐default location As it turns out, `file -C` always creates a file named `magic.mgc` in the current working directory. Navigate to the build directory before calling it instead of moving the file after. --- diff --git a/GNUmakefile b/GNUmakefile index e862477..d1a7f6e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -378,8 +378,7 @@ endif $(BUILDDIR)/magic.mgc: $(wildcard $(MAGICDIR)/*) @$(ECHO) "Compiling new magic…" $(silent)$(call ensuredirectory,$(dir $@)) - $(silent)$(FILE) -C -m $(call quote,$(MAGICDIR)) - $(silent)$(MV) $(call quote,$(MAGICDIR).mgc) $(call quote,$(BUILDDIR)/magic.mgc) + $(silent)cd $(call quote,$(BUILDDIR)) && $(FILE) -C -m $(call quote,$(realpath $(MAGICDIR))) # Generate the main parser. $(BUILDDIR)/parser.catalog: $(PARSERS)