]> Lady’s Gitweb - Shushe/commitdiff
Fix magic file generation in non‐default location 0.2.1
authorLady <redacted>
Sat, 6 Jan 2024 02:31:17 +0000 (21:31 -0500)
committerLady <redacted>
Sat, 6 Jan 2024 02:31:17 +0000 (21:31 -0500)
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.

GNUmakefile

index e8624778763b08e1aaefa0ea337ce16a3afaabaf..d1a7f6ec0eff1a6f33d4f118244b3330ba9f133a 100644 (file)
@@ -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)
This page took 0.037954 seconds and 4 git commands to generate.