generate the post index

This commit is contained in:
2020-08-29 12:52:21 +02:00
parent 6234b815f3
commit da996d1b6d
4 changed files with 40 additions and 16 deletions

View File

@@ -8,11 +8,12 @@ post_compiler := src/webcc.ml
builddir := _build/default
POSTCC := $(builddir)/$(patsubst %.ml,%.exe,$(post_compiler))
INDEXCC := $(POSTCC) -i
post-sources := $(shell find $(src)/ -type f)
post-htmls := $(patsubst $(src)/%.md,$(www)/%.html,$(post-sources))
.PHONY: all serve clean $(post_index)
.PHONY: all serve clean $(POSTCC)
all: $(POSTCC) $(post-htmls) $(post_index) $(www_root)/static
cp -R ~/www/* $(www_root)
@@ -23,10 +24,8 @@ $(www):
$(www)/%.html: $(src)/%.md $(www)
$(POSTCC) $< -o $@
# make sure that this target is .PHONY!
$(post_index):
echo hm > $@
$(post_index): $(post-sources)
$(INDEXCC) $^ -o $@
$(www_root)/static:
cp -R static $@
@@ -35,7 +34,6 @@ $(POSTCC): $(post_compiler)
dune build
clean:
rm $(POSTCC)
rm -fr $(www_root)
serve: