rebrand: hdm slides → uni slides (dhbw + hdm), make-targets mit hdm-/dhbw- prefix, dhbw_deploy_path typo fix

This commit is contained in:
2026-05-04 20:05:50 +02:00
parent 841a7ced76
commit 3c938b4b1c
4 changed files with 192 additions and 132 deletions

218
Makefile
View File

@@ -1,70 +1,93 @@
# HdM Slides - Unified Makefile
# Supports multiple courses: 223015b (Dateiformate) and 223015c (Internettechnik)
# Uni Slides - Unified Makefile
# DHBW + HdM courses
.PHONY: help dev dev-b dev-c build build-b build-c pdf html klausur clean install deploy qr optimize-images
.PHONY: help dev hdm-dev hdm-dev-b hdm-dev-c dhbw-dev \
build hdm-build hdm-build-b hdm-build-c dhbw-build \
html hdm-html hdm-html-b hdm-html-c \
pdf hdm-pdf hdm-pdf-b hdm-pdf-c \
klausur hdm-klausur hdm-klausur-b hdm-klausur-c \
qr qr-slides optimize-images clean install deploy deploy-index
# Course configuration
COURSES = 223015b 223015c
COURSE_HDM = 223015b 223015c
COURSE_DHBW = dhbw
SLIDES_DIR = slides
# Course-specific settings
# HdM course settings
223015b_NAME = Dateiformate, Schnittstellen, Speichermedien
223015b_KAPITEL = 00-intro 01-grundlagen-text-audio 02-bild-audio-video 03-speichermedien-schnittstellen 04-distribution-apis-zukunft 05-vertiefung-offene-fragen klausurfolien klausurfragen
223015b_DEPLOY_PATH = /home/tengo/html/hdm/223015b
223015c_NAME = Internettechnologien
223015c_KAPITEL = 01-geschichte-grundlagen-html 02-netzwerke-protokolle-css 03-interaktivitaet-javascript klausurfolien klausurfragen
223015c_DEPLOY_PATH = /home/tengo/html/hdm/223015c
# DHBW course settings
dhbw_NAME = Technik I Grundlagen IT
dhbw_KAPITEL = 01_web_eng 02_css_extended 03_nodejs_basics 04_nodejs_advanced
# Deploy paths
HDM_DEPLOY_PATH = /home/tengo/html/hdm
DHBW_DEPLOY_PATH = /home/tengo/html/dhbw
DEPLOY_HOST = tengo@tuttle.uberspace.de
# Default target
help:
@echo "HdM Slides - Unified Build System"
@echo "Uni Slides - DHBW + HdM Build System"
@echo ""
@echo "Courses:"
@echo "HdM Courses:"
@echo " 223015b - Dateiformate, Schnittstellen, Speichermedien"
@echo " 223015c - Internettechnologien"
@echo ""
@echo "Development:"
@echo " make dev - Marp live server all courses (port 1312, HMR)"
@echo " make dev-b - Marp live server 223015b (port 1313, HMR)"
@echo " make dev-c - Marp live server 223015c (port 1314, HMR)"
@echo "DHBW Courses:"
@echo " dhbw - Technik I Grundlagen IT"
@echo ""
@echo "Build:"
@echo " make build - Build all courses"
@echo " make build-b - Build 223015b only"
@echo " make build-c - Build 223015c only"
@echo " make pdf - Export all to PDF"
@echo " make html - Export all to HTML"
@echo " make klausur - Extract klausurfolien slides"
@echo "Development:"
@echo " make hdm-dev - Live server all HdM courses (port 1312, HMR)"
@echo " make hdm-dev-b - 223015b only (port 1313, HMR)"
@echo " make hdm-dev-c - 223015c only (port 1314, HMR)"
@echo " make dhbw-dev - DHBW live server (port 1315, HMR)"
@echo ""
@echo "Build (HdM):"
@echo " make hdm-build - Build all HdM courses"
@echo " make hdm-build-b - Build 223015b only"
@echo " make hdm-build-c - Build 223015c only"
@echo " make hdm-html - HTML only all HdM"
@echo " make hdm-pdf - PDF only all HdM"
@echo ""
@echo "Build (DHBW):"
@echo " make dhbw-build - Build DHBW course"
@echo ""
@echo "Klausur (HdM):"
@echo " make hdm-klausur - Extract klausurfolien all HdM"
@echo " make hdm-klausur-b - 223015b only"
@echo " make hdm-klausur-c - 223015c only"
@echo ""
@echo "Tools:"
@echo " make qr URL=... - Generate QR code for URL"
@echo " make qr URL=... - Generate QR code"
@echo " make qr-slides COURSE=223015b - QR for course URL"
@echo " make optimize-images COURSE=223015b - Resize images"
@echo ""
@echo "Deploy:"
@echo " make deploy - Deploy all courses"
@echo " make deploy-b - Deploy 223015b only"
@echo " make deploy-c - Deploy 223015c only"
@echo " make deploy - Deploy all courses"
@echo " make hdm-deploy - Deploy all HdM courses"
@echo " make dhbw-deploy - Deploy DHBW course"
@echo ""
@echo "Other:"
@echo " make clean - Remove generated files"
@echo " make install - Install dependencies"
@echo " make clean - Remove generated files"
# Ensure build directories exist
build/.exists:
@mkdir -p build/223015b build/223015c
@mkdir -p build/223015b build/223015c build/dhbw
@touch $@
# Development server (Marp live server with HMR)
dev:
# Development servers (HdM)
hdm-dev:
@./scripts/dev-server.sh
dev-b:
hdm-dev-b:
@./scripts/dev-server.sh 223015b 1313
dev-c:
hdm-dev-c:
@./scripts/dev-server.sh 223015c 1314
dev-kill:
@@ -72,8 +95,12 @@ dev-kill:
@-fuser -k 1313/tcp 2>/dev/null || true
@-fuser -k 1314/tcp 2>/dev/null || true
# Build functions
define build_course
# DHBW dev (using HdM dev-server for now)
dhbw-dev:
@./scripts/dev-server.sh dhbw 1315
# HdM build functions
define hdm_build_course
@echo "Building $(1)..."
@mkdir -p build/$(1)
@cp -r $(SLIDES_DIR)/$(1)/assets build/$(1)/ 2>/dev/null || true
@@ -88,17 +115,35 @@ define build_course
@./scripts/generate-index.sh $(1) build/$(1)
endef
build-b: build/.exists
$(call build_course,223015b)
hdm-build-b: build/.exists
$(call hdm_build_course,223015b)
build-c: build/.exists
$(call build_course,223015c)
hdm-build-c: build/.exists
$(call hdm_build_course,223015c)
build: build-b build-c
@echo "All courses built!"
hdm-build: hdm-build-b hdm-build-c
@echo "All HdM courses built!"
# HTML only builds
define html_course
# DHBW build function
define dhbw_build_course
@echo "Building $(1)..."
@mkdir -p build/$(1)
@cp -r $(SLIDES_DIR)/$(1)/assets build/$(1)/ 2>/dev/null || true
@for f in $($(1)_KAPITEL); do \
if [ -f "$(SLIDES_DIR)/$(1)/$$f.md" ]; then \
echo " Building $$f..."; \
npx @marp-team/marp-cli $(SLIDES_DIR)/$(1)/$$f.md -o build/$(1)/$$f.html; \
npx @marp-team/marp-cli $(SLIDES_DIR)/$(1)/$$f.md --pdf --allow-local-files -o build/$(1)/$$f.pdf; \
fi \
done
@./scripts/generate-index.sh $(1) build/$(1)
endef
dhbw-build: build/.exists
$(call dhbw_build_course,dhbw)
# HdM HTML only
define hdm_html_course
@echo "Building HTML for $(1)..."
@mkdir -p build/$(1)
@cp -r $(SLIDES_DIR)/$(1)/assets build/$(1)/ 2>/dev/null || true
@@ -112,16 +157,16 @@ define html_course
@./scripts/generate-index.sh $(1) build/$(1)
endef
html-b: build/.exists
$(call html_course,223015b)
hdm-html-b: build/.exists
$(call hdm_html_course,223015b)
html-c: build/.exists
$(call html_course,223015c)
hdm-html-c: build/.exists
$(call hdm_html_course,223015c)
html: html-b html-c
hdm-html: hdm-html-b hdm-html-c
# PDF only builds
define pdf_course
# HdM PDF only
define hdm_pdf_course
@echo "Building PDFs for $(1)..."
@mkdir -p build/$(1)
@for f in $($(1)_KAPITEL); do \
@@ -132,25 +177,32 @@ define pdf_course
done
endef
pdf-b: build/.exists
$(call pdf_course,223015b)
hdm-pdf-b: build/.exists
$(call hdm_pdf_course,223015b)
pdf-c: build/.exists
$(call pdf_course,223015c)
hdm-pdf-c: build/.exists
$(call hdm_pdf_course,223015c)
pdf: pdf-b pdf-c
hdm-pdf: hdm-pdf-b hdm-pdf-c
# Klausur slide extraction
klausur-b:
# Legacy aliases (no prefix)
build: hdm-build
html: hdm-html
pdf: hdm-pdf
# Klausur extraction (HdM)
hdm-klausur-b:
@./scripts/extract-klausur.sh 223015b
klausur-c:
hdm-klausur-c:
@./scripts/extract-klausur.sh 223015c
klausur: klausur-b klausur-c
@echo "Klausurfolien slides extracted for all courses!"
hdm-klausur: hdm-klausur-b hdm-klausur-c
@echo "Klausurfolien slides extracted for all HdM courses!"
# QR Code generation (uses nix-shell)
klausur: hdm-klausur
# QR Code generation
qr:
ifndef URL
@echo "Usage: make qr URL=https://example.com"
@@ -160,7 +212,6 @@ else
@echo "Generated: $(or $(OUTPUT),qr-code.png)"
endif
# QR code for a slide deck URL
qr-slides:
ifndef COURSE
@echo "Usage: make qr-slides COURSE=223015b"
@@ -183,38 +234,51 @@ else
@echo "Done! Originals in assets-original/"
endif
# Root index for /hdm/
HDM_DEPLOY_PATH = /home/tengo/html/hdm
# Root index
build-index: build/.exists
@echo "Building root index..."
@mkdir -p build
@./scripts/generate-root-index.sh
# Deploy
define deploy_course
# Deploy (HdM)
define hdm_deploy_course
@echo "Deploying $(1)..."
scp build/$(1)/*.html $(DEPLOY_HOST):$($(1)_DEPLOY_PATH)/
scp build/$(1)/*.pdf $(DEPLOY_HOST):$($(1)_DEPLOY_PATH)/ 2>/dev/null || true
scp build/$(1)/*.svg $(DEPLOY_HOST):$($(1)_DEPLOY_PATH)/ 2>/dev/null || true
scp -r build/$(1)/assets/ $(DEPLOY_HOST):$($(1)_DEPLOY_PATH)/
scp -r build/$(1)/materials/ $(DEPLOY_HOST):$($(1)_DEPLOY_PATH)/ 2>/dev/null || true
scp build/$(1)/*.html $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/$(1)/
scp build/$(1)/*.pdf $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
scp build/$(1)/*.svg $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
scp -r build/$(1)/assets/ $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
scp -r build/$(1)/materials/ $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
@echo "$(1) deployed!"
endef
deploy-b: build-b
$(call deploy_course,223015b)
hdm-deploy-b: hdm-build-b
$(call hdm_deploy_course,223015b)
deploy-c: build-c
$(call deploy_course,223015c)
hdm-deploy-c: hdm-build-c
$(call hdm_deploy_course,223015c)
hdm-deploy: hdm-build hdm-deploy-b hdm-deploy-c
@echo "All HdM courses deployed!"
# Deploy (DHBW)
define dhbw_deploy_course
@echo "Deploying $(1)..."
scp build/$(1)/*.html $(DEPLOY_HOST):$(DHBW_DEPLOY_PATH)/$(1)/
scp build/$(1)/*.pdf $(DEPLOY_HOST):$(DHBW_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
scp build/$(1)/*.svg $(DEPLOY_HOST):$(DHBW_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
scp -r build/$(1)/assets/ $(DEPLOY_HOST):$(DHBW_DEPLOY_PATH)/$(1)/ 2>/dev/null || true
@echo "$(1) deployed!"
endef
dhbw-deploy: dhbw-build
$(call dhbw_deploy_course,dhbw)
deploy-index: build-index
@echo "Deploying root index..."
scp build/index.html $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/
scp build/qr-root.svg $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/ 2>/dev/null || true
scp build/index.html $(DEPLOY_HOST):$(HDM_DEPLOY_PATH)/ 2>/dev/null || true
@echo "Root index deployed!"
deploy: build-index deploy-b deploy-c deploy-index
deploy: build-index hdm-deploy dhbw-deploy deploy-index
@echo "All courses deployed!"
# Clean