From e0a66ad58ab8d7b781bfb6d7001384ad193660c0 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 10 Aug 2022 10:49:17 -0400 Subject: [PATCH] Add DEBUG to td. --- site/index.html | 4 ++++ tools/bin/td | 6 ++++++ 2 files changed, 10 insertions(+) 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 binary
  • DEFINES: Global preprocessor definitions
  • INCLUDES: Header directories to make available
  • +
  • DEBUG: 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.