aboutsummaryrefslogtreecommitdiff
path: root/course/Makefile
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-02-12 15:45:23 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2024-02-12 17:07:12 +0100
commit638706371ba3e4091fafb9da7509b51b523cc36d (patch)
treebb1e347679d54bf239e40cd38431dd992fa3e55b /course/Makefile
parent9ff80cb28ac76cbccc5fd927b3fa14c999d5599c (diff)
downloadSOS-638706371ba3e4091fafb9da7509b51b523cc36d.tar.gz
SOS-638706371ba3e4091fafb9da7509b51b523cc36d.zip
add course material build tooling
Diffstat (limited to 'course/Makefile')
-rw-r--r--course/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/course/Makefile b/course/Makefile
new file mode 100644
index 0000000..309e1b9
--- /dev/null
+++ b/course/Makefile
@@ -0,0 +1,21 @@
+# The full path to the Makefile
+MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
+# The path to the directory of the Makefile
+MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
+
+include $(MAKEFILE_DIR)/common.mk
+
+SRC_DIRS := $(shell find "(" -not -path "./pandoc/*" -a "(" -name "*.md" -o -name "*.tex" ")" -printf "%h\n" ")" | uniq)
+
+.DEFAULT_GOAL := all
+all: $(SRC_DIRS)
+
+define generateRules
+$(1):
+ @echo "## Building $$@ ##"
+ $(VERBOSE)make -C $$(@) -f $(MAKEFILE_DIR)/common.mk
+endef
+
+$(foreach dir, $(SRC_DIRS), $(eval $(call generateRules, $(dir))))
+
+.PHONY: $(SRC_DIRS)