|
@@ -5,7 +5,7 @@ STYLE=chmduquesne
|
|
|
|
|
|
all: html pdf docx rtf
|
|
|
|
|
|
-pdf: dir
|
|
|
+pdf: init
|
|
|
for f in $(IN_DIR)/*.md; do \
|
|
|
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
|
|
|
echo $$FILE_NAME.pdf; \
|
|
@@ -17,7 +17,7 @@ pdf: dir
|
|
|
--result=$(OUT_DIR)/$$FILE_NAME.pdf > $(OUT_DIR)/context_$$FILE_NAME.log 2>&1; \
|
|
|
done
|
|
|
|
|
|
-html: dir
|
|
|
+html: init
|
|
|
for f in $(IN_DIR)/*.md; do \
|
|
|
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
|
|
|
echo $$FILE_NAME.html; \
|
|
@@ -26,22 +26,32 @@ html: dir
|
|
|
--output $(OUT_DIR)/$$FILE_NAME.html $$f; \
|
|
|
done
|
|
|
|
|
|
-docx: dir
|
|
|
+docx: init
|
|
|
for f in $(IN_DIR)/*.md; do \
|
|
|
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
|
|
|
echo $$FILE_NAME.docx; \
|
|
|
- pandoc --standalone --smart $$f --output $(OUT_DIR)/$$FILE_NAME.docx; \
|
|
|
+ pandoc --standalone $$SMART $$f --output $(OUT_DIR)/$$FILE_NAME.docx; \
|
|
|
done
|
|
|
|
|
|
-rtf: dir
|
|
|
+rtf: init
|
|
|
for f in $(IN_DIR)/*.md; do \
|
|
|
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
|
|
|
echo $$FILE_NAME.rtf; \
|
|
|
- pandoc --standalone --smart $$f --output $(OUT_DIR)/$$FILE_NAME.rtf; \
|
|
|
+ pandoc --standalone $$SMART $$f --output $(OUT_DIR)/$$FILE_NAME.rtf; \
|
|
|
done
|
|
|
|
|
|
+init: dir version
|
|
|
+
|
|
|
dir:
|
|
|
mkdir -p $(OUT_DIR)
|
|
|
|
|
|
+version:
|
|
|
+ PANDOC_VERSION=`pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1`; \
|
|
|
+ if [ "$$PANDOC_VERSION" -eq "2" ]; then \
|
|
|
+ SMART=-smart; \
|
|
|
+ else \
|
|
|
+ SMART=--smart; \
|
|
|
+ fi \
|
|
|
+
|
|
|
clean:
|
|
|
rm -f $(OUT_DIR)/*
|