diff --git a/site/index.html b/site/index.html index 995fedc..bfde38d 100644 --- a/site/index.html +++ b/site/index.html @@ -231,15 +231,15 @@ should compile on almost any compiler and operating system with minimal effort, but the following compilers and operating systems are known to work:
make.sh
and remove
+Tiny C Compiler (Note: must remove
-Wl,-static -Wl,-gc-sections
from LDFLAGS
)
on OpenBSD.
make.sh
.
+flags.
find
, stat
,
@@ -383,7 +383,7 @@ on my list for that:
anoncvs
account is just anoncvs
.make.sh
recipes, and what they domake.sh
recipes, and what they do
@@ -659,6 +659,121 @@ create the MXID
, and reads the password database to
get your configured display name. It also uses vi
as
the default editor, which may not be suitable for all developers.
+You can invoke td
recipes with the following syntax:
+
+Multiple recipes can be invoked in a single run of td
.
+At the moment, recipes are run unconditionally; that is, even if parts
+of a recipe fail, all following recipes still run.
+
+Here is a complete list of recipes currently supported by
+td
, and a description of what they do. Some recipes can
+alter their behavior based on certain environment variables. Those
+variables are also documented here.
+
build
: Build the source code, and generate the
+build/telodendria
binary. This is the default
+recipe; that is, it runs if no recipes are given as arguments to
+td
. The build recipe is incremental; it only rebuilds
+sources that have been modified since the last build, which makes
+builds faster. This recipe makes use of many environment variables:
+CFLAGS
: Compiler flags to generate object files.LDFLAGS
: Compiler flags to link the output binaryCC
: The compiler to use.PROG
: The name of the output binaryDEFINES
: Global preprocessor definitionsINCLUDES
: Header directories to make availableTELODENDRIA_VERSION
also makes its way into the output
+binary, but it is primarily used for generating releases.
+clean
: Remove the build/
directory, which
+effectively cleans the source tree. Note that build
does
+not place anything outside of build/
, so this is
+functionally equivalent to running rm -r build
.
+format
: Make sure the source code copyright headers are
+up to date, and format the source code using the system's
+indent(1)
command. This should be run before generating
+patch files, to ensure that the code follows the project conventions.
+Note that the provided .indent.pro
assumes an OpenBSD
+indent
, which may cause the GNU implementation to choke.
+test
: Run all of the unit tests, and report the results.
+It is highly recommended to ensure that the tests all pass before
+submitting a patch, because patches that break the tests are likely
+to be rejected.
+site
: Deploy the Telodendria website by copying the
+required files to a web root. The web root is defined by the
+TELODENDRIA_PUB
environment variable. This is mainly
+used to deploy the official website, but it can be used to set up a
+local development site if absolutely neccessary.
+release
: Generate a release tarball, checksum and sign it,
+and push it into the web root. The web root is defined by the
+TELODENDRIA_PUB
environment variable. You may also have
+to set CVSROOT
to the official CVS repository of
+Telodendria. If you want to create a release tarball for an
+older version, set TELODENDRIA_VERSION
. If you want to
+generate a release tarball for the latest code, set
+CVS_TAG
to HEAD
. If you want to sign the
+generated tarball, set TELODENDRIA_SIGNIFY_SECRET
to a
+signify
private key file. This is mainly used to deploy
+releases to the official website, but it can be used to independently
+mirror Telodendria releases from the official CVS repository.
+patch
: Generate a formatted patch file. The
+Telodendria project isn't super picky about how patches look
+as long as they apply cleanly, but this recipe generates patches in
+the format we like them. It makes them easy to read. This recipe will
+use the EDITOR
variable to open your formatted patch in
+your preferred editor. If no EDITOR
is specified, then
+vi
is used. For more details on how this recipe works,
+read Submitting Patches. This
+recipe also makes use of PATCHSET
, MXID
,
+and DISPLAY_NAME
.
+diff
: Generate a temporary preview patch that is
+opened in the default pager. This recipe uses the PAGER
+variable to preview patches. If no PAGER
is set, then
+less -F
is used as the default. This can be used for
+quickly previewing patches. Setting PATCHSET
allows you
+to only preview certain changes; see
+Submitting Patches for more
+information on how PATCHSET
works.
+
+Any environment variables noted above that td
recipes
+use can be specified in a .env
file in the root of the
+Telodendria
directory. This saves you from constantly
+having to set the environment variables in your shell, as well as
+from having to pollute your user environment with Telodendria
+variables. td
will automatically include the
+.env
file on every run.
+
td
will source the .env
file, which means
+it executes it like a shell script. Any shell code inside of
+.env
will be executed every time td
is
+run.
+Telodendria aims at remaining as minimal as possible. This doesn't @@ -702,13 +817,14 @@ Date: Fri Jul 29 03:21:21 PM EDT 2022 Subject: Document Patch Procedure
-As much information as possible should be filled out for you, such as the
-date. An attempt to fill out the From
header was also made,
-but the information there can be made more accurate by setting
-MXID
to your Matrix ID, and DISPLAY_NAME
to your
-real name. The Subject
should very briefly describe what
-the patch is about. Below these headers, write a more in-depth
-description of the patch.
+As much information as possible should be filled out for you, such as
+the date. An attempt to fill out the From
header was also
+made, but the information there can be made more accurate by setting
+MXID
to your Matrix ID, and DISPLAY_NAME
to
+your real name in your environment, or the .env
file.
+The Subject
should very briefly describe what the patch
+is about. Below these headers, write a more in-depth description of
+the patch.
Then, send the resulting patch file to diff --git a/tools/bin/td b/tools/bin/td index c34be28..5f40a03 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -11,15 +11,6 @@ # handle building the code, it also handles formatting it, as well # as generating patch files. -# If a .env file exists in the current directory, we load it. -# As Telodendria's build infrastructure relies heavily on -# environment variables, we allow users to specify their -# Telodendria-specific variables in a dedicated .env so they don't -# have to pollute their environment. -if [ -f "$(pwd)/.env" ]; then - . "$(pwd)/.env" -fi - # # Set variables # @@ -31,14 +22,23 @@ fi : "${TELODENDRIA_VERSION:=0.0.0}" : "${CVS_TAG:=Telodendria-$(echo $TELODENDRIA_VERSION | sed 's/\./_/g')}" -: "${HEADERS:=-D_POSIX_C_SOURCE=199506L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" +: "${DEFINES:=-D_POSIX_C_SOURCE=199506L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" : "${INCLUDES:=-Isrc/include}" : "${CC:=cc}" -: "${CFLAGS:=-Wall -Wextra -pedantic -ansi -std=c89 -O3 $HEADERS $INCLUDES}" +: "${CFLAGS:=-Wall -Wextra -pedantic -ansi -std=c89 -O3 $DEFINES $INCLUDES}" : "${LDFLAGS:=-static -flto -fdata-sections -ffunction-sections -s -Wl,-static -Wl,-gc-sections}" : "${PROG:=telodendria}" +# If a .env file exists in the current directory, we load it. +# As Telodendria's build infrastructure relies heavily on +# environment variables, we allow users to specify their +# Telodendria-specific variables in a dedicated .env so they don't +# have to pollute their environment. +if [ -f "$(pwd)/.env" ]; then + . "$(pwd)/.env" +fi + # Check the modificiation time of a file. This is used to do # incremental builds; we only want to rebuild files that have # have changed. @@ -208,7 +208,14 @@ recipe_patch() { } recipe_diff() { - cvs -q diff -uNp | less + tmp_patch="/tmp/telodendria-$(date +%s).patch" + cvs -q diff -uNp $PATCHSET > "$tmp_patch" + if [ -z "$PAGER" ]; then + PAGER="less -F" + fi + + $PAGER "$tmp_patch" + rm "$tmp_patch" } # Execute the user-specified recipes.