[PATCH 2/2] Makefile: Use secondary expansion

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

 



>From 3fc3583818c9103ef2d1c01516b362c4b6768604 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Mon, 10 Oct 2016 00:10:27 +0900
Subject: [PATCH 2/2] Makefile: Use secondary expansion

By using secondary expansion, abbreviated targets' dependencies
can be expressed as a single rule.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 Makefile | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 6e6d66b..eb83af4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,9 @@ LATEXSOURCES = \
 
 LATEXGENERATED = qqz.tex contrib.tex origpub.tex
 
-PDFTARGETS := perfbook.pdf perfbook-1c.pdf perfbook-hb.pdf
+ABBREVTARGETS := 1c hb
+
+PDFTARGETS := perfbook.pdf $(foreach v,$(ABBREVTARGETS),perfbook-$(v).pdf)
 
 EPSSOURCES_FROM_TEX := \
 	SMPdesign/DiningPhilosopher5.eps \
@@ -58,15 +60,11 @@ else
 	targ = $(default)
 endif
 
-.PHONY: all touchsvg clean distclean neatfreak 1c 2c hb ls-unused
+.PHONY: all touchsvg clean distclean neatfreak 2c ls-unused $(ABBREVTARGETS)
 all: $(targ)
 
-1c: perfbook-1c.pdf
-
 2c: perfbook.pdf
 
-hb: perfbook-hb.pdf
-
 $(PDFTARGETS): %.pdf: %.tex %.bbl
 	sh utilities/runlatex.sh $(basename $@)
 
@@ -156,3 +154,6 @@ ls-unused:
 neatfreak: distclean
 	# Don't forget to regenerate the .pdf from each .svg file
 	find . -name '*.pdf' | xargs rm -f
+
+.SECONDEXPANSION:
+$(ABBREVTARGETS): %: perfbook-$$@.pdf
-- 
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