summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-06-16 21:57:05 +0100
committerJoe Carstairs <me@joeac.net>2026-06-16 22:02:46 +0100
commit84ea47f08db267bcf6d4255f04c9fb0ec70bf1bc (patch)
tree5ca817db451d81c462f8170ae01ae057db9b4db7
parentb79a0873dd3223490cf6aaf5b4b0cf9d2c4a420f (diff)
copying public happens in Makefile, not mkws
-rw-r--r--http/Makefile6
-rwxr-xr-xhttp/bin/mkws9
2 files changed, 6 insertions, 9 deletions
diff --git a/http/Makefile b/http/Makefile
index 7b504c2..eea98e8 100644
--- a/http/Makefile
+++ b/http/Makefile
@@ -41,6 +41,12 @@ blog: prune_blog $(patsubst blogs/blog/%.gmi,src/blog/%.blog.upphtml,$(wildcard
src/blog/%.blog.upphtml: blogs/blog/%.gmi bin/blog bin/gmi2upphtml bin/cut_longlog_meta
./bin/blog -i blog -l blog -p 'cut_longlog_meta | gmi2upphtml' -a extract_longlog_meta -f $*.gmi
+.PHONY: public
+public: $(subst public/,out/,$(shell find public/ -type f))
+
+out/%: public/%
+ mkdir -p $(dir $@) && cp $< $@
+
.PHONY: clean
clean:
rm -rf out src/microlog src/blog
diff --git a/http/bin/mkws b/http/bin/mkws
index 78b2473..228109c 100755
--- a/http/bin/mkws
+++ b/http/bin/mkws
@@ -15,15 +15,6 @@ export LAYOUTS="$(realpath share/layouts)"
export DEFAULT_LAYOUT="${LAYOUTS}/default.layout.upphtml"
export OUT="$(realpath out)"
-if [ -d "${PUBLIC}" ]
-then
- echo "Copying from $(basename "${PUBLIC}") into $(basename "${OUT}")"
- cp -r "${PUBLIC}" "${OUT}"
-else
- echo "No $(basename "${PUBLIC}") folder found"
- mkdir -p "${OUT}"
-fi
-
if ! test -f "${SRC}"/index.upphtml
then
>&2 printf "no index.upphtml file found\\n"