* [PATCH] Makefile: Remove empty target 'extraction'
@ 2016-08-16 11:17 Akira Yokosawa
2016-08-16 14:18 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: Akira Yokosawa @ 2016-08-16 11:17 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From f224cf6d4b4fe21edd23d712a4b102396fa66755 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Tue, 16 Aug 2016 18:53:45 +0900
Subject: [PATCH] Makefile: Remove empty target 'extraction'
As commit 69523c880c9a ("Remove generated files contrib.tex and
origpub.tex from archive") removed files I called out as
necessary in commit 7f46bce80811 ("Makefile: Add comment on why
'extraction' is an empty target"), I noticed that the comment
added then was simply bogus.
We can safely remove the target "extraction" and define rules
for qqz.tex, contrib.tex, and origpug.tex in Makefile.
This commit adds those rules instead of target "extraction",
and removes the wrong comment.
"extraction" is intentionally left in the "clean" rule and
in .gitignore for the time being. They can be removed later,
say after the next release.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Makefile | 41 ++++++++++++++---------------------------
1 file changed, 14 insertions(+), 27 deletions(-)
diff --git a/Makefile b/Makefile
index 60e8e96..570b79e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@ LATEXSOURCES = \
*/*.tex \
*/*/*.tex
+LATEXGENERATED = qqz.tex contrib.tex origpub.tex
+
EPSSOURCES_FROM_TEX := \
SMPdesign/DiningPhilosopher5.eps \
SMPdesign/DiningPhilosopher5TB.eps \
@@ -68,18 +70,23 @@ perfbook.pdf: perfbook.bbl
perfbook.bbl: $(BIBSOURCES) perfbook.aux
bibtex perfbook
-perfbook.aux: $(LATEXSOURCES) extraction
+perfbook.aux: $(LATEXSOURCES) $(LATEXGENERATED)
sh utilities/runfirstlatex.sh perfbook
-perfbook_flat.tex qqz.tex: perfbook.tex $(LATEXSOURCES) $(EPSSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG)
+perfbook_flat.tex: perfbook.tex $(LATEXSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG)
echo > qqz.tex
+ echo > contrib.tex
+ echo > origpub.tex
texexpand perfbook.tex > perfbook_flat.tex
+
+qqz.tex: perfbook_flat.tex
sh utilities/extractqqz.sh < perfbook_flat.tex > qqz.tex
-extraction: perfbook_flat.tex
+contrib.tex: perfbook_flat.tex qqz.tex
cat perfbook_flat.tex qqz.tex | sh utilities/extractcontrib.sh > contrib.tex
+
+origpub.tex: perfbook_flat.tex
sh utilities/extractorigpub.sh < perfbook_flat.tex > origpub.tex
- touch extraction
perfbook-1c.pdf: perfbook-1c.tex perfbook-1c.bbl
sh utilities/runlatex.sh perfbook-1c
@@ -90,7 +97,7 @@ perfbook-1c.tex: perfbook.tex
perfbook-1c.bbl: $(BIBSOURCES) perfbook-1c.aux
bibtex perfbook-1c
-perfbook-1c.aux: $(LATEXSOURCES) extraction
+perfbook-1c.aux: $(LATEXSOURCES) $(LATEXGENERATED)
sh utilities/runfirstlatex.sh perfbook-1c
perfbook-hb.pdf: perfbook-hb.tex perfbook-hb.bbl
@@ -102,7 +109,7 @@ perfbook-hb.tex: perfbook.tex
perfbook-hb.bbl: $(BIBSOURCES) perfbook-hb.aux
bibtex perfbook-hb
-perfbook-hb.aux: $(LATEXSOURCES) extraction
+perfbook-hb.aux: $(LATEXSOURCES) $(LATEXGENERATED)
sh utilities/runfirstlatex.sh perfbook-hb
# Rules related to perfbook_html are removed as of May, 2016
@@ -148,7 +155,7 @@ clean:
-o -name '*.dvi' -o -name '*.log' \
-o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' | xargs rm -f
rm -f perfbook_flat.tex perfbook.out perfbook-1c.out
- rm -f qqz.tex
+ rm -f $(LATEXGENERATED)
rm -f perfbook-hb.out perfbook-1c.tex perfbook-hb.tex
rm -f extraction
@@ -165,23 +172,3 @@ ls-unused:
neatfreak: distclean
# Don't forget to regenerate the .pdf from each .svg file
find . -name '*.pdf' | xargs rm -f
-
-# Note on why 'extraction' should be an empty target
-#
-# There are dependency loops around perfbook_flat.tex.
-# perfbook_flat.tex requires an empty qqz.tex and up-to-date
-# contrib.tex and origpub.tex for texexpand to work properly.
-#
-# Both contrib.tex and origpub.tex requires perfbook_flat.tex.
-# contrib.tex also requires up-to-date qqz.tex.
-#
-# So at first glance, rules for contrib.tex and origpub.tex
-# can be defined, but that requires 'extraction' to be a phony
-# target.
-#
-# 'extraction' is prerequisite for perfbook.aux.
-# If you make it a phony target, the rule for perfbook.aux is
-# always executed. That means runfirstlatex.run will run even
-# if no source file is updated.
-# To avoid the redundant run, we need to make 'extraction' an
-# empty target.
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Makefile: Remove empty target 'extraction'
2016-08-16 11:17 [PATCH] Makefile: Remove empty target 'extraction' Akira Yokosawa
@ 2016-08-16 14:18 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2016-08-16 14:18 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Tue, Aug 16, 2016 at 08:17:40PM +0900, Akira Yokosawa wrote:
> >From f224cf6d4b4fe21edd23d712a4b102396fa66755 Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Tue, 16 Aug 2016 18:53:45 +0900
> Subject: [PATCH] Makefile: Remove empty target 'extraction'
>
> As commit 69523c880c9a ("Remove generated files contrib.tex and
> origpub.tex from archive") removed files I called out as
> necessary in commit 7f46bce80811 ("Makefile: Add comment on why
> 'extraction' is an empty target"), I noticed that the comment
> added then was simply bogus.
> We can safely remove the target "extraction" and define rules
> for qqz.tex, contrib.tex, and origpug.tex in Makefile.
>
> This commit adds those rules instead of target "extraction",
> and removes the wrong comment.
>
> "extraction" is intentionally left in the "clean" rule and
> in .gitignore for the time being. They can be removed later,
> say after the next release.
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Good catch! I should have looked more carefully at the output from
a from-scratch build after my ill-considered change:
texexpand: include origpub failed. Reinserting command
texexpand: include contrib failed. Reinserting command
This is much nicer -- the issue was that the gitk command would show
origpub.tex and contrib.tex as modified if you hit F5 during a build.
It was necessary to do a "git status" to get rid of this. With this
change, this doesn't happen (as was the case with my change), but also
the above errors don't appear.
Queued and pushed, thank you!
Thanx, Paul
> ---
> Makefile | 41 ++++++++++++++---------------------------
> 1 file changed, 14 insertions(+), 27 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 60e8e96..570b79e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -6,6 +6,8 @@ LATEXSOURCES = \
> */*.tex \
> */*/*.tex
>
> +LATEXGENERATED = qqz.tex contrib.tex origpub.tex
> +
> EPSSOURCES_FROM_TEX := \
> SMPdesign/DiningPhilosopher5.eps \
> SMPdesign/DiningPhilosopher5TB.eps \
> @@ -68,18 +70,23 @@ perfbook.pdf: perfbook.bbl
> perfbook.bbl: $(BIBSOURCES) perfbook.aux
> bibtex perfbook
>
> -perfbook.aux: $(LATEXSOURCES) extraction
> +perfbook.aux: $(LATEXSOURCES) $(LATEXGENERATED)
> sh utilities/runfirstlatex.sh perfbook
>
> -perfbook_flat.tex qqz.tex: perfbook.tex $(LATEXSOURCES) $(EPSSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG)
> +perfbook_flat.tex: perfbook.tex $(LATEXSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG)
> echo > qqz.tex
> + echo > contrib.tex
> + echo > origpub.tex
> texexpand perfbook.tex > perfbook_flat.tex
> +
> +qqz.tex: perfbook_flat.tex
> sh utilities/extractqqz.sh < perfbook_flat.tex > qqz.tex
>
> -extraction: perfbook_flat.tex
> +contrib.tex: perfbook_flat.tex qqz.tex
> cat perfbook_flat.tex qqz.tex | sh utilities/extractcontrib.sh > contrib.tex
> +
> +origpub.tex: perfbook_flat.tex
> sh utilities/extractorigpub.sh < perfbook_flat.tex > origpub.tex
> - touch extraction
>
> perfbook-1c.pdf: perfbook-1c.tex perfbook-1c.bbl
> sh utilities/runlatex.sh perfbook-1c
> @@ -90,7 +97,7 @@ perfbook-1c.tex: perfbook.tex
> perfbook-1c.bbl: $(BIBSOURCES) perfbook-1c.aux
> bibtex perfbook-1c
>
> -perfbook-1c.aux: $(LATEXSOURCES) extraction
> +perfbook-1c.aux: $(LATEXSOURCES) $(LATEXGENERATED)
> sh utilities/runfirstlatex.sh perfbook-1c
>
> perfbook-hb.pdf: perfbook-hb.tex perfbook-hb.bbl
> @@ -102,7 +109,7 @@ perfbook-hb.tex: perfbook.tex
> perfbook-hb.bbl: $(BIBSOURCES) perfbook-hb.aux
> bibtex perfbook-hb
>
> -perfbook-hb.aux: $(LATEXSOURCES) extraction
> +perfbook-hb.aux: $(LATEXSOURCES) $(LATEXGENERATED)
> sh utilities/runfirstlatex.sh perfbook-hb
>
> # Rules related to perfbook_html are removed as of May, 2016
> @@ -148,7 +155,7 @@ clean:
> -o -name '*.dvi' -o -name '*.log' \
> -o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' | xargs rm -f
> rm -f perfbook_flat.tex perfbook.out perfbook-1c.out
> - rm -f qqz.tex
> + rm -f $(LATEXGENERATED)
> rm -f perfbook-hb.out perfbook-1c.tex perfbook-hb.tex
> rm -f extraction
>
> @@ -165,23 +172,3 @@ ls-unused:
> neatfreak: distclean
> # Don't forget to regenerate the .pdf from each .svg file
> find . -name '*.pdf' | xargs rm -f
> -
> -# Note on why 'extraction' should be an empty target
> -#
> -# There are dependency loops around perfbook_flat.tex.
> -# perfbook_flat.tex requires an empty qqz.tex and up-to-date
> -# contrib.tex and origpub.tex for texexpand to work properly.
> -#
> -# Both contrib.tex and origpub.tex requires perfbook_flat.tex.
> -# contrib.tex also requires up-to-date qqz.tex.
> -#
> -# So at first glance, rules for contrib.tex and origpub.tex
> -# can be defined, but that requires 'extraction' to be a phony
> -# target.
> -#
> -# 'extraction' is prerequisite for perfbook.aux.
> -# If you make it a phony target, the rule for perfbook.aux is
> -# always executed. That means runfirstlatex.run will run even
> -# if no source file is updated.
> -# To avoid the redundant run, we need to make 'extraction' an
> -# empty target.
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-16 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 11:17 [PATCH] Makefile: Remove empty target 'extraction' Akira Yokosawa
2016-08-16 14:18 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox