mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-11-09 04:31:11 -06:00
Fix epub build and remove redudant mkdir calls
1) ebook was still using the old target 2) Do not call mkdir -p for every single image conversion
This commit is contained in:
@@ -118,7 +118,7 @@ book_sans_serif/book_sans_serif.pdf: $(src_all)
|
|||||||
epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb
|
epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb
|
||||||
$(EBOOK) $<
|
$(EBOOK) $<
|
||||||
|
|
||||||
copy_ebook_files: build_ebook
|
copy_ebook_files: ebook
|
||||||
$(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/
|
$(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/
|
||||||
|
|
||||||
# Now that we have built the ebook we will generate 2 more versions
|
# Now that we have built the ebook we will generate 2 more versions
|
||||||
@@ -130,24 +130,27 @@ copy_ebook_files: build_ebook
|
|||||||
|
|
||||||
# We do not convert SVG to B&W or lower res for now as they are super small
|
# We do not convert SVG to B&W or lower res for now as they are super small
|
||||||
# anyway
|
# anyway
|
||||||
bw-book-epub/OEBPS/%.jpg: %.jpg
|
bw-book-epub-dir:
|
||||||
mkdir -p $(dir $@)
|
mkdir -p bw-book-epub/OEBPS
|
||||||
|
|
||||||
|
bw-book-epub/OEBPS/%.jpg: %.jpg | bw-book-epub-dir
|
||||||
$(CONVERT_PIC) $< $(REDUCE_PIC) $@
|
$(CONVERT_PIC) $< $(REDUCE_PIC) $@
|
||||||
|
|
||||||
bw-book-epub/OEBPS/%.png: %.png
|
bw-book-epub/OEBPS/%.png: %.png | bw-book-epub-dir
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(CONVERT_PIC) $< $(REDUCE_PIC) $@
|
$(CONVERT_PIC) $< $(REDUCE_PIC) $@
|
||||||
|
|
||||||
epub/bw_book.epub: copy_ebook_files $(bw_images)
|
epub/bw_book.epub: copy_ebook_files $(bw_images)
|
||||||
cd bw-book-epub; zip -q0X ../epub/bw_book.epub mimetype
|
cd bw-book-epub; zip -q0X ../epub/bw_book.epub mimetype
|
||||||
cd bw-book-epub; zip -q9XrD ../epub/bw_book.epub ./
|
cd bw-book-epub; zip -q9XrD ../epub/bw_book.epub ./
|
||||||
|
|
||||||
# Now the low res
|
# Now the low res | low-res-book-epub-dir
|
||||||
|
low-res-book-epub-dir:
|
||||||
|
mkdir -p low-res-book-epub/OEBPS
|
||||||
|
|
||||||
copy_ebook_files_low_res: ebook
|
copy_ebook_files_low_res: ebook
|
||||||
$(RSYNC) epub_build/book-epub/ low-res-book-epub/
|
$(RSYNC) epub_build/book-epub/ low-res-book-epub/
|
||||||
|
|
||||||
low-res-book-epub/OEBPS/%.jpg: %.jpg
|
low-res-book-epub/OEBPS/%.jpg: %.jpg | low-res-book-epub-dir
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(CONVERT_PIC) $< $(REDUCE_PIC_COLOR) $@
|
$(CONVERT_PIC) $< $(REDUCE_PIC_COLOR) $@
|
||||||
|
|
||||||
epub/low_res_book.epub: copy_ebook_files_low_res $(low_res_images)
|
epub/low_res_book.epub: copy_ebook_files_low_res $(low_res_images)
|
||||||
@@ -202,7 +205,7 @@ bw_ebook: epub/bw_book.epub
|
|||||||
low_res_ebook: epub/low_res_book.epub
|
low_res_ebook: epub/low_res_book.epub
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Old target names are disabled with helpful help message #{{{
|
# Old target names are disabled with helpful help message {{{
|
||||||
build_pdf:
|
build_pdf:
|
||||||
@echo "build_pdf target is not supported anymore, please use make pdf"
|
@echo "build_pdf target is not supported anymore, please use make pdf"
|
||||||
@exit
|
@exit
|
||||||
|
|||||||
Reference in New Issue
Block a user