webcc/Makefile

43 lines
805 B
Makefile
Raw Normal View History

2020-08-28 18:21:05 +02:00
src := content
cache := .cache
2020-08-28 18:24:58 +02:00
www_root := _site
www := $(www_root)/posts
post_index := $(www_root)/posts.html
2020-08-28 18:21:05 +02:00
post_compiler := src/webcc.ml
builddir := _build/default
POSTCC := $(builddir)/$(patsubst %.ml,%.exe,$(post_compiler))
post-sources := $(shell find $(src)/ -type f)
post-htmls := $(patsubst $(src)/%.md,$(www)/%.html,$(post-sources))
2020-08-28 18:24:58 +02:00
.PHONY: all serve clean $(post_index)
all: $(POSTCC) $(post-htmls) $(post_index) $(www_root)/static
2020-08-28 20:22:52 +02:00
cp -R ~/www/* $(www_root)
2020-08-28 18:21:05 +02:00
$(www):
mkdir -p $(www)
$(www)/%.html: $(src)/%.md $(www)
$(POSTCC) $< -o $@
2020-08-28 18:24:58 +02:00
# make sure that this target is .PHONY!
$(post_index):
2020-08-28 20:22:52 +02:00
echo hm > $@
2020-08-28 18:24:58 +02:00
$(www_root)/static:
cp -R static $@
2020-08-28 18:21:05 +02:00
$(POSTCC): $(post_compiler)
dune build
clean:
rm $(POSTCC)
2020-08-28 18:24:58 +02:00
rm -fr $(www_root)
serve:
cd $(www_root) && python -m SimpleHTTPServer