X-Git-Url: https://git.ladys.computer/Shushe/blobdiff_plain/af35f96d77cd8ae1b6fb5332509ba115f07fefb5..15648b660cd14e2834629ad52b65ceb313362c9b:/GNUmakefile?ds=inline diff --git a/GNUmakefile b/GNUmakefile index 3161ecd..c1b34fc 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023, 2024 Lady +# SPDX-FileCopyrightText: 2023, 2024, 2025 Lady # SPDX-License-Identifier: MPL-2.0 SHELL = /bin/sh @@ -275,7 +275,7 @@ export LC_ALL # Posix timezone information. TZ := UTC0 -export UTC0 +export TZ # The default target for this makefile. .DEFAULT_GOAL := all @@ -354,7 +354,7 @@ override notbuilding := $(and $(filter help clean,$(MAKECMDGOALS)),$(call not,$( # If `$(notbuilding)´ is non·empty, this variable produces no result to avoid unnecessary work. # # ☡ This variable creates at least one subshell every time it is computed. -override diffprereqs = $(if $(notbuilding),,$(and $(subst $(shell $(CAT) $(call quote,$(BUILDDIR)/lastprereqs/$1) 2>>/dev/null || :),,$2),$(shell $(call ensuredirectory,$(BUILDDIR)/lastprereqs) && $(PRINTF) '%s\n' $(call quote,$2) >|$(BUILDDIR)/lastprereqs/$1),)$2 $(BUILDDIR)/lastprereqs/$1) +override diffprereqs = $(if $(notbuilding),,$(and $(or $(wildcard $(BUILDDIR)/lastprereqs/$1),$(shell $(TOUCH) $(call quote,$(BUILDDIR)/lastprereqs/$1)),1),$(subst $(shell $(CAT) $(call quote,$(BUILDDIR)/lastprereqs/$1) 2>>/dev/null || :),,$2),$(shell $(call ensuredirectory,$(BUILDDIR)/lastprereqs) && $(PRINTF) '%s\n' $(call quote,$2) >|$(call quote,$(BUILDDIR)/lastprereqs/$1)),)$2 $(BUILDDIR)/lastprereqs/$1) # ─ ¶ Recipe Variable Definitions ───────────────────────────────────── @@ -575,7 +575,7 @@ listout : # Destroy installed files. 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),)) + $(foreach file,$(installablefiles),$(if $(wildcard $(call installed,$(file))),$(silent)$(PRINTF) '%s\n' $(call quote,Removing …)$(newline)$(silent)$(RM) -f -R $(call quote,$(call installed,$(file)))$(newline),)) # Raise an error when attempting to build any files with recursive dependencies. $(call built,$(recursivefiles)) : @@ -746,7 +746,7 @@ else ifeq ($(MODE),urn:fdc:ladys.computer:20231231:Shu1She4:mode:initial) # ─ ¶ Non‐Recipe Variable Definitions ───────────────────────────────── # Non·empty if this is a two‐step build. -override twostep := $(if $(DATADIR),$(shell if $(TEST) -d $(call quote,$(DATADIR)); then $(PRINTF) '%s\n' '1'; fi),) +override twostep := $(if $(DATADIR),$(call not,$(shell for dir in $(foreach dir,$(DATADIR),$(call quote,$(dir))); do if $(TEST) '!' -d "$$dir"; then $(PRINTF) '%s\n' '0'; fi; done)),) # Pair each source magic file with its location in the build directory. override magicpair := $(foreach magicfile,$(MAGIC),$(magicfile)|$(BUILDDIR)/magic/$(call namehash,$(magicfile))) @@ -807,7 +807,7 @@ clean : ifneq ($(twostep),) # Build the data and remove outdated data files. data : $(BUILDDIR)/data.out - $(silent)$(FIND) $(call quote,$(BUILDDIR)/data/public) '!' -exec $(GREP) -F -q -x '{}' $(call quote,$<) ';' -a '(' -type d -o -print ')' | $(xargsmultiquote) | $(XARGS) -E '' $(RM) + $(silent)$(FIND) $(call quote,$(BUILDDIR)/data/public) '!' '(' -exec $(GREP) -F -q -x '{}' $(call quote,$<) ';' -a -prune ')' -a '(' -type d -o -print ')' | $(xargsmultiquote) | $(XARGS) -E '' $(RM) endif # Provide help.