Fix log output by changing __FILE__

This commit is contained in:
Jordan Bancino 2023-01-06 23:00:18 +00:00
parent ea1828e95e
commit 7cd9fe8bd7
2 changed files with 14 additions and 8 deletions

View file

@ -1,4 +1,4 @@
.Dd $Mdocdate: December 28 2022 $
.Dd $Mdocdate: January 6 2023 $
.Dt TELODENDRIA-CHANGELOG 7
.Os Telodendria Project
.Sh NAME
@ -104,6 +104,9 @@ database that contains cached objects.
.It
Fixed a memory leak that would occur when deleting database
objects.
.It
Fixed a few non-fatal memory warnings that would show up
as a result of passing a constant string into certain APIs.
.El
.Pp
Misc:
@ -121,6 +124,9 @@ files. This makes it easier to release
versions.
.It
Fix whitespace issues in various shell scripts.
.It
Fixed the debug log output so that it only shows the file name,
not the entire file path in the repository.
.El
.Sh v0.1.0
.Pp

View file

@ -23,7 +23,6 @@
: "${CVS_TAG:=Telodendria-$(echo $TELODENDRIA_VERSION | sed 's/\./_/g')}"
: "${DEFINES:=-D_DEFAULT_SOURCE -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}"
: "${INCLUDES:=-Isrc/include}"
: "${CC:=cc}"
: "${CFLAGS:=-Wall -Wextra -pedantic -ansi -O3}"
@ -84,28 +83,29 @@ setsubst() {
# Build the source code, and generate the 'build/telodendria'
# binary.
recipe_build() {
mkdir -p build
cd src
mkdir -p ../build
do_rebuild=0
objs=""
for src in $(find src -name '*.c'); do
obj=$(echo "$src" | sed -e 's/^src/build/' -e 's/\.c$/\.o/')
for src in $(find . -name '*.c' | cut -d '/' -f 2-); do
obj=$(echo "../build/$src" | sed -e 's/\.c$/\.o/')
objs="$objs $obj"
if [ $(mod_time "$src") -ge $(mod_time "$obj") ]; then
echo "CC $(basename $obj)"
obj_dir=$(dirname "$obj")
mkdir -p "$obj_dir"
if ! $CC $CFLAGS -c -o "$obj" "$src"; then
if ! $CC $CFLAGS -Iinclude -c -o "$obj" "$src"; then
exit 1
fi
do_rebuild=1
fi
done
if [ $do_rebuild -eq 1 ] || [ ! -f "build/$PROG" ]; then
if [ $do_rebuild -eq 1 ] || [ ! -f "../build/$PROG" ]; then
echo "LD $PROG"
$CC $LDFLAGS -o "build/$PROG" $objs
$CC $LDFLAGS -o "../build/$PROG" $objs
else
echo "Up to date."
fi