Update Makefile for pdf upload and creation

This commit is contained in:
Andre Heinecke 2025-06-12 11:53:23 +02:00
parent 83288b4e39
commit c46608b288
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C
1 changed files with 7 additions and 1 deletions

View File

@ -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