Update Makefile for pdf upload and creation
This commit is contained in:
parent
83288b4e39
commit
c46608b288
8
Makefile
8
Makefile
|
@ -6,9 +6,11 @@ PANDOC = pandoc
|
|||
SRC_DIR = src
|
||||
STATIC_DIR = static
|
||||
STAGING_DIR = staging
|
||||
PAPER_DIR = $(SRC_DIR)/paper
|
||||
TEMPLATE = pandoc-template.html
|
||||
|
||||
MD_FILES := $(wildcard $(SRC_DIR)/*.md)
|
||||
TEX_FILES := $(wildcard $(PAPER_DIR)/*.tex)
|
||||
HTML_FILES := $(patsubst $(SRC_DIR)/%.md,$(STAGING_DIR)/%.html,$(MD_FILES))
|
||||
|
||||
# Default target
|
||||
|
@ -22,6 +24,10 @@ $(STAGING_DIR):
|
|||
mkdir -p $(STAGING_DIR)
|
||||
|
||||
# Convert markdown to HTML
|
||||
$(STAGING_DIR)/philosophy.pdf: $(TEX_FILES) $(PAPER_DIR)/compile.sh | $(STAGING_DIR)
|
||||
( cd $(SRC_DIR)/paper && ./compile.sh )
|
||||
cp $(PAPER_DIR)/main_document.pdf $@
|
||||
|
||||
$(STAGING_DIR)/%.html: $(SRC_DIR)/%.md $(TEMPLATE) | $(STAGING_DIR)
|
||||
$(PANDOC) \
|
||||
--from markdown \
|
||||
|
@ -34,7 +40,7 @@ $(STAGING_DIR)/%.html: $(SRC_DIR)/%.md $(TEMPLATE) | $(STAGING_DIR)
|
|||
$<
|
||||
|
||||
# Copy static files
|
||||
copy-static: | $(STAGING_DIR)
|
||||
copy-static: $(STAGING_DIR)/philosophy.pdf | $(STAGING_DIR)
|
||||
rsync -avz --exclude='.*' --delete $(STATIC_DIR)/* $(STAGING_DIR)/
|
||||
|
||||
# Clean staging directory
|
||||
|
|
Loading…
Reference in New Issue