diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-16 22:03:47 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-16 22:03:47 +0100 |
| commit | f83df38d5e19dfceb0962a09a46e29c1b103fc4e (patch) | |
| tree | a44adbf76cd53025251d6162e6e85458279bb2c9 /http/Makefile | |
| parent | dcd563fdc7cc7d6fbac413e1eb78b7f3455bd94b (diff) | |
out rule is incremental
Diffstat (limited to 'http/Makefile')
| -rw-r--r-- | http/Makefile | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/http/Makefile b/http/Makefile index 11aa4a5..cc908d9 100644 --- a/http/Makefile +++ b/http/Makefile @@ -28,8 +28,30 @@ prune_blog: fi; \ done -out: microlog blog $(shell find src -type f) $(shell find share -type f) $(shell find bin) - ./bin/mkws https://joeac.net +src_files := $(filter-out %.args,$(wildcard src/*.upp*)) +src_files += $(filter-out %.args,$(wildcard src/**/*.upp*)) +src_files_ext := $(suffix $(src_files)) +out_files_ext := $(src_files_ext:.upp%=%) +layout_files := $(wildcard share/layouts/*.layout.upp*) +layouts := $(notdir $(basename $(basename $(layout_files)))) +out_files := $(addprefix out/,$(src_files:src/%=%)) +remove_layout_from_out_files = out_files := $$(subst $(1).upp,.,$$(out_files)) +$(foreach layout,$(layouts),$(eval $(call remove_layout_from_out_files,.$(layout)))) +$(eval $(call remove_layout_from_out_files,)) + +define out_rule_for_ext_and_layout = +out/%.$(1): src/%$(2).upp$(1) + ./bin/mkws https://joeac.net "$$$$(realpath $$<)" +endef + +$(foreach ext,$(sort $(out_files_ext)),\ + $(eval $(call out_rule_for_ext_and_layout,$(ext),))) +$(foreach layout,$(layouts),\ + $(foreach ext,$(sort $(out_files_ext)),\ + $(eval $(call out_rule_for_ext_and_layout,$(ext),.$(layout))))) + +.PHONY: out +out: $(out_files) .PHONY: microlog microlog: prune_microlog $(patsubst blogs/microlog/%.gmi,src/microlog/%.microlog.upphtml,$(wildcard blogs/microlog/*.gmi)) |
