webcc/Makefile

47 lines
955 B
Makefile

src := content
cache := .cache
www_root := _site
www := $(www_root)/posts
post_index := $(www_root)/posts.html
feed := $(www_root)/feed.xml
post_compiler := src/webcc.ml
builddir := _build/default
POSTCC := $(builddir)/$(patsubst %.ml,%.exe,$(post_compiler))
INDEXCC := $(POSTCC) -i
FEEDCC := $(POSTCC) -a
post-sources := $(shell find $(src)/ -type f)
post-htmls := $(patsubst $(src)/%.md,$(www)/%.html,$(post-sources))
.PHONY: all serve clean $(POSTCC)
all: $(POSTCC) $(post-htmls) $(post_index) $(feed) $(www_root)/static
@echo "\n"
@echo "Copying the ORG-produced files..."
cp -R ~/www/* $(www_root)
$(www)/%.html: $(src)/%.md
mkdir -p $(www)
$(POSTCC) $< -o $@
$(post_index): $(post-sources)
$(INDEXCC) $^ -o $@
$(feed): $(post-sources)
$(FEEDCC) $^ -o $@
$(www_root)/static: static
cp -R static $(www_root)
$(POSTCC): $(post_compiler)
dune build
clean:
rm -fr $(www_root)
serve:
cd $(www_root) && python -m SimpleHTTPServer