# input dir, in which .mkd files are

MKD_DIR=./courses
# output dir, in which to place .html files

HTML_DIR=./html

# mkd files to process
MKDS=$(shell find -name '*.mkd' )
# their counter part in html
HTML=$(addsuffix .html, $(addprefix $(HTML_DIR)/, $(basename $(notdir $(MKDS)))))

all: $(HTML_DIR) $(HTML)
  @echo mkds: $(MKDS)
  @echo html: $(HTML)

$(HTML_DIR):
  mkdir -p (HTML_DIR)

$(HTML_DIR)/%.html: $(MKD_DIR)/%.mkd
  @echo $(HEADER) > $@
  @markdownPreprocessor $< | markdown >> $@

# html header
HEADER='<?xml version="1.0" encoding="UTF-8"?>'