[PATCH 1/2] Makefile: Use more automatic variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 2d0765641c633f9e259339f0814259aefbae863e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Sun, 9 Oct 2016 20:38:46 +0900
Subject: [PATCH 1/2] Makefile: Use more automatic variables

This commit simplifies some rules by using automatic variables
such as "$<" and "$@".
It also simplifies the "clean" rule by using wildcards.
.gitignore is modified accordingly.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 .gitignore |  7 ++-----
 Makefile   | 15 +++++++--------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4a2dc33..965b94d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,11 +18,8 @@ perfbook_flat.tex
 qqz.tex
 contrib.tex
 origpub.tex
-perfbook.out
-perfbook-1c.tex
-perfbook-1c.out
-perfbook-hb.tex
-perfbook-hb.out
+perfbook*.out
+perfbook-*.tex
 extraction
 embedfonts
 
diff --git a/Makefile b/Makefile
index 55361c3..6e6d66b 100644
--- a/Makefile
+++ b/Makefile
@@ -80,22 +80,22 @@ perfbook_flat.tex: perfbook.tex $(LATEXSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGET
 	echo > qqz.tex
 	echo > contrib.tex
 	echo > origpub.tex
-	texexpand perfbook.tex > perfbook_flat.tex
+	texexpand perfbook.tex > $@
 
 qqz.tex: perfbook_flat.tex
-	sh utilities/extractqqz.sh < perfbook_flat.tex > qqz.tex
+	sh utilities/extractqqz.sh < $< > $@
 
 contrib.tex: perfbook_flat.tex qqz.tex
-	cat perfbook_flat.tex qqz.tex | sh utilities/extractcontrib.sh > contrib.tex
+	cat $^ | sh utilities/extractcontrib.sh > $@
 
 origpub.tex: perfbook_flat.tex
-	sh utilities/extractorigpub.sh < perfbook_flat.tex > origpub.tex
+	sh utilities/extractorigpub.sh < $< > $@
 
 perfbook-1c.tex: perfbook.tex
-	sed -e 's/,twocolumn//' -e 's/setboolean{twocolumn}{true}/setboolean{twocolumn}{false}/' < perfbook.tex > perfbook-1c.tex
+	sed -e 's/,twocolumn//' -e 's/setboolean{twocolumn}{true}/setboolean{twocolumn}{false}/' < $< > $@
 
 perfbook-hb.tex: perfbook.tex
-	sed -e 's/,twocolumn/&,letterpaperhb/' -e 's/setboolean{hardcover}{false}/setboolean{hardcover}{true}/' < perfbook.tex > perfbook-hb.tex
+	sed -e 's/,twocolumn/&,letterpaperhb/' -e 's/setboolean{hardcover}{false}/setboolean{hardcover}{true}/' < $< > $@
 
 # Rules related to perfbook_html are removed as of May, 2016
 
@@ -139,9 +139,8 @@ clean:
 	find . -name '*.aux' -o -name '*.blg' \
 		-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 perfbook_flat.tex perfbook*.out perfbook-*.tex
 	rm -f $(LATEXGENERATED)
-	rm -f perfbook-hb.out perfbook-1c.tex perfbook-hb.tex
 	rm -f extraction
 
 distclean: clean
-- 
2.7.4


--
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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux