X-Git-Url: http://git.projectaon.org/?a=blobdiff_plain;f=common%2Fepub%2FMakefile.common;h=195f876cee57ad80d9b3eaf68b296839da4b4f7b;hb=e7f566b346ce022528bca15b713fc763aa107003;hp=d6d9cfb8624dcfb4f70fd2e3f4c50e467e4939a8;hpb=99985fc98502ffa67a596f46596e60916725964e;p=project-aon.git diff --git a/common/epub/Makefile.common b/common/epub/Makefile.common index d6d9cfb..195f876 100644 --- a/common/epub/Makefile.common +++ b/common/epub/Makefile.common @@ -17,8 +17,8 @@ COVERIMAGE := $(AONROOTDIR)/$(BLANG)/jpeg/$(SERIES)/$(BASENAME)/skins/ebook/cove # Location of the font files, this is adjustable here in order to make it possible to run # the build scripts as not all developers might have the Souvernir fonts. -# Option 1 (to be used for Lone wolf series) - Souvenir font -# --------------------------------------------------------- +# Option 1 (to be used for the Lone wolf and Grey star series) - Souvenir font +# --------------------------------------------------------------------------- # Use this when buidling Lone Wolf books, using Souvenir fonts and make sure # the font is available in the directory you configure here. Note that the # fontfiles are *not* available in Project Aon's SVN repository as they are not @@ -27,7 +27,12 @@ COVERIMAGE := $(AONROOTDIR)/$(BLANG)/jpeg/$(SERIES)/$(BASENAME)/skins/ebook/cove # If using this configure, please make sure the following fonts are available in this directory: # SouvenirStd-DemiItalic.otf SouvenirStd-Demi.otf SouvenirStd-LightItalic.otf SouvenirStd-Light.otf -# FONTDIR := $(AONROOTDIR)/../fontfiles/ +ifeq ($(SERIES), lw) +FONTDIR := $(AONROOTDIR)/../fontfiles/ +endif +ifeq ($(SERIES), gs) +FONTDIR := $(AONROOTDIR)/../fontfiles/ +endif # Option 2 (to be used for Freway Warrior series builds) - Carlito font # --------------------------------------------------------------------- @@ -36,10 +41,28 @@ COVERIMAGE := $(AONROOTDIR)/$(BLANG)/jpeg/$(SERIES)/$(BASENAME)/skins/ebook/cove # repository which (at the time of this writting) are the Carlito font, which # is distributed with an Open Font license. +ifeq ($(SERIES), fw) FONTDIR := $(AONROOTDIR)/common/fonts/ - +endif # --------------------------------- END FONT SELECTION ----------------------------------------------------------- +ifndef FONTDIR +$(info FONTDIR is not defined, defauling to AONROOTDIR/common/fonts/) +FONTDIR := $(AONROOTDIR)/common/fonts/ +endif + +# Sanity checks before going further +ifndef SERIES +$(error WARNING: Book series is not defined, please define variable 'SERIES') +endif +ifndef BLANG +$(error WARNING: Book language is not defined, please define variable 'BLANG') +endif +ifndef BASENAME +$(error WARNING: Book basic name is not defined, please define variable 'BASENAME') +endif + + EPUB=$(BASENAME).epub MOBI=$(BASENAME).mobi PDB=$(BASENAME).pdb @@ -69,7 +92,9 @@ 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) +$(EPUB): $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) ebook-convert + @[ ! -x `which dbtoepub` ] || { echo "ERROR: Cannot find 'dbtoepub', please install this package" >&2; exit 1; } + dbtoepub -o $(BOOK) $(XMLFILE) >$(BOOK).log 2>&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) @@ -80,37 +105,40 @@ $(EPUB): $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) # 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 +%.mobi: %.epub ebook-convert ebook-convert $< $@ # Generate the pdb file from the ePub (eReader / Palm Media format) -%.pdb: %.epub +%.pdb: %.epub ebook-convert ebook-convert $< $@ # Generate the lrf file from the ePub (Broadband eBooks (BBeB) format) -%.lrf: %.epub +%.lrf: %.epub ebook-convert ebook-convert $< $@ # Generate the lit file from the ePub (Microsoft LIT format for Microsoft Reader) -%.lit: %.epub +%.lit: %.epub ebook-convert ebook-convert $< $@ # Generate the pdf file from the ePub -%.pdf: %.epub +%.pdf: %.epub ebook-convert ebook-convert $< $@ # Generate the snb file from the ePub -%.snb: %.epub +%.snb: %.epub ebook-convert ebook-convert $< $@ # Generate the pml file from the ePub -%.pml: %.epub +%.pml: %.epub ebook-convert ebook-convert $< $@ # Generate the fb2 file from the ePub (Fictionbook format used by BeBook, PocketBook, Cybook, Papyre and others) -%.fb2: %.epub +%.fb2: %.epub ebook-convert ebook-convert $< $@ @@ -156,4 +184,4 @@ clean: distclean: clean -rm -rf $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/ -.PHONY: all install publish clean distclean epub mobi +.PHONY: all install publish clean distclean epub mobi ebook-convert