Merge pull request #271 from hendricius/cleanup_bw_makefile

Cleanup tech debt in build system
This commit is contained in:
cedounet
2023-11-04 16:35:28 +00:00
committed by GitHub
4 changed files with 23 additions and 52 deletions

40
.gitignore vendored
View File

@@ -12,53 +12,31 @@
*.run.xml *.run.xml
*.html *.html
*.dlog *.dlog
*.bak
*.opf
book/book.out book/book.out
.vscode/ .vscode/
book/book.synctex*
book/tikz-cache/*
book/bookch* book/bookch*
book/content.opf
book/output-epub
book/figures/*.png book/figures/*.png
book/figures/*.pdf book/figures/*.pdf
book/figures/*.in book/figures/*.in
book/tables/*.png
book/tables/*.pdf
book/release/*
book/book*.4ct book/book*.4ct
book/book*.4tc book/book*.4tc
book/book*.aux
book/book*.bbl
book/book*.bcf
book/book*.blg
book/book*.css book/book*.css
book/book*.dvi book/book*.dvi
book/book*.html
book/book*.idv book/book*.idv
book/book*.lg book/book*.lg
book/book*.log
book/book*.mobi
book/book*.azw3
book/book*.epub
book/book*.ncx book/book*.ncx
book/book*.out book/book*.out
book/book*.pdf
book/book*.run.xml
book/book*.tmp book/book*.tmp
book/book*.toc
book/book*.xref book/book*.xref
book/book*.html
book/book*.svg book/book*.svg
book/book-epub/ # Directories created during build
book/book-mobi/ book/book_sans_serif/*
book/book-azw3/ book/book_serif/*
*.bak
book_sans_serif/
book_serif/
release_sans_serif/
book/book_sans_serif-epub/
book/static_website_html/* book/static_website_html/*
book/website/static_website_html/*
book/epub/
book/book-epub/
book/bw-book-epub/* book/bw-book-epub/*
epub/ book/release/*
*.opf
website/static_website_html/*

View File

@@ -1,4 +1,2 @@
\def\isaccessible{1} \def\isaccessible{1}
% We have to use a symlink to book.tex to prevent tex4ebook to load book.ht4 \input{book.tex}
% before loading any other package and create conflicts
\input{sourdough_book.tex}

View File

@@ -1,6 +1,6 @@
# Macros for commands # Macros for commands
LATEX := latexmk -cd -pdflua -lualatex="lualatex -interaction=nonstopmode" -synctex=1 -use-make LATEX := latexmk -cd -pdflua -lualatex="lualatex -interaction=nonstopmode" -synctex=1 -use-make
EBOOK := tex4ebook --lua -d epub -c tex4ebook.cfg EBOOK := tex4ebook --lua -d epub -f epub -c tex4ebook.cfg
WEBSITE := make4ht --lua -c website.cfg -a debug -uf html5+tidy+common_domfilters+dvisvgm_hashes WEBSITE := make4ht --lua -c website.cfg -a debug -uf html5+tidy+common_domfilters+dvisvgm_hashes
CLEAN := latexmk -cd -lualatex -c -use-make CLEAN := latexmk -cd -lualatex -c -use-make
CHECK_1 := lacheck CHECK_1 := lacheck
@@ -87,33 +87,28 @@ book_serif/book.pdf: $(src_all)
book_sans_serif/book_sans_serif.pdf: $(src_all) book_sans_serif/book_sans_serif.pdf: $(src_all)
$(LATEX) -output-directory=book_sans_serif book_sans_serif.tex $(LATEX) -output-directory=book_sans_serif book_sans_serif.tex
.PHONY: bw_epub copy_ebook_files .PHONY: copy_ebook_files
epub/%.epub: %.tex $(src_all) cover/cover-page.xbb epub/%.epub: %.tex $(src_all) cover/cover-page.xbb
$(EBOOK) -f epub $< $(EBOOK) $<
bw-book-epub: copy_ebook_files: build_ebook
mkdir -p bw-book-epub
bw-book-epub/OEBPS: bw-book-epub
mkdir -p bw-book-epub/OEBPS
copy_ebook_files: build_ebook | bw-book-epub
$(RSYNC) book-epub/ bw-book-epub/ $(RSYNC) book-epub/ bw-book-epub/
# We not convert SVG to B&W or lower res for now as they are super small # We not convert SVG to B&W or lower res for now as they are super small
# anyway # anyway
bw-book-epub/OEBPS/%.jpg: %.jpg copy_ebook_files bw-book-epub/OEBPS/%.jpg: %.jpg
mkdir -p $(dir $@)
$(CONVERT_PIC) $< $(REDUCE_PIC) $@ $(CONVERT_PIC) $< $(REDUCE_PIC) $@
bw-book-epub/OEBPS/%.png: %.png copy_ebook_files bw-book-epub/OEBPS/%.png: %.png
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 -q9XrD ../epub/bw_book.epub ./ cd bw-book-epub; zip -q9XrD ../epub/bw_book.epub ./
bw_epub: epub/bw_book.epub | bw-book-epub
# Now with the rules # Now with the rules
# Expected usual rules first # Expected usual rules first
.PHONY: all .PHONY: all
@@ -279,14 +274,15 @@ website: html ../website/_bundle_install_done $(ruby_src)
cd ../website && ruby modify_build.rb cd ../website && ruby modify_build.rb
# Debug Stuff from now on # Debug Stuff from now on
.PHONY: quick show_tools_version printvars .PHONY: quick quick_ebook show_tools_version printvars
# Those 2 targets allow fast debug cycles but not resolving references etc # Those 2 targets allow fast debug cycles but not resolving references etc
# They also ignore dependencies and run each time you call them.
quick: # run latex only once no biber, no references etc... quick: # run latex only once no biber, no references etc...
$(LATEX) -e '$$max_repeat=1' -output-directory=book_serif book.tex $(LATEX) -e '$$max_repeat=1' -halt-on-error -output-directory=book_serif book.tex
quick_ebook: cover/cover-page.xbb # run latex only once no biber, ref etc... quick_ebook: cover/cover-page.xbb # run latex only once no biber, ref etc...
$(EBOOK) --mode draft -f epub book.tex $(EBOOK) --mode draft book.tex
show_tools_version: # Show version of tools used on the build machine show_tools_version: # Show version of tools used on the build machine
- git log -n 1 - git log -n 1

View File

@@ -1 +0,0 @@
book.tex