From 64516f9cc4a3ecc3c75b158227d523addc33f386 Mon Sep 17 00:00:00 2001 From: John Ogness Date: Thu, 19 Apr 2018 17:34:10 +0200 Subject: printouts: add Kconfig option to build with printouts If enabled, all selected presentations will also be build using the print templates. These are named the same, but stored in the deploy/printouts subdirectory. Signed-off-by: John Ogness --- Kconfig | 5 +++++ Makefile | 23 +++++++++++++++++++---- modules.mk | 10 +++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Kconfig b/Kconfig index eb11683..cedc98b 100644 --- a/Kconfig +++ b/Kconfig @@ -5,6 +5,11 @@ config BUILD_HANDOUTS help Build papers with or without handouts +config BUILD_PRINTOUTS + bool "Build with printouts" + help + Build print version of slides + source "security/Kconfig" source "basics/cpu-arch/Kconfig" source "basics/lx-trainer/Kconfig" diff --git a/Makefile b/Makefile index 290c142..8ebf841 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,9 @@ CONFIG_OLD := $(CONFIG).old DEPLOY_FOLDER := deploy DEPLOY := $(CONFIG_PATH)/$(DEPLOY_FOLDER) HANDOUT_FOLDER := handouts -HANDOUT :=$(DEPLOY)/$(HANDOUT_FOLDER) +DEPLOYHANDOUT := $(DEPLOY)/$(HANDOUT_FOLDER) +PRINTOUT_FOLDER := printouts +DEPLOYPRINTOUT := $(DEPLOY)/$(PRINTOUT_FOLDER) DEFCONF_FOLDER := $(CURDIR)/configs BUILD_COMMAND := latexmk @@ -65,8 +67,21 @@ PATHS = $(dir $(MAKE_FILES)) export build: $(BUILD_REQ) - $(Q)mkdir -p $(HANDOUT) - $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) $@;) +ifdef CONFIG_BUILD_HANDOUTS + $(Q)mkdir -p $(DEPLOYHANDOUT) + $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) buildhandouts;) +endif +ifdef CONFIG_BUILD_PRINTOUTS + $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) clean_texfiles;) + $(Q)touch .lxformat_print + $(Q)mkdir -p $(DEPLOYPRINTOUT) + $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) buildprintouts;) + $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) clean_texfiles;) + $(Q)rm -f .lxformat_print +endif + $(Q)rm -f .lxformat_print + $(Q)mkdir -p $(DEPLOY) + $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) build;) $(KMCONFIG): cd kconfig-frontends/ && ./configure && make @@ -86,7 +101,7 @@ oldconfig: $(KCONFIG) clean: $(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) $@_texfiles;) - $(Q)rm -rf $(DEPLOY_FOLDER) + $(Q)rm -rf $(DEPLOY_FOLDER) .lxformat_print mrproper: clean $(Q)echo [CLEAN] $@ diff --git a/modules.mk b/modules.mk index f807257..110a1e0 100644 --- a/modules.mk +++ b/modules.mk @@ -9,10 +9,14 @@ TMP_TEXFILES = *.aux *.log *.nav *.toc *.pdf *.snm \ build: $(Q)$(foreach files,$(obj-y),$(MODMK) $(files);) $(Q)$(foreach files,$(obj-y),cp -t $(DEPLOY) $(files);) -ifdef CONFIG_BUILD_HANDOUTS + +buildhandouts: $(Q)$(foreach files,$(obj-handout-y),$(MODMK) $(files);) - $(Q)$(foreach files,$(obj-handout-y),cp -t $(HANDOUT) $(files);) -endif + $(Q)$(foreach files,$(obj-handout-y),cp -t $(DEPLOYHANDOUT) $(files);) + +buildprintouts: + $(Q)$(foreach files,$(obj-y),$(MODMK) $(files);) + $(Q)$(foreach files,$(obj-y),cp -t $(DEPLOYPRINTOUT) $(files);) .FORCE: %.pdf: %.tex .FORCE -- cgit v1.2.3