blog.grace.moe

Source for the blog blog.grace.moe
git clone https://git.grace.moe/blog.grace.moe
Log | Files | Refs

commit f4f733fa02c68dafb539f9867cf5694859dacd54
parent e2fe77857cc6bf5d04546c99e4b53195d68b240d
Author: gracefu <81774659+gracefuu@users.noreply.github.com>
Date:   Thu, 10 Apr 2025 19:27:33 +0800

Don't use .PHONY for pattern rules

Diffstat:
MMakefile | 15+++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile @@ -56,9 +56,6 @@ TMPPATH=.bunny-tmp # Set Make stuff .PHONY: all sync purge rebuild upload clean nothing \ - $(TMPPATH)/contents/%/contents \ - $(TMPPATH)/clean/% $(TMPPATH)/cleanfile/% $(TMPPATH)/cleandir/% \ - $(TMPPATH)/upload/% .SECONDEXPANSION: .SHELLFLAGS:=-eou pipefail -c @@ -103,7 +100,7 @@ upload: $(addprefix $(TMPPATH)/upload/,$(UPLOAD)) clean: $(addprefix $(TMPPATH)/clean/,$(CLEAN)) nothing: -$(TMPPATH)/contents/%/contents: +$(TMPPATH)/contents/%/contents: FORCE # Get dir contents from bunny, and # Delete any files or directories on bunny that don't exist locally mkdir -p '$(@D)' @@ -111,7 +108,7 @@ $(TMPPATH)/contents/%/contents: $(STORAGECMD) '$(STORAGEURL)/$(shell sed 's_^[^/]*/__' <<<'$*')/' >'$@' echo - download '$(shell sed 's_[^/]*/__' <<<'$*')' -$(TMPPATH)/clean/%: $(TMPPATH)/contents/$$(call hash,$$*)/$$*/contents +$(TMPPATH)/clean/%: $(TMPPATH)/contents/$$(call hash,$$*)/$$*/contents FORCE # echo + clean '$(*)' $(MAKE) nothing $$(<'$<' jq -r '"$(TMPPATH)/cleanfile/$(*)/" + (arrays | .[] | select(.IsDirectory == false).ObjectName)') @@ -119,7 +116,7 @@ $(TMPPATH)/clean/%: $(TMPPATH)/contents/$$(call hash,$$*)/$$*/contents (arrays | .[] | select(.IsDirectory == true).ObjectName)') echo - clean '$(*)' -$(TMPPATH)/cleanfile/%: +$(TMPPATH)/cleanfile/%: FORCE # echo + cleanfile '$(*)' if ! [ -f '$(LOCALPATH)/$(*)' ]; then echo Deleting file '$(*)' @@ -128,7 +125,7 @@ $(TMPPATH)/cleanfile/%: fi | tac | tac # echo - cleanfile '$(*)' -$(TMPPATH)/cleandir/%: +$(TMPPATH)/cleandir/%: FORCE # echo + cleandir '$(*)' if ! [ -d '$(LOCALPATH)/$(*)' ]; then echo Deleting dir '$(*)' @@ -137,7 +134,7 @@ $(TMPPATH)/cleandir/%: fi | tac | tac # echo - cleandir '$(*)' -$(TMPPATH)/upload/%: $(TMPPATH)/contents/$$(call hash,$$(*D))/$$(*D)/contents +$(TMPPATH)/upload/%: $(TMPPATH)/contents/$$(call hash,$$(*D))/$$(*D)/contents FORCE # Using dir contents, upload any files that have the wrong hash # echo + upload '$(*)' diff >/dev/null \ @@ -155,6 +152,8 @@ $(TMPPATH)/upload/%: $(TMPPATH)/contents/$$(call hash,$$(*D))/$$(*D)/contents ) | tac |tac echo - upload '$(*)' +FORCE: + .PHONY: install-Mathjax; install-Mathjax: rsync --delete --delete-excluded --exclude '/*svg*.js' --exclude '/*mml*.js' --exclude '/*full*.js' --exclude '/adaptors' -a MathJax/es5/ static/mathjax/