aboutsummaryrefslogtreecommitdiff
path: root/course/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'course/Makefile')
-rw-r--r--course/Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/course/Makefile b/course/Makefile
index 309e1b9..d74f830 100644
--- a/course/Makefile
+++ b/course/Makefile
@@ -3,17 +3,21 @@ 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)
+VERBOSE ?= @
+
.DEFAULT_GOAL := all
all: $(SRC_DIRS)
define generateRules
$(1):
- @echo "## Building $$@ ##"
- $(VERBOSE)make -C $$(@) -f $(MAKEFILE_DIR)/common.mk
+ $(VERBOSE)echo "## Building $$@ ##"
+ $(VERBOSE)if [ -d $$(@)/Makefile ]; then\
+ $(MAKE) -C $$(@);\
+ else\
+ $(MAKE) -C $$(@) -f $(MAKEFILE_DIR)/toplevel-build.mk;\
+ fi
endef
$(foreach dir, $(SRC_DIRS), $(eval $(call generateRules, $(dir))))