diff --git a/site/index.html b/site/index.html index a74938f..401b5ae 100644 --- a/site/index.html +++ b/site/index.html @@ -880,6 +880,10 @@ builds faster. This recipe makes use of many environment variables:
PROG
: The name of the output binaryDEFINES
: Global preprocessor definitionsINCLUDES
: Header directories to make availableDEBUG
: If set to "1", append some debug flags to
+CFLAGS
, and wipe out any LDFLAGS
that
+would cause the output binary to be optimized. Also appends "-debug"
+to PROG
.TELODENDRIA_VERSION
also makes its way into the output
binary, but it is primarily used for generating releases.
diff --git a/tools/bin/td b/tools/bin/td
index 93c7a94..7215e38 100644
--- a/tools/bin/td
+++ b/tools/bin/td
@@ -39,6 +39,12 @@ if [ -f "$(pwd)/.env" ]; then
. "$(pwd)/.env"
fi
+if [ "$DEBUG" = "1" ]; then
+ CFLAGS="$CFLAGS -O0 -g"
+ LDFLAGS=""
+ PROG="$PROG-debug"
+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.