From: Lady Date: Fri, 2 Feb 2024 04:12:35 +0000 (-0500) Subject: Pad colons with spaces on both sides X-Git-Tag: 0.5.0~3 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/d5d9313e299c91913ebc7b24742107068af9a5ce?hp=88823523127972944771746f48bc2838e0317d31 Pad colons with spaces on both sides G·N·U Make recognizes `&:` as indicating grouped targets. Ampersands are allowed in filenames, so it’s best not to place them directly next to the colons. --- diff --git a/GNUmakefile b/GNUmakefile index 4979bfb..9eb4fd4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -362,44 +362,44 @@ override wrapplaintext = $(PRINTF) '%s\n' "$$($(PRINTF) '%b' ',) )) | $(TR) ' |' '\n ' # Destroy build directory and installed files. -uninstall: +uninstall : $(foreach file,$(installablefiles),$(if $(wildcard $(call installed,$(file))),$(silent)$(PRINTF) '%s\n' $(call quote,Removing …)$(newline)$(silent)$(RM) -f $(call quote,$(call installed,$(file)))$(newline),)) # Raise an error when attempting to build any files with recursive dependencies. -$(call compiled,$(recursivefiles)): +$(call compiled,$(recursivefiles)) : @$(PRINTF) '%b\n' $(call quote,\0033[93;41mError:\0033[39;49m `$(call uncompiled,$@)´ has recursive dependencies:\n$(subst |, ,$(subst $(space),$(newline),$(foreach recursive,$(call recursives,$(call uncompiled,$@)),•|$(recursive))))) && false # ─ ¶ Special Targets ───────────────────────────────────────────────── # Perform secondary expansion; this enables pattern rules to determine their prerequisites based on the matched pattern. -.SECONDEXPANSION: ; +.SECONDEXPANSION : ; # Don’t use any implicit rules. -.SUFFIXES: ; +.SUFFIXES : ; # Phony rules; always consider these out·of·date. -.PHONY: all default clean gone info install list uninstall $(call compiled,$(recursivefiles)); +.PHONY : all default clean gone info install list uninstall $(call compiled,$(recursivefiles)) ; ifneq ($(wildcard $(BUILDDIR)/.update-types)$(wildcard $(BUILDDIR)/dependencies)$(wildcard $(BUILDDIR)/destinations),) # Reload this make·file if the dependency graph or output destinations have changed. @@ -407,7 +407,7 @@ ifneq ($(wildcard $(BUILDDIR)/.update-types)$(wildcard $(BUILDDIR)/dependencies) # The dependency graph and output destinations are used to set the values of variables in this make·file, so it’s important to ensure that they are actually up·to·date prior to executing any later rules. # # This recipe only exists after types have been updated or when the dependency graph or destinations file already exists. -$(THISDIR)/GNUmakefile:: $(BUILDDIR)/dependencies $(BUILDDIR)/destinations +$(THISDIR)/GNUmakefile :: $(BUILDDIR)/dependencies $(BUILDDIR)/destinations $(silent)$(TOUCH) $(THISDIR)/GNUmakefile $(silent)$(RM) -f $(BUILDDIR)/.update-types @$(PRINTF) '%b\n' '\0033[1mDependency graph and output destinations updated. Restarting…\0033[22m' @@ -419,7 +419,7 @@ ifeq ($(wildcard $(BUILDDIR)/.update-types),) # These are used to classify source files, so if they have changed then the make·file must be reloaded. # # This recipe sleeps for one second to ensure that files built after the restart have a more current time·stamp. -$(THISDIR)/GNUmakefile:: $(BUILDDIR)/magic.mgc $(BUILDDIR)/parser.xslt +$(THISDIR)/GNUmakefile :: $(BUILDDIR)/magic.mgc $(BUILDDIR)/parser.xslt $(silent)$(TOUCH) $(THISDIR)/GNUmakefile $(silent)$(RM) -f $(call quote,$(BUILDDIR)/dependencies) $(call quote,$(BUILDDIR)/destinations) @$(PRINTF) '%b\n' '\0033[1mMagic file or parsers have updated. Restarting…\0033[22m' @@ -431,7 +431,7 @@ endif # Create symbolic links from the build directory’s store of magic files # to their corresponding sources. -$(call magicfile,$(MAGIC)): $(BUILDDIR)/magic/%: $$(call magicsource,$$@) +$(call magicfile,$(MAGIC)) : $(BUILDDIR)/magic/%: $$(call magicsource,$$@) $(silent)$(call ensuredirectory,$(dir $@)) $(silent)$(LN) -sf $(call quote,$(realpath $<)) $(call quote,$@) @@ -439,14 +439,14 @@ $(call magicfile,$(MAGIC)): $(BUILDDIR)/magic/%: $$(call magicsource,$$@) # # It must be updated if any of the files in the magic directory change. # It ⁜also⁜ should be updated if any of the files in the magic directory are deleted, but this isn’t tracked presently. -$(BUILDDIR)/magic.mgc: $(call magicfile,$(MAGIC)) +$(BUILDDIR)/magic.mgc : $(call magicfile,$(MAGIC)) $(foreach outdated,$(filter-out $^,$(wildcard $(BUILDDIR)/magic/*)),$(silent)$(RM) $(call quote,$(outdated))$(newline)) @$(ECHO) "Compiling new magic…" $(silent)$(call ensuredirectory,$(dir $@)) $(silent)cd $(call quote,$(BUILDDIR)) && $(FILE) -C -m $(call quote,$(realpath $(BUILDDIR)/magic)) # Generate the main parser. -$(BUILDDIR)/parser.catalog: $(PARSERS) +$(BUILDDIR)/parser.catalog : $(PARSERS) @$(ECHO) "Generating catalog of parsers…" $(silent)$(XMLCATALOG) --create --noout $(call quote,$@) $(foreach parser,$(PARSERS),$(silent)$(XMLCATALOG) --add uri $(call quote,$(call id,$(parser),parser)) $(call quote,file:///$(call pathenc,$(abspath $(parser)))) --noout $(call quote,$@)$(newline)) @@ -458,7 +458,7 @@ $(BUILDDIR)/parser.xslt: $(BUILDDIR)/parser.catalog $(THISDIR)/lib/catalog2parse # # Even plain X·M·L files are parsed, because they may contain X·H·T·M·L `