Skip to contentSkip to conversation

FAQ-BUILD: Fix trivial typo

PATCH New Akira Yokosawa 1 participant 3 messages Feb 2, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 FAQ-BUILD: Fix trivial typo

From 4066e351c2673b626fe8c4e85f9a87f82ebb1842 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 2 Feb 2020 19:24:03 +0900
Subject: [PATCH 1/2] FAQ-BUILD: Fix trivial typo

Fixes 4c6ee39761a0 ("Remove required version of 'epigraph'")
---
 FAQ-BUILD.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
FAQ-BUILD.txt +1 -1
index 4657c4ee..2eca5027 100644
@@ -264,7 +264,7 @@
 		has resolved the issue. You can upgrade it by following
 		the instructions at #10 above.
 		The Up-to-date package can be downloaded from:
-		http://mirrors.ctan.org/macros/latex/contrib/fvextra.zip
+		http://mirrors.ctan.org/macros/latex/contrib/epigraph.zip
 
 	    NOTE: On Tex Live 2015/Debian (Ubuntu Xenial) and TeX Live 2016,
 		the up-to-date "epigraph" does not work properly along
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 Makefile: grep only .tex files in 'linelabel' and 'lineref' search

From 41e44e4c0027784644cf740e8d8dcafe3afc9e14 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 2 Feb 2020 20:23:58 +0900
Subject: [PATCH 2/2] Makefile: grep only .tex files in 'linelabel' and 'lineref' search

For the checks added in commit 60c2079f2765 ("Makefile: Check 'linelabel' and 'lineref' used as environment"), it should be sufficient to grep files listed in $(LATEXSOURCES) only.

Using this variable rather than the grep option "-R" will reduce the cost of the checks. We can also get rid of "patsubst" and "filter-out" functions in the variable definitions.

Also reorder and rephrase error messages in case output of grep gets long.

Add .c source file(s) under appendix/styleguide/ to the definition of "LST_SOURCES" to improve coverage of dependencies as well.

---
 Makefile | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
Makefile +10 -10
index c1a51bae..efe1add1 100644
@@ -11,7 +11,8 @@ LATEXSOURCES = \
 	*/*.tex \
 	*/*/*.tex
 
-LST_SOURCES := $(wildcard CodeSamples/formal/promela/*.lst)
+LST_SOURCES := $(wildcard CodeSamples/formal/promela/*.lst) \
+	$(wildcard appendix/styleguide/*.c)
 
 LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
 
@@ -123,14 +124,13 @@ ifdef A2PING
   endif
 endif
 
-LINE_ENV_IGNORE := Makefile perfbook_flat.tex $(LATEXGENERATED))
 # following variables are intentionally defined using "="
-LINELABEL_ENV_BEGIN = $(patsubst ./%,%,$(shell grep -R -l -F '\begin{linelabel}' .))
-LINELABEL_ENV_END   = $(patsubst ./%,%,$(shell grep -R -l -F '\end{linelabel}' .))
-LINEREF_ENV_BEGIN   = $(patsubst ./%,%,$(shell grep -R -l -F '\begin{lineref}' .))
-LINEREF_ENV_END     = $(patsubst ./%,%,$(shell grep -R -l -F '\end{lineref}' .))
-LINELABEL_ENV = $(filter-out $(LINE_ENV_IGNORE),$(sort $(LINELABEL_ENV_BEGIN) $(LINELABEL_ENV_END)))
-LINEREF_ENV   = $(filter-out $(LINE_ENV_IGNORE),$(sort $(LINEREF_ENV_BEGIN) $(LINEREF_ENV_END)))
+LINELABEL_ENV_BEGIN = $(shell grep -l -F '\begin{linelabel}' $(LATEXSOURCES))
+LINELABEL_ENV_END   = $(shell grep -l -F '\end{linelabel}'   $(LATEXSOURCES))
+LINEREF_ENV_BEGIN   = $(shell grep -l -F '\begin{lineref}'   $(LATEXSOURCES))
+LINEREF_ENV_END     = $(shell grep -l -F '\end{lineref}'     $(LATEXSOURCES))
+LINELABEL_ENV = $(sort $(LINELABEL_ENV_BEGIN) $(LINELABEL_ENV_END))
+LINEREF_ENV   = $(sort $(LINEREF_ENV_BEGIN) $(LINEREF_ENV_END))
 
 OLD_EPIGRAPH := $(shell grep -c '2009/09/02' `kpsewhich epigraph.sty`)
 TEXLIVE_2015_DEBIAN := $(shell pdftex --version | grep -c 'TeX Live 2015/Debian')
@@ -210,18 +210,18 @@ ifndef LATEXPAND
 endif
 	@if [ ! -z "$(LINELABEL_ENV)" -a "$(LINELABEL_ENV)" != " " ]; then \
 		echo "'linelabel' used as environment in $(LINELABEL_ENV)." ; \
-		echo "Use 'fcvlabel' instead." ; \
 		echo "------" ; \
 		grep -n -B 2 -A 2 -F 'linelabel' $(LINELABEL_ENV) ; \
 		echo "------" ; \
+		echo "Substitute 'fcvlabel' for 'linelabel' in $(LINELABEL_ENV)." ; \
 		exit 1 ; \
 	fi
 	@if [ ! -z "$(LINEREF_ENV)" -a "$(LINEREF_ENV)" != " " ]; then \
 		echo "'lineref' used as environment in $(LINEREF_ENV)." ; \
-		echo "Use 'fcvref' instead." ; \
 		echo "------" ; \
 		grep -n -B 2 -A 2 -F 'lineref' $(LINEREF_ENV) ; \
 		echo "------" ; \
+		echo "Substitute 'fcvref' for 'lineref' in $(LINEREF_ENV)." ; \
 		exit 1 ; \
 	fi
 	echo > qqz.tex
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/2 Makefile: grep only .tex files in 'linelabel' and 'lineref' search

From 5df79b2b5402c98547c481f3132ba87661731b1a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 2 Feb 2020 23:20:26 +0900
Subject: [PATCH v2 2/2] Makefile: grep only .tex files in 'linelabel' and 'lineref' search

For the checks added in commit 60c2079f2765 ("Makefile: Check 'linelabel' and 'lineref' used as environment"), it should be sufficient to grep files listed in $(LATEXSOURCES) only.

Using this variable rather than the grep option "-R" will reduce the cost of the checks. We can also get rid of "patsubst" and "filter-out" functions in the following macro definitions. Furthermore, as the files in $(LATEXSOURCES) are not modified during the build, we can use the operator ":=" there.

Also reorder and rephrase error messages in case output of grep gets long.

Add .c source file(s) under appendix/styleguide/ to the definition of "LST_SOURCES" to improve coverage of dependencies as well.

In the definitions of "SOURCES_OF_SNIPPET_ALL" and "SOURCES_OF_LITMUS", replace the grep option "-R" (recursive option to follow symbolic links) with the option "-r", which should be good enough.

---
Paul,

It turns out that we can speed up the startup of "make" further by using the ":=" operator and the grep option "-r".

Thanks, Akira
--

 Makefile | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
Makefile +12 -13
index c1a51bae..6f8417f3 100644
@@ -11,7 +11,8 @@ LATEXSOURCES = \
 	*/*.tex \
 	*/*/*.tex
 
-LST_SOURCES := $(wildcard CodeSamples/formal/promela/*.lst)
+LST_SOURCES := $(wildcard CodeSamples/formal/promela/*.lst) \
+	$(wildcard appendix/styleguide/*.c)
 
 LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
 
@@ -123,14 +124,12 @@ ifdef A2PING
   endif
 endif
 
-LINE_ENV_IGNORE := Makefile perfbook_flat.tex $(LATEXGENERATED))
-# following variables are intentionally defined using "="
-LINELABEL_ENV_BEGIN = $(patsubst ./%,%,$(shell grep -R -l -F '\begin{linelabel}' .))
-LINELABEL_ENV_END   = $(patsubst ./%,%,$(shell grep -R -l -F '\end{linelabel}' .))
-LINEREF_ENV_BEGIN   = $(patsubst ./%,%,$(shell grep -R -l -F '\begin{lineref}' .))
-LINEREF_ENV_END     = $(patsubst ./%,%,$(shell grep -R -l -F '\end{lineref}' .))
-LINELABEL_ENV = $(filter-out $(LINE_ENV_IGNORE),$(sort $(LINELABEL_ENV_BEGIN) $(LINELABEL_ENV_END)))
-LINEREF_ENV   = $(filter-out $(LINE_ENV_IGNORE),$(sort $(LINEREF_ENV_BEGIN) $(LINEREF_ENV_END)))
+LINELABEL_ENV_BEGIN := $(shell grep -l -F '\begin{linelabel}' $(LATEXSOURCES))
+LINELABEL_ENV_END   := $(shell grep -l -F '\end{linelabel}'   $(LATEXSOURCES))
+LINEREF_ENV_BEGIN   := $(shell grep -l -F '\begin{lineref}'   $(LATEXSOURCES))
+LINEREF_ENV_END     := $(shell grep -l -F '\end{lineref}'     $(LATEXSOURCES))
+LINELABEL_ENV := $(sort $(LINELABEL_ENV_BEGIN) $(LINELABEL_ENV_END))
+LINEREF_ENV   := $(sort $(LINEREF_ENV_BEGIN) $(LINEREF_ENV_END))
 
 OLD_EPIGRAPH := $(shell grep -c '2009/09/02' `kpsewhich epigraph.sty`)
 TEXLIVE_2015_DEBIAN := $(shell pdftex --version | grep -c 'TeX Live 2015/Debian')
@@ -149,8 +148,8 @@ else
   SUGGEST_UPGRADE_EPIGRAPH := 0
 endif
 
-SOURCES_OF_SNIPPET_ALL := $(shell grep -R -l -F '\begin{snippet}' CodeSamples)
-SOURCES_OF_LITMUS      := $(shell grep -R -l -F '\begin[snippet]' CodeSamples)
+SOURCES_OF_SNIPPET_ALL := $(shell grep -r -l -F '\begin{snippet}' CodeSamples)
+SOURCES_OF_LITMUS      := $(shell grep -r -l -F '\begin[snippet]' CodeSamples)
 SOURCES_OF_LTMS        := $(patsubst %.litmus,%.ltms,$(SOURCES_OF_LITMUS))
 SOURCES_OF_SNIPPET     := $(filter-out $(SOURCES_OF_LTMS),$(SOURCES_OF_SNIPPET_ALL)) $(SOURCES_OF_LITMUS)
 GEN_SNIPPET_D  = utilities/gen_snippet_d.pl utilities/gen_snippet_d.sh
@@ -210,18 +209,18 @@ ifndef LATEXPAND
 endif
 	@if [ ! -z "$(LINELABEL_ENV)" -a "$(LINELABEL_ENV)" != " " ]; then \
 		echo "'linelabel' used as environment in $(LINELABEL_ENV)." ; \
-		echo "Use 'fcvlabel' instead." ; \
 		echo "------" ; \
 		grep -n -B 2 -A 2 -F 'linelabel' $(LINELABEL_ENV) ; \
 		echo "------" ; \
+		echo "Substitute 'fcvlabel' for 'linelabel' in $(LINELABEL_ENV)." ; \
 		exit 1 ; \
 	fi
 	@if [ ! -z "$(LINEREF_ENV)" -a "$(LINEREF_ENV)" != " " ]; then \
 		echo "'lineref' used as environment in $(LINEREF_ENV)." ; \
-		echo "Use 'fcvref' instead." ; \
 		echo "------" ; \
 		grep -n -B 2 -A 2 -F 'lineref' $(LINEREF_ENV) ; \
 		echo "------" ; \
+		echo "Substitute 'fcvref' for 'lineref' in $(LINEREF_ENV)." ; \
 		exit 1 ; \
 	fi
 	echo > qqz.tex
Signature · 1 line
2.17.1