From: Javier Fernández-Sanguino Date: Wed, 10 May 2017 19:35:03 +0000 (+0000) Subject: Do not make file rules depend on a PHONY target as this will make them run in all... X-Git-Tag: 20180215~76 X-Git-Url: http://git.projectaon.org/?a=commitdiff_plain;h=0dc16339f5c6a05f1e5fa0fea65debf6e633d3f9;p=project-aon.git Do not make file rules depend on a PHONY target as this will make them run in all cases, even when it is not required (target is updated). Instead, have the check individually in all the targets. Yes, this means repeating code, but prevents regeneration of all files unless XML changes git-svn-id: https://projectaon.org/data/trunk@2622 f6f3e2d7-ff33-0410-aaf5-b4bee2cdac11 --- diff --git a/common/epub/Makefile.common b/common/epub/Makefile.common index 4f3e86e..66201da 100644 --- a/common/epub/Makefile.common +++ b/common/epub/Makefile.common @@ -92,7 +92,8 @@ epub: $(EPUB) $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB): $(XMLFILE) $(EPUBSCRIPT) $(XSLFILES) cd $(AONROOTDIR) && perl $(EPUBSCRIPT) --language=$(BLANG) --font-files=$(FONTDIR) $(BASENAME) -$(EPUB): $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) ebook-convert +$(EPUB): $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } cp -p $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) . # Regenerate to include the covers properly within the Ebook and fix the EPUB ebook-convert $(EPUB) regen_$(EPUB) --cover $(COVERIMAGE) @@ -103,40 +104,45 @@ $(EPUB): $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) ebook-convert # Convert to other formats. For a full list of format that we can convert to using # Calibre see http://manual.calibre-ebook.com/cli/ebook-convert.html -ebook-convert: - @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } - # Generate the mobi file from the ePub (Mobipocket format) mobi: $(MOBI) -%.mobi: %.epub ebook-convert +%.mobi: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the pdb file from the ePub (eReader / Palm Media format) -%.pdb: %.epub ebook-convert +%.pdb: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the lrf file from the ePub (Broadband eBooks (BBeB) format) -%.lrf: %.epub ebook-convert +%.lrf: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the lit file from the ePub (Microsoft LIT format for Microsoft Reader) -%.lit: %.epub ebook-convert +%.lit: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the pdf file from the ePub -%.pdf: %.epub ebook-convert +%.pdf: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the snb file from the ePub -%.snb: %.epub ebook-convert +%.snb: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the pml file from the ePub -%.pml: %.epub ebook-convert +%.pml: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@ # Generate the fb2 file from the ePub (Fictionbook format used by BeBook, PocketBook, Cybook, Papyre and others) -%.fb2: %.epub ebook-convert +%.fb2: %.epub + @[ -x `which ebook-convert` ] || { echo "ERROR: Cannot find 'ebook-convert', please install Calibre" >&2; exit 1; } ebook-convert $< $@