diff --git a/c3s/Makefile b/c3s/Makefile
index 52ad7b3..a25ab5d 100644
--- a/c3s/Makefile
+++ b/c3s/Makefile
@@ -11,7 +11,7 @@
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
-CLEANFILES = *.a c3s c3s.asan c3s.cov c3s.debug *.css *.gcno *.html *.o .libs *.lo
+CLEANFILES = *.a c3s c3s_asan c3s_cov c3s_debug *.css *.gcno *.html *.o .libs *.lo
CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
CLEANFILES += ${CLEANFILES_COV}
@@ -26,7 +26,7 @@ all:
${MAKE} debug
if ${HAVE_ASAN}; then ${MAKE} asan; fi
-asan: c3s.asan
+asan: c3s_asan
clean:
rm -rf ${CLEANFILES}
@@ -34,9 +34,9 @@ clean:
clean_cov:
rm -rf ${CLEANFILES_COV}
-cov: c3s.cov
+cov: c3s_cov
-debug: c3s.debug
+debug: c3s_debug
distclean:
rm -rf ${DISTCLEANFILES}
@@ -45,7 +45,7 @@ gcovr:
gcovr --gcov-executable ${GCOV} --html-details c3s.html
gdb_c3s: debug
- if [ -f c3s.debug.core ]; then gdb c3s.debug c3s.debug.core; else gdb c3s.debug; fi
+ if [ -f c3s_debug.core ]; then gdb c3s_debug c3s_debug.core; else gdb c3s_debug; fi
install:
install -m 755 c3s ${PREFIX}/bin
diff --git a/c3s/configure b/c3s/configure
index 20a3266..f781fdc 100755
--- a/c3s/configure
+++ b/c3s/configure
@@ -14,12 +14,14 @@
set -e
+export SRC_TOP="$(pwd)/.."
+
. ../config.subr
PROG=c3s
-PROG_ASAN=c3s.asan
-PROG_COV=c3s.cov
-PROG_DEBUG=c3s.debug
+PROG_ASAN=c3s_asan
+PROG_COV=c3s_cov
+PROG_DEBUG=c3s_debug
. ./sources.sh
@@ -55,19 +57,19 @@ pkg_config libmd
# Asan config
CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
LDFLAGS_ASAN="$LDFLAGS"
-LIBC3_ASAN=../libc3/libc3.asan.a
+LIBC3_ASAN=../libc3/libc3_asan.a
LIBS_ASAN="$LIBC3_ASAN $LIBS"
# Coverage config
CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs"
LDFLAGS_COV="$LDFLAGS"
-LIBC3_COV=../libc3/libc3.cov.a
+LIBC3_COV=../libc3/libc3_cov.a
LIBS_COV="$LIBC3_COV $LIBS"
# Debug config
CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -ggdb"
LDFLAGS_DEBUG="$LDFLAGS"
-LIBC3_DEBUG=../libc3/libc3.debug.a
+LIBC3_DEBUG=../libc3/libc3_debug.a
LIBS_DEBUG="$LIBC3_DEBUG $LIBS"
# Main config
diff --git a/config.subr b/config.subr
index eeac8f6..5ff4699 100644
--- a/config.subr
+++ b/config.subr
@@ -1,6 +1,6 @@
#!/bin/sh
## c3
-## Copyright 2022 kmx.io <contact@kmx.io>
+## Copyright 2022,2023 kmx.io <contact@kmx.io>
##
## Permission is hereby granted to use this software excepted
## on Apple computers granted the above copyright notice and
@@ -11,7 +11,6 @@
## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
-
set -e
echo "$(basename "$PWD")/$(basename "$0")"
@@ -122,7 +121,7 @@ SOURCES_SH=".sources.sh.tmp"
VER=0.1
echo "VER = $VER" >> ${CONFIG_MK}
-echo "C3_TOP = $C3_TOP" >> ${CONFIG_MK}
+echo "SRC_TOP = $SRC_TOP" >> ${CONFIG_MK}
if [ "x$CC" = "x" ]; then
if test -n $(which cc); then
@@ -170,13 +169,7 @@ if [ "x$LIBTOOL" = "x" ]; then
fi
echo "LIBTOOL = $LIBTOOL" >> ${CONFIG_MK}
-if [ "x$PREFIX" = "x" ]; then
- if [ -d "$HOME/.c3" ]; then
- PREFIX="$HOME/.c3"
- else
- PREFIX=/usr/local
- fi
-fi
+PREFIX="${PREFIX:-/usr/local}"
echo "PREFIX = $PREFIX" >> ${CONFIG_MK}
if [ "x$OWNER" = "x" ]; then
diff --git a/configure b/configure
index 9d092b1..e694ae4 100755
--- a/configure
+++ b/configure
@@ -14,9 +14,9 @@
set -e
-export C3_TOP="$(pwd)"
+export SRC_TOP="$(pwd)"
-PREFIX=${PREFIX:-/usr/local}
+PREFIX="${PREFIX:-/usr/local}"
if [ "x$1" = "x--prefix" ]; then
PREFIX="$2"
shift 2
diff --git a/ic3/Makefile b/ic3/Makefile
index 94487fe..536c96d 100644
--- a/ic3/Makefile
+++ b/ic3/Makefile
@@ -11,7 +11,7 @@
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
-CLEANFILES = *.a ic3 ic3.asan ic3.cov ic3.debug *.css *.gcno *.html *.o .libs *.lo
+CLEANFILES = *.a ic3 ic3_asan ic3_cov ic3_debug *.css *.gcno *.html *.o .libs *.lo
CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
CLEANFILES += ${CLEANFILES_COV}
@@ -26,7 +26,7 @@ all:
${MAKE} debug
if ${HAVE_ASAN}; then ${MAKE} asan; fi
-asan: ic3.asan
+asan: ic3_asan
clean:
rm -rf ${CLEANFILES}
@@ -34,9 +34,9 @@ clean:
clean_cov:
rm -rf ${CLEANFILES_COV}
-cov: ic3.cov
+cov: ic3_cov
-debug: ic3.debug
+debug: ic3_debug
distclean:
rm -rf ${DISTCLEANFILES}
@@ -45,7 +45,7 @@ gcovr:
gcovr --gcov-executable ${GCOV} --html-details ic3.html
gdb_ic3: debug
- if [ -f ic3.debug.core ]; then gdb ic3.debug ic3.debug.core; else gdb ic3.debug; fi
+ if [ -f ic3_debug.core ]; then gdb ic3_debug ic3_debug.core; else gdb ic3_debug; fi
install:
install -m 755 ic3 ${PREFIX}/bin
diff --git a/ic3/configure b/ic3/configure
index 14151aa..00d0af0 100755
--- a/ic3/configure
+++ b/ic3/configure
@@ -14,12 +14,14 @@
set -e
+export SRC_TOP="$(pwd)/.."
+
. ../config.subr
PROG=ic3
-PROG_ASAN=ic3.asan
-PROG_COV=ic3.cov
-PROG_DEBUG=ic3.debug
+PROG_ASAN=ic3_asan
+PROG_COV=ic3_cov
+PROG_DEBUG=ic3_debug
. ./sources.sh
@@ -55,19 +57,19 @@ pkg_config libmd
# Asan config
CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
LDFLAGS_ASAN="$LDFLAGS"
-LIBC3_ASAN=../libc3/libc3.asan.a
+LIBC3_ASAN=../libc3/libc3_asan.a
LIBS_ASAN="$LIBC3_ASAN $LIBS"
# Coverage config
CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs"
LDFLAGS_COV="$LDFLAGS"
-LIBC3_COV=../libc3/libc3.cov.a
+LIBC3_COV=../libc3/libc3_cov.a
LIBS_COV="$LIBC3_COV $LIBS"
# Debug config
CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -ggdb"
LDFLAGS_DEBUG="$LDFLAGS"
-LIBC3_DEBUG=../libc3/libc3.debug.a
+LIBC3_DEBUG=../libc3/libc3_debug.a
LIBS_DEBUG="$LIBC3_DEBUG $LIBS"
# Main config
diff --git a/libc3/configure b/libc3/configure
index 1e45e67..ae4177f 100755
--- a/libc3/configure
+++ b/libc3/configure
@@ -11,17 +11,16 @@
## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
-
set -e
-export C3_TOP="$(pwd)/.."
+export SRC_TOP="$(pwd)/.."
. ../config.subr
LIB=libc3.la
-LIB_ASAN=libc3.asan.la
-LIB_COV=libc3.cov.la
-LIB_DEBUG=libc3.debug.la
+LIB_ASAN=libc3_asan.la
+LIB_COV=libc3_cov.la
+LIB_DEBUG=libc3_debug.la
. ./sources.sh
@@ -94,11 +93,9 @@ echo >> ${CONFIG_MK}
echo "$LIB_ASAN: $OBJECTS_ASAN" >> ${CONFIG_MK}
echo " ${LIBTOOL} --tag=CC --mode=link \${CC} \${LDFLAGS_ASAN} ${OBJECTS_ASAN} \${LIBS_ASAN} -o ${LIB_ASAN}" >> ${CONFIG_MK}
-if [ -n "$GCOV" ]; then
- echo >> ${CONFIG_MK}
- echo "$LIB_COV: $OBJECTS_COV" >> ${CONFIG_MK}
- echo " ${LIBTOOL} --tag=CC --mode=link \${CC} \${LDFLAGS_COV} ${OBJECTS_COV} \${LIBS_COV} -o ${LIB_COV}" >> ${CONFIG_MK}
-fi
+echo >> ${CONFIG_MK}
+echo "$LIB_COV: $OBJECTS_COV" >> ${CONFIG_MK}
+echo " ${LIBTOOL} --tag=CC --mode=link \${CC} \${LDFLAGS_COV} ${OBJECTS_COV} \${LIBS_COV} -o ${LIB_COV}" >> ${CONFIG_MK}
echo >> ${CONFIG_MK}
echo "$LIB_DEBUG: $OBJECTS_DEBUG" >> ${CONFIG_MK}
@@ -120,12 +117,10 @@ for SRC in $SOURCES; do
ext_rule .asan.lo "$SRC" >> ${CONFIG_MK}
echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_ASAN} -c $SRC -o $SRC_ASAN_LO" >> ${CONFIG_MK}
- if [ -n "$GCOV" ]; then
- echo >> ${CONFIG_MK}
- SRC_COV_LO="$(c2ext .cov.lo "$SRC")"
- ext_rule .cov.lo "$SRC" >> ${CONFIG_MK}
- echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_COV} -c $SRC -o $SRC_COV_LO" >> ${CONFIG_MK}
- fi
+ echo >> ${CONFIG_MK}
+ SRC_COV_LO="$(c2ext .cov.lo "$SRC")"
+ ext_rule .cov.lo "$SRC" >> ${CONFIG_MK}
+ echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_COV} -c $SRC -o $SRC_COV_LO" >> ${CONFIG_MK}
echo >> ${CONFIG_MK}
SRC_DEBUG_LO="$(c2ext .debug.lo "$SRC")"
diff --git a/test/Makefile b/test/Makefile
index 3ba93e7..cd4fa8d 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -11,7 +11,7 @@
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
-CLEANFILES = *.a *.css *.gcno *.html ic3/*.diff ic3/*.err ic3/*.out ic3/*.ret *.o libc3_test libc3_test.asan libc3_test.cov libc3_test.debug .libs *.lo
+CLEANFILES = *.a *.css *.gcno *.html ic3/*.diff ic3/*.err ic3/*.out ic3/*.ret *.o libc3_test libc3_test_asan libc3_test_cov libc3_test_debug .libs *.lo
CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
CLEANFILES += ${CLEANFILES_COV}
@@ -26,7 +26,7 @@ all:
${MAKE} debug
if ${HAVE_ASAN}; then ${MAKE} asan; fi
-asan: libc3_test.asan
+asan: libc3_test_asan
clean:
rm -rf ${CLEANFILES}
@@ -34,9 +34,9 @@ clean:
clean_cov:
rm -rf ${CLEANFILES_COV}
-cov: libc3_test.cov
+cov: libc3_test_cov
-debug: libc3_test.debug
+debug: libc3_test_debug
distclean:
rm -rf ${DISTCLEANFILES}
@@ -45,30 +45,30 @@ gcovr:
gcovr --gcov-executable ${GCOV} --html-details test.html
gdb_test: debug
- if [ -f libc3_test.debug.core ]; then gdb libc3_test.debug libc3_test.debug.core; else gdb libc3_test.debug; fi
+ if [ -f libc3_test_debug.core ]; then gdb libc3_test_debug libc3_test_debug.core; else gdb libc3_test_debug; fi
ic3_test_cov:
- IC3=${C3_TOP}/ic3/ic3.cov time ./ic3_test
+ IC3=${SRC_TOP}/ic3/ic3_cov time ./ic3_test
-libc3_test_cov: libc3_test.cov
- time ./libc3_test.cov
+libc3_test_cov: libc3_test_cov
+ time ./libc3_test_cov
test: libc3_test
time ./libc3_test
- IC3=${C3_TOP}/ic3/ic3 time ./ic3_test
+ IC3=${SRC_TOP}/ic3/ic3 time ./ic3_test
-test_asan: libc3_test.asan
- time ./libc3_test.asan
- IC3=${C3_TOP}/ic3/ic3.asan time ./ic3_test
+test_asan: libc3_test_asan
+ time ./libc3_test_asan
+ IC3=${SRC_TOP}/ic3/ic3_asan time ./ic3_test
test_cov: libc3_test_cov ic3_test_cov
-test_debug: libc3_test.debug
- time ./libc3_test.debug
- IC3=${C3_TOP}/ic3/ic3.debug time ./ic3_test
+test_debug: libc3_test_debug
+ time ./libc3_test_debug
+ IC3=${SRC_TOP}/ic3/ic3_debug time ./ic3_test
test_ic3:
- IC3=${C3_TOP}/ic3/ic3 time ./ic3_test
+ IC3=${SRC_TOP}/ic3/ic3 time ./ic3_test
test_valgrind: libc3_test
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./libc3_test
diff --git a/test/configure b/test/configure
index d2bf220..acccef6 100755
--- a/test/configure
+++ b/test/configure
@@ -14,14 +14,14 @@
set -e
-export C3_TOP="$(pwd)/.."
+export SRC_TOP="$(dirname "$PWD")"
. ../config.subr
PROG=libc3_test
-PROG_ASAN=libc3_test.asan
-PROG_COV=libc3_test.cov
-PROG_DEBUG=libc3_test.debug
+PROG_ASAN=libc3_test_asan
+PROG_COV=libc3_test_cov
+PROG_DEBUG=libc3_test_debug
. ./sources.sh
@@ -57,19 +57,19 @@ pkg_config libmd
# Asan config
CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
LDFLAGS_ASAN="$LDFLAGS"
-LIBC3_ASAN=../libc3/libc3.asan.a
+LIBC3_ASAN=../libc3/libc3_asan.a
LIBS_ASAN="$LIBC3_ASAN $LIBS"
# Coverage config
CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs"
LDFLAGS_COV="$LDFLAGS"
-LIBC3_COV=../libc3/libc3.cov.a
+LIBC3_COV=../libc3/libc3_cov.a
LIBS_COV="$LIBC3_COV $LIBS"
# Debug config
CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -ggdb"
LDFLAGS_DEBUG="$LDFLAGS"
-LIBC3_DEBUG=../libc3/libc3.debug.a
+LIBC3_DEBUG=../libc3/libc3_debug.a
LIBS_DEBUG="$LIBC3_DEBUG $LIBS"
# Main config