[FE training-materials-updates] makefile: factorize the Makefile generation logic
Maxime Ripard
maxime.ripard at free-electrons.com
Tue Jul 22 18:32:09 CEST 2014
Repository : git://git.free-electrons.com/training-materials.git
On branch : master
Link : http://git.free-electrons.com/training-materials/commit/?id=1b0f9f2be15bce516ef0150cbdcc0caf1613144c
>---------------------------------------------------------------
commit 1b0f9f2be15bce516ef0150cbdcc0caf1613144c
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Tue Jul 22 18:25:22 2014 +0200
makefile: factorize the Makefile generation logic
Up until now, unlike the slides, the labs had a simple switch-like logic to set
the variables and files to use.
Create a common and dynamic version of this by parsing the file we actually
want to parse.
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
>---------------------------------------------------------------
1b0f9f2be15bce516ef0150cbdcc0caf1613144c
Makefile | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/Makefile b/Makefile
index a5929cd..73519b5 100644
--- a/Makefile
+++ b/Makefile
@@ -430,25 +430,12 @@ endif
#
ifdef LABS
+ifeq ($(firstword $(subst -, , $(LABS))),full)
+LABS_TRAINING = $(lastword $(subst -, , $(LABS)))
LABS_HEADER = common/labs-header.tex
+LABS_VARSFILE = common/$(LABS_TRAINING)-labs-vars.tex
+LABS_CHAPTERS = $($(call UPPERCASE, $(LABS_TRAINING))_LABS)
LABS_FOOTER = common/labs-footer.tex
-# Compute the set of chapters to build depending on the name of the
-# PDF file that was requested.
-ifeq ($(LABS),full-kernel)
-LABS_VARSFILE = common/kernel-labs-vars.tex
-LABS_CHAPTERS = $(KERNEL_LABS)
-else ifeq ($(LABS),full-sysdev)
-LABS_VARSFILE = common/sysdev-labs-vars.tex
-LABS_CHAPTERS = $(SYSDEV_LABS)
-else ifeq ($(LABS),full-android)
-LABS_VARSFILE = common/android-labs-vars.tex
-LABS_CHAPTERS = $(ANDROID_LABS)
-else ifeq ($(LABS),full-boottime)
-LABS_VARSFILE = common/boottime-labs-vars.tex
-LABS_CHAPTERS = $(BOOTTIME_LABS)
-else ifeq ($(LABS),full-yocto)
-LABS_VARSFILE = common/yocto-labs-vars.tex
-LABS_CHAPTERS = $(YOCTO_LABS)
else
LABS_VARSFILE = common/single-lab-vars.tex
LABS_CHAPTERS = $(LABS)
More information about the training-materials-updates
mailing list