Skip to contentSkip to conversation

Another round of build script tweaks

PATCH In review Akira Yokosawa 2 participants 10 messages May 2, 2016 – May 3, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Another round of build script tweaks

From 4ce174f3c72367fed945fb4448e294d205b8d88a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 3 May 2016 00:18:53 +0900
Subject: [RFT PATCH 0/5] Another round of build script tweaks

This series restructures build scripts rather radically. My initial feeling was that [5/5] would be the most controversial, and placed at the end of the series.
But in hindsight, [1/5] seems to be the most controversial one.

Anyway, I'd like people to try them and give feedback.

In commit 4038e781ed56 ("Improve behavior of build scripts"), I caused some regressions. They were fixed soon after, but I think changes in build scripts need to be heavily tested before being pulled in.

Any feedback is welcome. Thanks.

Akira Yokosawa (5):
Further improvement of build scripts
Add font installation check
Add short name targets in Makefile
Add explanation of short name target in FAQ.txt
Make default target of Makefile overridable

 .gitignore            |   10 +-
 FAQ.txt               |   23 +
 Makefile              |  322 +--
 contrib.tex           |   60 -
 count/sig-theft.dot   |   19 +-
 count/sig-theft.eps   |  457 ---
 origpub.tex           |    8 -
 qqz.tex               | 7707 -------------------------------------------------
 utilities/eps2pdf.sh  |   12 +
 utilities/runlatex.sh |    9 +
 10 files changed, 181 insertions(+), 8446 deletions(-)
 delete mode 100644 contrib.tex
 delete mode 100644 count/sig-theft.eps
 delete mode 100644 origpub.tex
 delete mode 100644 qqz.tex
Signature · 1 line
1.9.1
#1 lore raw

From 70f67434ad50b24b81de42c830d740e6042deba7 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 2 May 2016 15:47:02 +0900
Subject: [RFT PATCH 1/5] Further improvement of build scripts

This commit restructures Makefile so that dependencies can be checked more rigorously and redundant command invocations can be avoided.
The following changes are done in Makefile:
1) use empty targets
perfbook_aux, qqz_first, extraction, embedfonts, etc.
2) denote phony targets as such
all, clean, distclean and neatfreak
3) add a target for touching .svg files
touchsvg
4) move rules related to perfbook.pdf before other rules for the ease of maintenance
5) use wildcards for LATEXSOURCES, ESPSOURCES, BIBSOURCES, etc.
6) add static pattern rules of (.tex -> .eps) and (.dot -> .pdf), and remove rules for individual files
7) rm's of .eps files whose sources are .tex files are moved to distclean

The target "touchsvg" is useful when a user failed to install the Steel City Comic font before doing "make" for the first time. It used to require a "make neatfreak" for the installed font to actually make any effect.

FAQ.txt is also updated and includes the explanation of the use of "make touchsvg".

The change in runlatex.sh is necessary to avoid redundant pdflatex run.

This commit also fixes count/sig-theft.dot so that 'dot' command of Ubuntu 14.04 can reproduce count/sig-theft.pdf as expected.

As a result of these changes, qqz.tex, contrib.tex, origpub.tex, and count/sig-theft.eps are no longer necessary in the repository. This commit removes them and updates .gitconfig and the "make clean" rule accordingly.

---
 .gitignore            |   10 +-
 FAQ.txt               |    9 +
 Makefile              |  301 +-
 contrib.tex           |   60 -
 count/sig-theft.dot   |   19 +-
 count/sig-theft.eps   |  457 ---
 origpub.tex           |    8 -
 qqz.tex               | 7707 -------------------------------------------------
 utilities/runlatex.sh |    1 +
 9 files changed, 129 insertions(+), 8443 deletions(-)
 delete mode 100644 contrib.tex
 delete mode 100644 count/sig-theft.eps
 delete mode 100644 origpub.tex
 delete mode 100644 qqz.tex
.gitignore +9 -1
index 39fd69d..48cb86d 100644
@@ -15,8 +15,10 @@
 *.bz2
 *.swp
 perfbook_flat.tex
-perfbook_html.bbl
 perfbook_html.tex
+qqz.tex
+contrib.tex
+origpub.tex
 contrib_html.tex
 origpub_html.tex
 qqz_html.tex
@@ -25,6 +27,12 @@ perfbook-1c.tex
 perfbook-1c.out
 perfbook-hb.tex
 perfbook-hb.out
+qqz_first
+perfbook_aux
+perfbook-1c_aux
+perfbook-hb_aux
+extraction
+embedfonts
 
 RCS
 
FAQ.txt +9 -0
index 295145a..f331bdd 100644
@@ -11,6 +11,15 @@
 		well, this will produce a file named "perfbook.pdf",
 		which prints two virtual pages per physical page.
 
+1.1	I have installed the Steel City Comic font, and rebuilt
+	"perfbook.pdf".  But it doesn't seem to have any effect.
+	What am I missing?
+
+	A.	If you have ever built "perfbook.pdf" before installing
+		the font, you need to rebuild cartoons whose sources
+		are .svg files.  Typing "make touchsvg; make" will do
+		the trick.
+
 2.	The Makefile cannot find pdflatex.  What is it and where can I
 	find it?
 
Makefile +100 -201

371 lines not on this page · raw message

contrib.tex deleted +0 -60

60 lines not on this page · raw message

count/sig-theft.dot +10 -9
index ad7dc40..307d6bf 100644
@@ -1,7 +1,8 @@
 digraph signal_theft {
 	size = "6,6"
-	node [shape=ellipse,fontsize=10]
-	edge [fontsize=10]
+	margin = 0.0
+	node [shape=ellipse,fontsize=10,fontname=Helvetica]
+	edge [fontsize=10,fontname=Helvetica]
 
 	"IDLE" [style=filled,fillcolor=green,peripheries=2];
 	{
@@ -9,11 +10,11 @@ digraph signal_theft {
 		"READY" [style=filled,fillcolor=green];
 		rank=same;
 	}
-	"ACK" [style=filled,fillcolor=lightblue];
-	"IDLE" -> "REQ" [label="need\nflush",decorate];
-	"IDLE" -> "READY" [label="no\ncount",decorate];
-	"REQ" -> "READY" [label="!counting",decorate];
-	"REQ" -> "ACK" [label="counting",decorate];
-	"ACK" -> "READY" [label="done\ncounting",decorate];
-	"READY" -> "IDLE" [label="flushed",decorate];
+	"ACK" [style=filled, fillcolor=lightblue];
+	"IDLE" -> "REQ" [label="need\nflush", decorate=true];
+	"IDLE" -> "READY" [label="no\ncount", decorate=true];
+	"REQ" -> "READY" [label="!counting", decorate=false];
+	"REQ" -> "ACK" [label="counting", decorate=true];
+	"ACK" -> "READY" [label="done\ncounting", decorate=true];
+	"READY" -> "IDLE" [label="flushed", decorate=true];
 }
count/sig-theft.eps deleted +0 -457

457 lines not on this page · raw message

origpub.tex deleted +0 -8
deleted file mode 100644
index 8671064..0000000
@@ -1,8 +0,0 @@
-\OrigPubItem{Section}{sec:intro:What Makes Parallel Programming Hard?}{What Makes Parallel Programming Hard?}{a Portland State University Technical Report}{PaulEMcKenney2009ProgrammingHard}
-\OrigPubItem{Section}{sec:SMPdesign:Beyond Partitioning}{Retrofitted Parallelism Considered Grossly Sub-Optimal}{4\textsuperscript{th} USENIX Workshop on Hot Topics on Parallelism}{PaulEMcKenney2012HOTPARsuboptimal}
-\OrigPubItem{Section}{sec:defer:RCU Fundamentals}{RCU Fundamentals}{Linux Weekly News}{PaulEMcKenney2007WhatIsRCUFundamentally}
-\OrigPubItem{Section}{sec:defer:RCU Usage}{RCU Usage}{Linux Weekly News}{PaulEMcKenney2008WhatIsRCUUsage}
-\OrigPubItem{Section}{sec:defer:RCU Linux-Kernel API}{RCU Linux-Kernel API}{Linux Weekly News}{PaulEMcKenney2008WhatIsRCUAPI}
-\OrigPubItem{Appendix}{chp:formal:Formal Verification}{Formal Verification}{Linux Weekly News}{PaulEMcKenney2007QRCUspin,PaulEMcKenney2008dynticksRCU,PaulEMcKenney2011ppcmem}
-\OrigPubItem{Section}{sec:formal:Axiomatic Approaches}{Axiomatic Approaches}{Linux Weekly News}{PaulEMcKenney2014weakaxiom}
-\OrigPubItem{Appendix}{sec:app:whymb:Memory-Barrier Instructions For Specific CPUs}{Memory-Barrier Instructions For Specific CPUs}{Linux Journal}{PaulMcKenney2005i,PaulMcKenney2005j}
qqz.tex deleted +0 -7707

2,038 lines not on this page · raw message

utilities/runlatex.sh +1 -0
index 61acf52..228d320 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 1/5 Further improvement of build scripts (was Re: [RFT PATCH 0/5] Another round of build script tweaks)

Sorry, I failed to replace the subject in the mail header. The one in the mail body
"[RFT PATCH 1/5] Further improvement of build scripts" is the right one.

Akira

#3 lore raw

Re: [RFT PATCH 1/5] Further improvement of build scripts (was Re: [RFT PATCH 0/5] Another round of build script tweaks)

Hi.

I had a trouble with this patch myself.
This patch changes the targets "embedfonts" and "extraction" to empty targets. This will create actual files of those names.
If you checkout to another branch after those files are created, the original Makefile does not work properly.

If you encounter this issue, please remove those files manually.

I should have used different names for the empty targets.

Sorry for the trouble.

Thanks, Akira

#4 lore raw

PATCH 2/5 Add font installation check

In reply to Akira Yokosawa

From 9720d1856b2b695c34648ca566a4afdcdcb86abb Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 2 May 2016 19:03:11 +0900
Subject: [RFT PATCH 2/5] Add font installation check

This commit adds tests in eps2pdf.sh and runlatex.sh which check the presence of the Steel City Comic font in the font cache and in PDF files generated from .svg files.
If either of the tests fails, a message referring the user to items 1 and 1.1 in FAQ.txt will be displayed.

---
 utilities/eps2pdf.sh  | 12 ++++++++++++
 utilities/runlatex.sh |  8 ++++++++
 2 files changed, 20 insertions(+)
utilities/eps2pdf.sh +12 -0
index c0fcdf9..b72f1a5 100644
@@ -18,6 +18,18 @@
 # http://www.gnu.org/licenses/gpl-2.0.html.
 #
 # Copyright (c) 2010 Paul E. McKenney, IBM Corporation.
+# Copyright (c) 2016 Akira Yokosawa
+
+if ! fc-list | grep -q steel
+then
+	echo "#######################################################################"
+	echo "## Steel City Comic font is not found in the font cache!             ##"
+	echo "## Some speech baloons in the cartoons would be rendered awkwardly.  ##"
+	echo "## See item 1 in FAQ.txt for how to install the font.                ##"
+	echo "## Nevertheless, this build will resume in a short while.            ##"
+	echo "#######################################################################"
+	sleep 5
+fi
 
 epsfiles=`find . -name '*.eps' -print`
 for i in $epsfiles
utilities/runlatex.sh +8 -0
index 228d320..3e46e6f 100644
@@ -111,4 +111,12 @@ fi
 rm -f $basename-warning.log $basename-warning-prev.log
 touch $basename.pdf
 echo "No 'LaTeX Warning' found. '$basename.pdf' is ready."
+if ! grep -q -i "steel city comic" cartoons/*.pdf
+then
+	echo "#######################################################################"
+	echo "## Steel City Comic font is not found in the resulting PDF!          ##"
+	echo "## Some speech baloons in the cartoons have been rendered awkwardly. ##"
+	echo "## See items 1 and 1.1 in FAQ.txt for the solution.                  ##"
+	echo "#######################################################################"
+fi
 exit 0
Signature · 1 line
1.9.1
#5 lore raw

PATCH 3/5 Add short name targets in Makefile

In reply to Akira Yokosawa

From cc911005c633213f6496ea010c69d6fec1ddb1e4 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 2 May 2016 19:29:03 +0900
Subject: [RFT PATCH 3/5] Add short name targets in Makefile

This commit adds short name targets "2c", "1c", and "hb" in Makefile.

"2c" is added for consistency.

---
 Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Makefile +7 -1
index eaf101e..662e2c2 100644
@@ -66,9 +66,15 @@ SVGSOURCES = \
 	datastruct/*.svg \
 	rt/*.svg
 
-.PHONY: all clean distclean touchsvg neatfreak
+.PHONY: all clean distclean touchsvg neatfreak 1c 2c hb
 all: perfbook.pdf
 
+2c: perfbook.pdf
+
+1c: perfbook-1c.pdf
+
+hb: perfbook-hb.pdf
+
 perfbook.pdf: perfbook.bbl
 	sh utilities/runlatex.sh perfbook
 
Signature · 1 line
1.9.1
#6 lore raw

PATCH 4/5 Add explanation of short name target in FAQ.txt

In reply to Akira Yokosawa

From 3b3505ccba4bee3d0f1348f75f59f48c6fa4bb7e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 2 May 2016 23:49:33 +0900
Subject: [RFT PATCH 4/5] Add explanation of short name target in FAQ.txt

---
 FAQ.txt | 6 ++++++
 1 file changed, 6 insertions(+)
FAQ.txt +6 -0
index f331bdd..1a1c589 100644
@@ -20,6 +20,12 @@
 		are .svg files.  Typing "make touchsvg; make" will do
 		the trick.
 
+1.2	I prefer perfbook-1c.pdf than perfbook.pdf to read it on my
+	tablet. Typing "make perfbook-1c.pdf" every time is a little
+	bit cumbersome. Isn't there any simpler way?
+
+	A.	Actually there is!  Just type "make 1c".
+
 2.	The Makefile cannot find pdflatex.  What is it and where can I
 	find it?
 
Signature · 1 line
1.9.1
#7 lore raw

PATCH 5/5 Make default target of Makefile overridable

In reply to Akira Yokosawa

From 4ce174f3c72367fed945fb4448e294d205b8d88a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
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.

---
 FAQ.txt  |  8 ++++++++
 Makefile | 11 ++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
FAQ.txt +8 -0
index 1a1c589..e1d7dd6 100644
@@ -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?
 
Makefile +10 -1
index 662e2c2..46ec7b9 100644
@@ -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
 
Signature · 1 line
1.9.1
#8 lore raw

RFT withdrawn (was Re: [RFT PATCH 0/5] Another round of build script tweaks)

In reply to Akira Yokosawa
Quoted 26 lines · Akira Yokosawa
Quoted 1 line

From 4ce174f3c72367fed945fb4448e294d205b8d88a Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Tue, 3 May 2016 00:18:53 +0900
Subject: [RFT PATCH 0/5] Another round of build script tweaks

This series restructures build scripts rather radically. My initial feeling was that [5/5] would be the most controversial, and placed at the end of the series.
But in hindsight, [1/5] seems to be the most controversial one.

Anyway, I'd like people to try them and give feedback.

In commit 4038e781ed56 ("Improve behavior of build scripts"), I caused some regressions. They were fixed soon after, but I think changes in build scripts need to be heavily tested before being pulled in.

Any feedback is welcome. Thanks.

Akira Yokosawa (5):
Further improvement of build scripts
Add font installation check
Add short name targets in Makefile
Add explanation of short name target in FAQ.txt
Make default target of Makefile overridable

Quoted 16 lines
 .gitignore            |   10 +-
 FAQ.txt               |   23 +
 Makefile              |  322 +--
 contrib.tex           |   60 -
 count/sig-theft.dot   |   19 +-
 count/sig-theft.eps   |  457 ---
 origpub.tex           |    8 -
 qqz.tex               | 7707 -------------------------------------------------
 utilities/eps2pdf.sh  |   12 +
 utilities/runlatex.sh |    9 +
 10 files changed, 181 insertions(+), 8446 deletions(-)
 delete mode 100644 contrib.tex
 delete mode 100644 count/sig-theft.eps
 delete mode 100644 origpub.tex
 delete mode 100644 qqz.tex

As I reported in another mail, this series causes painful side-effects. Please refrain from trying this series.

I'll resubmit v2 of this series soon.

Sorry for the trouble.

Thanks, Akira

#9 lore raw

Re: RFT withdrawn (was Re: [RFT PATCH 0/5] Another round of build script tweaks)

Quoted 44 lines · Akira Yokosawa
Quoted 26 lines · Akira Yokosawa
Quoted 1 line

From 4ce174f3c72367fed945fb4448e294d205b8d88a Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Tue, 3 May 2016 00:18:53 +0900
Subject: [RFT PATCH 0/5] Another round of build script tweaks

This series restructures build scripts rather radically. My initial feeling was that [5/5] would be the most controversial, and placed at the end of the series.
But in hindsight, [1/5] seems to be the most controversial one.

Anyway, I'd like people to try them and give feedback.

In commit 4038e781ed56 ("Improve behavior of build scripts"), I caused some regressions. They were fixed soon after, but I think changes in build scripts need to be heavily tested before being pulled in.

Any feedback is welcome. Thanks.

Akira Yokosawa (5):
Further improvement of build scripts
Add font installation check
Add short name targets in Makefile
Add explanation of short name target in FAQ.txt
Make default target of Makefile overridable

Quoted 16 lines
 .gitignore            |   10 +-
 FAQ.txt               |   23 +
 Makefile              |  322 +--
 contrib.tex           |   60 -
 count/sig-theft.dot   |   19 +-
 count/sig-theft.eps   |  457 ---
 origpub.tex           |    8 -
 qqz.tex               | 7707 -------------------------------------------------
 utilities/eps2pdf.sh  |   12 +
 utilities/runlatex.sh |    9 +
 10 files changed, 181 insertions(+), 8446 deletions(-)
 delete mode 100644 contrib.tex
 delete mode 100644 count/sig-theft.eps
 delete mode 100644 origpub.tex
 delete mode 100644 qqz.tex
Quoted 6 lines

As I reported in another mail, this series causes painful side-effects. Please refrain from trying this series.

I'll resubmit v2 of this series soon.

Sorry for the trouble.

Not a problem, as I was slow about getting to it anyway. Looking forward to the next version!

Thanx, Paul