23 lines
429 B
Makefile
23 lines
429 B
Makefile
|
BUILDDIR ?= build
|
||
|
|
||
|
PAGE := $(shell basename $(shell pwd))
|
||
|
|
||
|
PREFIX := $(BUILDDIR)/page/$(PAGE)
|
||
|
|
||
|
MARKDOWN_FILES := $(wildcard *.md)
|
||
|
MARKDOWN_TARGETS = $(patsubst %.md,$(PREFIX)/%.html,$(MARKDOWN_FILES))
|
||
|
|
||
|
all: $(MARKDOWN_TARGETS) index
|
||
|
|
||
|
$(PREFIX)/%.html: %.md
|
||
|
@mkdir -p $(@D)
|
||
|
pandoc $< --to html --output $@ --standalone
|
||
|
|
||
|
$(PREFIX)/index.html: index.html
|
||
|
@mkdir -p $(@D)
|
||
|
cp $< $@
|
||
|
|
||
|
index: $(PREFIX)/index.html
|
||
|
|
||
|
.PHONY: all index
|