From ca1020b4d03bf7e3976b7cf0a2363cf6edd4e489 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 25 Jul 2023 22:48:29 -0700 Subject: [PATCH] =?UTF-8?q?Rename=20=E2=80=98bootstrap.*=E2=80=99=20->=20?= =?UTF-8?q?=E2=80=98build.*=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- GNUmakefile | 4 ++-- bootstrap.org => build.org | 16 ++++++++-------- index.org | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename bootstrap.org => build.org (89%) diff --git a/.gitignore b/.gitignore index 1dde023..06c7abe 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ # Built files /public /posts/index.org -/bootstrap.mk +/build.mk # Added automatically by `eldev init'. /.eldev diff --git a/GNUmakefile b/GNUmakefile index 09035f8..a7e6cb3 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,7 +1,7 @@ -%.mk: bootstrap.org +%.mk: build.org eldev emacs -quick -batch \ -eval "(package-initialize)" \ -load ob-tangle \ -eval "(org-babel-tangle-file \"$<\" \"$(PWD)/$@\" \"makefile\")" -include bootstrap.mk +include build.mk diff --git a/bootstrap.org b/build.org similarity index 89% rename from bootstrap.org rename to build.org index 5fe93a8..d52ae6a 100644 --- a/bootstrap.org +++ b/build.org @@ -1,15 +1,15 @@ -#+title: ryuslash's website's bootstrap +#+title: ryuslash's website's build's files #+subtitle: Literate configuration of how to build this site #+options: num:nil prop:t I'm a big fan of [[file:literate-programming.org][Literate Programming]], so I figured I'd make the builds for my website a literate configuration file as well. -First I need to bootstrap the bootstrap. This is the smallest make file that I can think to make to enable me to build the rest out. This make file is duplicated in both this file and the source code repository since I don't know of a way not to. +First I need to build the build files. This is the smallest make file that I can think to make to enable me to build the rest out. This make file is duplicated in both this file and the source code repository since I don't know of a way not to. First I specify that any =.mk= file should depend on /this/ file ({{{input-file}}}) and that it is generated by running =org-babel-tangle-file= on it. The =$<= is the first dependency and =$@= is the current target file (whatever =.mk= file we're generating). #+begin_src makefile :tangle no - %.mk: bootstrap.org + %.mk: build.org eldev emacs -quick -batch \ -eval "(package-initialize)" \ -load ob-tangle \ @@ -19,17 +19,17 @@ First I specify that any =.mk= file should depend on /this/ file ({{{input-file} After that it's just a matter of including the file I want. #+begin_src makefile :tangle no - include bootstrap.mk + include build.mk #+end_src -GNU Make (I don't know about other makes) will see if there is a recipe to make the file it wants to include and will try and run it before trying to include the file. This combined with our =%.mk= target ensures that make will always try to recreate the =bootstrap.mk= file when ={{{input-file}}}= is updated. +GNU Make (I don't know about other makes) will see if there is a recipe to make the file it wants to include and will try and run it before trying to include the file. This combined with our =%.mk= target ensures that make will always try to recreate the =build.mk= file when ={{{input-file}}}= is updated. * Makefile :PROPERTIES: -:header-args:makefile: :tangle bootstrap.mk +:header-args:makefile: :tangle build.mk :END: -This is the actual make file that builds and deploys my site. It's all put into the =bootstrap.mk= file and executed from there. The =%.mk= pattern rule thankfully doesn't get recognized as a make target, so the first target define in the included file is assumed to be the default target. +This is the actual make file that builds and deploys my site. It's all put into the =build.mk= file and executed from there. The =%.mk= pattern rule thankfully doesn't get recognized as a make target, so the first target define in the included file is assumed to be the default target. First off I specify the =help= target. This target parses the make files and extracts targets that include some comment on what they do. This target should come first so that it automatically becomes the default target. This way when I run just ~make~ I can see which targets I have available. I got this awesome trick from [[https://victoria.dev/][Victoria Drake]]’s article [[https://victoria.dev/blog/how-to-create-a-self-documenting-makefile/][How to create a self-documenting Makefile]]. @@ -87,7 +87,7 @@ clean: ## Remove all of the build files @rm -rvf *.elc @rm -rvf public @rm -rvf .org-timestamps - @rm -rvf posts/index.org bootstrap.mk + @rm -rvf posts/index.org build.mk #+end_src The =serve= target is a convenience target for when I'm writing or making modifications to the build and publish processes. It just starts a simple =php= web server in the =public/= directory so that I can easily load it in my browser. diff --git a/index.org b/index.org index 3a84495..1de55d7 100644 --- a/index.org +++ b/index.org @@ -29,7 +29,7 @@ The first topic I pay any attention to of course has to be [[file:emacs.org][Ema * My literate configuration -Every so often I get really drawn to remaking my entire configuration into a [[file:literate-programming.org][Literate Programming]] style. See my [[file:config/rincewind.org][latest attempt]] and also my [[file:bootstrap.org][literate build files]] for this website. +Every so often I get really drawn to remaking my entire configuration into a [[file:literate-programming.org][Literate Programming]] style. See my [[file:config/rincewind.org][latest attempt]] and also my [[file:build.org][literate build files]] for this website. * Topics