>From 4ce174f3c72367fed945fb4448e294d205b8d88a Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiysw@xxxxxxxxx> Date: Tue, 3 May 2016 00:01:16 +0900 Subject: [RFT PATCH 5/5] Make default target of Makefile overridable This commit adds a conditional assignment in Makefile so that the default target can be overridden by an environment variable. If you have the environment vairable "PERFBOOK_DEFAULT" set, its value will be regarded as the default target. Otherwise, perfbook.pdf is the default as before. This commit also updates FAQ.txt to add explanation of the environment variable. Signed-off-by: Akira Yokosawa <akiysw@xxxxxxxxx> --- FAQ.txt | 8 ++++++++ Makefile | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/FAQ.txt b/FAQ.txt index 1a1c589..e1d7dd6 100644 --- a/FAQ.txt +++ b/FAQ.txt @@ -26,6 +26,14 @@ A. Actually there is! Just type "make 1c". +1.3 Isn't it possible to build perfbook-1c.pdf by just typing + "make"? + + A Yes, it is! Define an environment variable + "PERFBOOK_DEFAULT" in your shell and set its value as + "1c". Then, by just typing "make" will build + perfbook-1c.pdf. + 2. The Makefile cannot find pdflatex. What is it and where can I find it? diff --git a/Makefile b/Makefile index 662e2c2..46ec7b9 100644 --- a/Makefile +++ b/Makefile @@ -66,8 +66,17 @@ SVGSOURCES = \ datastruct/*.svg \ rt/*.svg +default = $(PERFBOOK_DEFAULT) +spc = + +ifeq ($(default),$(spc)) + def_tgt = perfbook.pdf +else + def_tgt = $(default) +endif + .PHONY: all clean distclean touchsvg neatfreak 1c 2c hb -all: perfbook.pdf +all: $(def_tgt) 2c: perfbook.pdf -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe perfbook" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html