From 398874a3dd76193122472cd015bd7d6cd0b9300b Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Tue, 15 Oct 2024 02:50:55 +0200 Subject: commit mvp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 makefile (limited to 'makefile') diff --git a/makefile b/makefile new file mode 100644 index 0000000..5a5e6fd --- /dev/null +++ b/makefile @@ -0,0 +1,35 @@ +all: run + +# content +PANDOC ?= pandoc +htm_SRC := $(shell find src/inc/ -name '*.htm' -print) +md_SRC := $(shell find src/inc/ -name '*.md' -print) +SRC := $(htm_SRC) $(md_SRC:%.md=%.htm) +DST := site + +# see https://pandoc.org/MANUAL.html#pandocs-markdown +%.htm: %.md + $(PANDOC) --from=markdown --to=html --output $@ $< + +# generator +ZIG ?= zig +gen_SRC := src/main.zig +gen_BIN := bin/gen + +$(gen_BIN): $(gen_SRC) + $(ZIG) build-exe -lc -O Debug -femit-bin=$@ $< + + +clean: + @ rm -f $(DST)/* bin/* $(md_SRC:%.md=%.htm) + +run: $(gen_BIN) $(SRC) + @ mkdir -p $(DST) && $(gen_BIN) + +watch: + @ find . -print | entr -nc -- $(MAKE) + +serve: + @ caddy file-server -r . -l :1414 + +.PHONY: all clean serve watch -- cgit 1.4.1