@@ -83,7 +83,7 @@ website_dir := static_website_html
8383website_assets := $(wildcard ../website/assets/* )
8484ruby_src := ../website/modify_build.rb $(website_assets )
8585ruby_pkg := ../website/Gemfile ../website/Gemfile.lock
86- # }}}
86+ # }}}
8787
8888# Internal build rules {{{
8989# Flowcharts {{{
@@ -118,7 +118,7 @@ book_sans_serif/book_sans_serif.pdf: $(src_all)
118118epub/% .epub : % .tex $(ebook_src ) cover/cover-page.xbb
119119 $(EBOOK ) $<
120120
121- copy_ebook_files : build_ebook
121+ copy_ebook_files : ebook
122122 $(RSYNC ) --exclude ' *.png' epub_build/book-epub/ bw-book-epub/
123123
124124# Now that we have built the ebook we will generate 2 more versions
@@ -130,30 +130,33 @@ copy_ebook_files: build_ebook
130130
131131# We do not convert SVG to B&W or lower res for now as they are super small
132132# anyway
133- bw-book-epub/OEBPS/% .jpg : % .jpg
134- mkdir -p $(dir $@ )
133+ bw-book-epub-dir :
134+ mkdir -p bw-book-epub/OEBPS
135+
136+ bw-book-epub/OEBPS/% .jpg : % .jpg | bw-book-epub-dir
135137 $(CONVERT_PIC ) $< $(REDUCE_PIC ) $@
136138
137- bw-book-epub/OEBPS/% .png : % .png
138- mkdir -p $(dir $@ )
139+ bw-book-epub/OEBPS/% .png : % .png | bw-book-epub-dir
139140 $(CONVERT_PIC ) $< $(REDUCE_PIC ) $@
140141
141142epub/bw_book.epub : copy_ebook_files $(bw_images )
142143 cd bw-book-epub; zip -q0X ../epub/bw_book.epub mimetype
143144 cd bw-book-epub; zip -q9XrD ../epub/bw_book.epub ./
144145
145- # Now the low res
146+ # Now the low res | low-res-book-epub-dir
147+ low-res-book-epub-dir :
148+ mkdir -p low-res-book-epub/OEBPS
149+
146150copy_ebook_files_low_res : ebook
147151 $(RSYNC ) epub_build/book-epub/ low-res-book-epub/
148152
149- low-res-book-epub/OEBPS/% .jpg : % .jpg
150- mkdir -p $(dir $@ )
153+ low-res-book-epub/OEBPS/% .jpg : % .jpg | low-res-book-epub-dir
151154 $(CONVERT_PIC ) $< $(REDUCE_PIC_COLOR ) $@
152155
153156epub/low_res_book.epub : copy_ebook_files_low_res $(low_res_images )
154157 cd low-res-book-epub; zip -q0X ../epub/low_res_book.epub mimetype
155158 cd low-res-book-epub; zip -q9XrD ../epub/low_res_book.epub ./
156- # }}}
159+ # }}}
157160
158161# Website {{{
159162# ##################################
@@ -186,7 +189,7 @@ export_figures: pdf $(tgt_figures)
186189# }}}
187190
188191# User level targets {{{
189- # Build targets{{{
192+ # Build targets {{{
190193.PHONY : all
191194all : bake
192195
@@ -200,9 +203,9 @@ sans_serif: book_sans_serif/book_sans_serif.pdf
200203ebook : epub/book.epub
201204bw_ebook : epub/bw_book.epub
202205low_res_ebook : epub/low_res_book.epub
203- # }}}
206+ # }}}
204207
205- # Old target names are disabled with helpful help message # {{{
208+ # Old target names are disabled with helpful help message {{{
206209build_pdf :
207210 @echo " build_pdf target is not supported anymore, please use make pdf"
208211 @exit
@@ -221,7 +224,7 @@ build_bw_ebook:
221224build_low_res_ebook :
222225 @echo " build_low_res_ebook target is not supported anymore, please use make low_res_ebook"
223226 @exit
224- # }}}
227+ # }}}
225228
226229# Top level releases rules {{{
227230.PHONY : bake release_serif release_sans_serif
@@ -282,7 +285,7 @@ mrproper: clean
282285 -rm -rf book_serif/ book_sans_serif/
283286 -rm -rf epub/ epub_build/ bw-book-epub/ low-res-book-epub/
284287 -rm -rf website_build/ $(website_dir )
285- # }}}
288+ # }}}
286289
287290# Help {{{
288291# ##################################
0 commit comments