SRC = ./slides/*.md
TEMP_DIR = ./work/
TEMP_MD = $(TEMP_DIR)/work.md
OUT_DIR = ./out/
INCLUDE_DIR = ./media/

all: $(OUT_DIR)/index.html

$(OUT_DIR)/index.html: $(TEMP_MD)
	mkdir -p $(OUT_DIR)
	mdslides $(TEMP_MD) --include $(INCLUDE_DIR) --output $(OUT_DIR)

$(TEMP_MD): $(SRC)
	mkdir -p $(TEMP_DIR)
	cat $(SRC) > $(TEMP_MD)

preview: $(OUT_DIR)/index.html
	xdg-open $(OUT_DIR)/index.html

clean:
	rm -rf $(OUT_DIR)/
	rm -rf $(TEMP_DIR)/