summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a4365e7..0199a0b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
markdown := $(wildcard *.mdwn)
-hypertext = $(markdown:%.mdwn=%.html)
+hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html))
all: $(hypertext)
-%.html: %.mdwn
+%.html %/index.html: %.mdwn
+ $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@))
pandoc -f markdown -t html -o $@ $<
clean:
- rm -f *.html
+ find -type f -name '*.html' -delete
+ find -type d -empty -delete
.PHONY: all clean