Fix bundle re-run (#165)

* Use standard practices for website build

- Declare your dependencies
- Do not rebuild unless dependencies changed
- Cleanup after yourself
- Document your targets
- COMMANDS in upper case and variables/rules in lowercase

* Prevent bundle install to re-run

Split it into two separate targets one for installing env and one for
actually reworking the html.

* Fix typo in makefile comment

Co-authored-by: Hendrik Kleinwaechter <hendrik.kleinwaechter@gmail.com>

---------

Co-authored-by: Hendrik Kleinwaechter <hendrik.kleinwaechter@gmail.com>
This commit is contained in:
cedounet
2023-08-07 15:41:39 +01:00
committed by GitHub
parent 0e3f190f5f
commit 82c23fe8b2

View File

@@ -37,7 +37,7 @@ website_src := $(src_all) website.cfg
website_assets := $(wildcard ../website/assets/*)
ruby_src := ../website/modify_build.rb $(website_assets)
ruby_src += ../website/Gemfile ../website/Gemfile.lock
ruby_pkg := ../website/Gemfile ../website/Gemfile.lock
tgt_figures := $(patsubst %.tex, %.png,$(src_figures))
@@ -250,9 +250,17 @@ $(website_dir)/book.html: $(website_src)
html: $(website_dir)/book.html
cp $< $(website_dir)/index.html
# Because packages will be installed in hard to predict places use a file as
# marker..
../website/_bundle_install_done: $(ruby_pkg)
- rm ../website/$@
cd ../website && bundle install
touch ../website/$@
# TODO: this will run every single time, but is so fast we don't really care
.PHONY: website
website: html $(ruby_src)
cd ../website && bundle install && ruby modify_build.rb
website: html ../website/_bundle_install_done $(ruby_src)
cd ../website && ruby modify_build.rb
# Debug Stuff from now on
.PHONY: show_tools_version