Skip to contentSkip to conversation

Makefile: Add recipe to remove obsolete intermediate files

PATCH Superseded Akira Yokosawa 2 participants 3 messages Dec 11, 2018 – Dec 12, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Add recipe to remove obsolete intermediate files

From 271e880a74f5b8467a26f550c9abc9ed1ff8378d Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Wed, 12 Dec 2018 07:35:24 +0900
Subject: [PATCH] Makefile: Add recipe to remove obsolete intermediate files

Commit 3ab5541f7404 ("intro: Add containers and hypervisor to "iron triangle" diagram") replaced intro/PPGrelation.fig with intro/PPGrelation.svg. The old intermediate file intro/PPGrelation.eps causes duplicated targets in the Makefile.

Therefore, add a list OBSOLETE_FILES in the Makefile and remove such files by "make clean".

Also remove PPGrelation.eps from intro/.gitignore.

---
 Makefile         | 3 ++-
 intro/.gitignore | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -1
index c928c80..49934df 100644
@@ -12,6 +12,7 @@ LATEXSOURCES = \
 	*/*/*.tex
 
 LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
+OBSOLETE_FILES = intro/PPGrelation.eps
 
 ABBREVTARGETS := tcb 1c hb msns mss mstx msr msn msnt 1csf
 
@@ -293,7 +294,7 @@ clean:
 		-o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' \
 		-o -name '*.fcv' -o -name '*.ltms' | xargs rm -f
 	rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex
-	rm -f $(LATEXGENERATED)
+	rm -f $(LATEXGENERATED) $(OBSOLETE_FILES)
 	rm -f extraction
 	rm -f CodeSamples/snippets.mk CodeSamples/snippets.d
 
intro/.gitignore +0 -1
index c29b706..cffadec 100644
@@ -1,4 +1,3 @@
 FourTaskCategories.eps
 FourTaskOrder.eps
 Generality.eps
-PPGrelation.eps
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 Makefile: Add recipe to remove obsolete intermediate files

From 33b506548ce3b09cbf7a7e4e8bf1a80496dd9e1a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Wed, 12 Dec 2018 20:11:21 +0900
Subject: [PATCH v2] Makefile: Add recipe to remove obsolete intermediate files

Commit 3ab5541f7404 ("intro: Add containers and hypervisor to "iron triangle" diagram") replaced intro/PPGrelation.fig with intro/PPGrelation.svg. Left-over intermediate file intro/PPGrelation.eps causes duplicated targets in the Makefile.

Therefore, add a list OBSOLETE_FILES in the Makefile and exclude such files from EPSSOURCES.

Add "extraction" to the list since it was once an empty target and obsolete now.

"make clean" will remove those files.

Also remove PPGrelation.eps from intro/.gitignore.

---
Hi Paul,

This is an improved update.

v1 -> v2:

o To prevent warning of "make" even if the obsolete .eps file
exists, exclude OBSOLETE_FILES from EPSSOURCES.

o "extraction" is also obsolete, so add it to OBSOLETE_FILES.

Thanks, Akira
--

 Makefile         | 6 +++---
 intro/.gitignore | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)
Makefile +3 -3
index c928c80..79ccd99 100644
@@ -12,6 +12,7 @@ LATEXSOURCES = \
 	*/*/*.tex
 
 LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
+OBSOLETE_FILES = intro/PPGrelation.eps extraction
 
 ABBREVTARGETS := tcb 1c hb msns mss mstx msr msn msnt 1csf
 
@@ -38,7 +39,7 @@ EPSSOURCES_DUP := \
 	$(EPSSOURCES_FROM_DOT) \
 	$(EPSSOURCES_FROM_FIG)
 
-EPSSOURCES := $(sort $(EPSSOURCES_DUP))
+EPSSOURCES := $(sort $(filter-out $(OBSOLETE_FILES),$(EPSSOURCES_DUP)))
 
 PDFTARGETS_OF_EPS := $(EPSSOURCES:%.eps=%.pdf)
 
@@ -293,8 +294,7 @@ clean:
 		-o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' \
 		-o -name '*.fcv' -o -name '*.ltms' | xargs rm -f
 	rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex
-	rm -f $(LATEXGENERATED)
-	rm -f extraction
+	rm -f $(LATEXGENERATED) $(OBSOLETE_FILES)
 	rm -f CodeSamples/snippets.mk CodeSamples/snippets.d
 
 distclean: clean
intro/.gitignore +0 -1
index c29b706..cffadec 100644
@@ -1,4 +1,3 @@
 FourTaskCategories.eps
 FourTaskOrder.eps
 Generality.eps
-PPGrelation.eps
Signature · 1 line
2.7.4
#2 lore raw
Quoted 26 lines · Akira Yokosawa
Quoted 1 line

From 33b506548ce3b09cbf7a7e4e8bf1a80496dd9e1a Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Wed, 12 Dec 2018 20:11:21 +0900
Subject: [PATCH v2] Makefile: Add recipe to remove obsolete intermediate files

Commit 3ab5541f7404 ("intro: Add containers and hypervisor to "iron triangle" diagram") replaced intro/PPGrelation.fig with intro/PPGrelation.svg. Left-over intermediate file intro/PPGrelation.eps causes duplicated targets in the Makefile.

Therefore, add a list OBSOLETE_FILES in the Makefile and exclude such files from EPSSOURCES.

Add "extraction" to the list since it was once an empty target and obsolete now.

"make clean" will remove those files.

Also remove PPGrelation.eps from intro/.gitignore.

---
Hi Paul,

This is an improved update.

Quoted 8 lines

v1 -> v2:

o To prevent warning of "make" even if the obsolete .eps file
exists, exclude OBSOLETE_FILES from EPSSOURCES.

o "extraction" is also obsolete, so add it to OBSOLETE_FILES.

Thanks, Akira

Queued and pushed, and it did get rid of my intro/PPGrelation.eps. ;-) Thank you!

Thanx, Paul

Quoted 49 lines

--

 Makefile         | 6 +++---
 intro/.gitignore | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)
Makefile +3 -3
index c928c80..79ccd99 100644
@@ -12,6 +12,7 @@ LATEXSOURCES = \
 	*/*/*.tex
 
 LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
+OBSOLETE_FILES = intro/PPGrelation.eps extraction
 
 ABBREVTARGETS := tcb 1c hb msns mss mstx msr msn msnt 1csf
 
@@ -38,7 +39,7 @@ EPSSOURCES_DUP := \
 	$(EPSSOURCES_FROM_DOT) \
 	$(EPSSOURCES_FROM_FIG)
 
-EPSSOURCES := $(sort $(EPSSOURCES_DUP))
+EPSSOURCES := $(sort $(filter-out $(OBSOLETE_FILES),$(EPSSOURCES_DUP)))
 
 PDFTARGETS_OF_EPS := $(EPSSOURCES:%.eps=%.pdf)
 
@@ -293,8 +294,7 @@ clean:
 		-o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' \
 		-o -name '*.fcv' -o -name '*.ltms' | xargs rm -f
 	rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex
-	rm -f $(LATEXGENERATED)
-	rm -f extraction
+	rm -f $(LATEXGENERATED) $(OBSOLETE_FILES)
 	rm -f CodeSamples/snippets.mk CodeSamples/snippets.d
 
 distclean: clean
intro/.gitignore +0 -1
index c29b706..cffadec 100644
@@ -1,4 +1,3 @@
 FourTaskCategories.eps
 FourTaskOrder.eps
 Generality.eps
-PPGrelation.eps
Signature · 1 line
2.7.4