|
|
|
|
@@ -30,7 +30,7 @@ endif
|
|
|
|
|
# and building everything take a long time.
|
|
|
|
|
.DEFAULT_GOAL := serif
|
|
|
|
|
|
|
|
|
|
# List all files that are dependencies {{{
|
|
|
|
|
# Dependencies {{{
|
|
|
|
|
chapters = baking basics bread-types cover flour-types history intro mix-ins\
|
|
|
|
|
non-wheat-sourdough sourdough-starter storing-bread troubleshooting\
|
|
|
|
|
wheat-sourdough glossary
|
|
|
|
|
@@ -75,7 +75,7 @@ low_res_images := $(filter-out %.png, $(low_res_images))
|
|
|
|
|
# All together.
|
|
|
|
|
src_all := $(src_tex) $(src_figures) $(src_tables) $(images) $(src_plots)
|
|
|
|
|
|
|
|
|
|
# And format specific configurations
|
|
|
|
|
# Format specific configuration files
|
|
|
|
|
ebook_src := $(src_all) tex4ebook.cfg book.mk4 book-ebook.css
|
|
|
|
|
|
|
|
|
|
website_src := $(src_all) website.cfg style.css
|
|
|
|
|
@@ -83,7 +83,9 @@ website_dir := static_website_html
|
|
|
|
|
website_assets := $(wildcard ../website/assets/*)
|
|
|
|
|
ruby_src := ../website/modify_build.rb $(website_assets)
|
|
|
|
|
ruby_pkg := ../website/Gemfile ../website/Gemfile.lock
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# Internal build rules {{{
|
|
|
|
|
# Flowcharts {{{
|
|
|
|
|
# TODO: check if it works on github CI
|
|
|
|
|
%.png: %.tex
|
|
|
|
|
@@ -98,7 +100,7 @@ ruby_pkg := ../website/Gemfile ../website/Gemfile.lock
|
|
|
|
|
ebb -x $<
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# pdf {{{
|
|
|
|
|
# Pdf {{{
|
|
|
|
|
# Default rules for pdf, getting overwritten when built in a sub-directory
|
|
|
|
|
%.pdf: %.tex
|
|
|
|
|
$(LATEX) $<
|
|
|
|
|
@@ -116,7 +118,7 @@ book_sans_serif/book_sans_serif.pdf: $(src_all)
|
|
|
|
|
epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb
|
|
|
|
|
$(EBOOK) $<
|
|
|
|
|
|
|
|
|
|
copy_ebook_files: build_ebook
|
|
|
|
|
copy_ebook_files: ebook
|
|
|
|
|
$(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/
|
|
|
|
|
|
|
|
|
|
# Now that we have built the ebook we will generate 2 more versions
|
|
|
|
|
@@ -181,9 +183,10 @@ website: html ../website/_bundle_install_done $(ruby_src)
|
|
|
|
|
export_figures: pdf $(tgt_figures)
|
|
|
|
|
cd figures/ && bash export_figures.sh
|
|
|
|
|
# }}}
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# Now with the targets {{{
|
|
|
|
|
# Expected usual targets first
|
|
|
|
|
# User level targets {{{
|
|
|
|
|
# Build targets {{{
|
|
|
|
|
.PHONY: all
|
|
|
|
|
all: bake
|
|
|
|
|
|
|
|
|
|
@@ -191,23 +194,36 @@ all: bake
|
|
|
|
|
.PHONY: pdf serif sans_serif ebook
|
|
|
|
|
|
|
|
|
|
pdf: serif sans_serif
|
|
|
|
|
|
|
|
|
|
serif: book_serif/book.pdf
|
|
|
|
|
sans_serif: book_sans_serif/book_sans_serif.pdf
|
|
|
|
|
|
|
|
|
|
ebook: epub/book.epub
|
|
|
|
|
bw_ebook: epub/bw_book.epub
|
|
|
|
|
low_res_ebook: epub/low_res_book.epub
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# We keep the old target names for backward compatibility
|
|
|
|
|
build_pdf: pdf
|
|
|
|
|
build_serif_pdf: serif
|
|
|
|
|
build_sans_serif_pdf: sans_serif
|
|
|
|
|
build_ebook: ebook
|
|
|
|
|
build_bw_ebook: bw_ebook
|
|
|
|
|
build_low_res_ebook: low_res_ebook
|
|
|
|
|
# Old target names are disabled with helpful help message {{{
|
|
|
|
|
build_pdf:
|
|
|
|
|
@echo "build_pdf target is not supported anymore, please use make pdf"
|
|
|
|
|
@exit
|
|
|
|
|
build_serif_pdf:
|
|
|
|
|
@echo "build_serif_pdf target is not supported anymore, please use make serif"
|
|
|
|
|
@exit
|
|
|
|
|
build_sans_serif_pdf:
|
|
|
|
|
@echo "build_sans_serif_pdf target is not supported anymore, please use make sans_serif"
|
|
|
|
|
@exit
|
|
|
|
|
build_ebook:
|
|
|
|
|
@echo "build_ebook target is not supported anymore, please use make ebook"
|
|
|
|
|
@exit
|
|
|
|
|
build_bw_ebook:
|
|
|
|
|
@echo "build_bw_ebook target is not supported anymore, please use make bw_ebook"
|
|
|
|
|
@exit
|
|
|
|
|
build_low_res_ebook:
|
|
|
|
|
@echo "build_low_res_ebook target is not supported anymore, please use make low_res_ebook"
|
|
|
|
|
@exit
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# top level releases rules
|
|
|
|
|
# Top level releases rules {{{
|
|
|
|
|
.PHONY: bake release_serif release_sans_serif
|
|
|
|
|
bake: release_serif release_sans_serif website
|
|
|
|
|
|
|
|
|
|
@@ -243,12 +259,9 @@ clean_figures:
|
|
|
|
|
clean_ebook_build:
|
|
|
|
|
-rm epub_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html}
|
|
|
|
|
-rm epub_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref}
|
|
|
|
|
-rm epub_build/{book.css,content.opf} epub_build/book-epub/mimetype
|
|
|
|
|
-rm epub_build/book*x.svg
|
|
|
|
|
-rm epub_build/book.css
|
|
|
|
|
-rm epub_build/content.opf
|
|
|
|
|
-rm epub_build/book-epub/mimetype
|
|
|
|
|
-rm -rf epub_build/book-epub/META-INF
|
|
|
|
|
-rm -rf epub_build/book-epub/OEBPS
|
|
|
|
|
-rm -rf epub_build/book-epub/META-INF epub_build/book-epub/OEBPS
|
|
|
|
|
|
|
|
|
|
clean_website_build:
|
|
|
|
|
-rm website_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html}
|
|
|
|
|
@@ -265,14 +278,10 @@ mrproper: clean
|
|
|
|
|
$(CLEAN) -C -output-directory=book_serif book.tex
|
|
|
|
|
$(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex
|
|
|
|
|
-rm figures/*.png
|
|
|
|
|
-rm -rf epub/
|
|
|
|
|
-rm -rf release/
|
|
|
|
|
-rm -rf book_serif/
|
|
|
|
|
-rm -rf book_sans_serif/
|
|
|
|
|
-rm -rf *book-epub/
|
|
|
|
|
-rm -rf epub_build/
|
|
|
|
|
-rm -rf website_build/
|
|
|
|
|
-rm -rf $(website_dir)
|
|
|
|
|
-rm -rf book_serif/ book_sans_serif/
|
|
|
|
|
-rm -rf epub/ epub_build/ bw-book-epub/ low-res-book-epub/
|
|
|
|
|
-rm -rf website_build/ $(website_dir)
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# Help {{{
|
|
|
|
|
@@ -333,8 +342,9 @@ help:
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "set DEBUG i.e make DEBUG=1 ebook to add debug flags to commands"
|
|
|
|
|
# }}}
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
|
|
# Debug Stuff from now on {{{
|
|
|
|
|
# Debug Stuff {{{
|
|
|
|
|
###################################
|
|
|
|
|
|
|
|
|
|
# Verify your spelling and TeX warnings {{{
|
|
|
|
|
@@ -367,7 +377,7 @@ quick_ebook: cover/cover-page.xbb # run latex only once no biber, ref etc...
|
|
|
|
|
$(EBOOK) --mode draft book.tex
|
|
|
|
|
|
|
|
|
|
show_tools_version: # Show version of tools used on the build machine {{{
|
|
|
|
|
- $(GIT) log -1 --pretty=%B
|
|
|
|
|
-$(GIT) log -5 --pretty="%h: %s by %an on %as"
|
|
|
|
|
@echo ""
|
|
|
|
|
-uname -a
|
|
|
|
|
@echo ""
|
|
|
|
|
|