From 65828611e5ff658b8f53bfdc7ac3ea4af1bc8e02 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 16 Aug 2023 13:38:26 -0700 Subject: [PATCH 1/5] build: add liball_optional_mutex_{normal,pthread}.a --- .gitignore | 2 ++ Makefile | 4 +++- Makefile.BSD | 4 +++- liball/Makefile.inc | 3 +++ liball/optional_mutex_normal/Makefile.BSD | 21 +++++++++++++++++++++ liball/optional_mutex_pthread/Makefile.BSD | 21 +++++++++++++++++++++ 6 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 liball/Makefile.inc create mode 100644 liball/optional_mutex_normal/Makefile.BSD create mode 100644 liball/optional_mutex_pthread/Makefile.BSD diff --git a/.gitignore b/.gitignore index b99f4197..bbfabe01 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ /posix-flags.sh # Compiled libraries and test binaries. /liball/liball.a +/liball/optional_mutex_normal/liball_optional_mutex_normal.a +/liball/optional_mutex_pthread/liball_optional_mutex_pthread.a /perftests/http/test_http /perftests/https/test_https /perftests/network-ssl/test_network_ssl diff --git a/Makefile b/Makefile index ea1bffa2..be7987d3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ .POSIX: PROGS= -LIBS= liball +LIBS= liball \ + liball/optional_mutex_normal \ + liball/optional_mutex_pthread TESTS= perftests/http \ perftests/https \ perftests/network-ssl \ diff --git a/Makefile.BSD b/Makefile.BSD index 8518452b..e8e3fb6c 100644 --- a/Makefile.BSD +++ b/Makefile.BSD @@ -1,6 +1,8 @@ PKG= libcperciva PROGS= -LIBS= liball +LIBS= liball \ + liball/optional_mutex_normal \ + liball/optional_mutex_pthread TESTS= perftests/http \ perftests/https \ perftests/network-ssl \ diff --git a/liball/Makefile.inc b/liball/Makefile.inc new file mode 100644 index 00000000..e1490509 --- /dev/null +++ b/liball/Makefile.inc @@ -0,0 +1,3 @@ +.include "../Makefile.inc" + +SUBDIR_DEPTH := ${SUBDIR_DEPTH}/.. diff --git a/liball/optional_mutex_normal/Makefile.BSD b/liball/optional_mutex_normal/Makefile.BSD new file mode 100644 index 00000000..8df1c6f4 --- /dev/null +++ b/liball/optional_mutex_normal/Makefile.BSD @@ -0,0 +1,21 @@ +# Library name. +LIB = all_optional_mutex_normal + +# Don't install it. +NOINST = 1 + +# Don't link to liball.a. +NOLIBALL = 1 + +# Useful relative directories. +LIBCPERCIVA_DIR = ../.. + +# Handle optional_mutex (this cannot be part of liball). +.PATH.c : ${LIBCPERCIVA_DIR}/util +SRCS += optional_mutex.c +IDIRS += -I${LIBCPERCIVA_DIR}/util + +# Required define. +CFLAGS.optional_mutex.c= -DOPTIONAL_MUTEX_PTHREAD_NO + +.include diff --git a/liball/optional_mutex_pthread/Makefile.BSD b/liball/optional_mutex_pthread/Makefile.BSD new file mode 100644 index 00000000..b2ad8b3f --- /dev/null +++ b/liball/optional_mutex_pthread/Makefile.BSD @@ -0,0 +1,21 @@ +# Library name. +LIB = all_optional_mutex_pthread + +# Don't install it. +NOINST = 1 + +# Don't link to liball.a. +NOLIBALL = 1 + +# Useful relative directories. +LIBCPERCIVA_DIR = ../.. + +# Handle optional_mutex (this cannot be part of liball). +.PATH.c : ${LIBCPERCIVA_DIR}/util +SRCS += optional_mutex.c +IDIRS += -I${LIBCPERCIVA_DIR}/util + +# Required define. +CFLAGS.optional_mutex.c= -DOPTIONAL_MUTEX_PTHREAD_YES + +.include From e060277c2379700c81d11341dc0c77a17e8c98da Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 16 Aug 2023 13:38:27 -0700 Subject: [PATCH 2/5] build: add liball_optional_mutex_normal.a to everything --- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 39abc37f..23defba6 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,7 +16,7 @@ MAN = .if !defined(NOLIBALL) # Link everything to liball.a, unless they specifically ask not to use it. -LIBALL = ${SUBDIR_DEPTH}/liball/liball.a +LIBALL = ${SUBDIR_DEPTH}/liball/liball.a ${SUBDIR_DEPTH}/liball/optional_mutex_normal/liball_optional_mutex_normal.a LDADD += ${LIBALL} DPADD += ${LIBALL} .endif From e0586c0b7a77ddac9b404d4d4127f4f2dad7be62 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 16 Aug 2023 13:38:28 -0700 Subject: [PATCH 3/5] build: replace _normal.a with _pthread.a where appropriate --- Makefile.inc | 2 ++ release-tools/metabuild.sh | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 23defba6..2ae1b810 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,6 +16,8 @@ MAN = .if !defined(NOLIBALL) # Link everything to liball.a, unless they specifically ask not to use it. +# If appropriate, metabuild.sh will do: +# s/optional_mutex_normal/optional_mutex_pthread/g LIBALL = ${SUBDIR_DEPTH}/liball/liball.a ${SUBDIR_DEPTH}/liball/optional_mutex_normal/liball_optional_mutex_normal.a LDADD += ${LIBALL} DPADD += ${LIBALL} diff --git a/release-tools/metabuild.sh b/release-tools/metabuild.sh index b52a6c0e..9d1a8050 100755 --- a/release-tools/metabuild.sh +++ b/release-tools/metabuild.sh @@ -57,6 +57,21 @@ addvar_lib() { fi } +copyvar_LIBALL_optional_mutex() { + var=LIBALL + val=$(${MAKEBSD} -v LIBALL) + if [ -n "${val}" ]; then + # Replace optional_mutex_normal with pthread variant, + # if appropriate. + ldadd_req=$(${MAKEBSD} -v LDADD_REQ) + if [ "${ldadd_req#*-lpthread}" != "${ldadd_req}" ] ; then + val=$(echo "${val}" | \ + sed 's/optional_mutex_normal/optional_mutex_pthread/g') + fi + printf "%s=%s\n" "${var}" "${val}" >> "${OUT}" + fi +} + add_makefile_prog() { # Get a copy of the default Makefile.prog cp "${SUBDIR_DEPTH}/release-tools/Makefile.prog" prog.tmp @@ -161,7 +176,7 @@ printf "RELATIVE_DIR=%s\n" "${D}" >> "${OUT}" if [ -n "$(${MAKEBSD} -v LIB)" ]; then cat "${SUBDIR_DEPTH}/release-tools/Makefile.lib" >> "${OUT}" elif [ -n "$(${MAKEBSD} -v SRCS)" ]; then - copyvar LIBALL + copyvar_LIBALL_optional_mutex add_makefile_prog else printf "\nall:\n\ttrue\n\nclean:\n\ttrue\n" >> "${OUT}" From cf4ee1b7a6cb238096dee817e4199c7851ae4bf9 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 16 Aug 2023 13:38:29 -0700 Subject: [PATCH 4/5] tests/optional_mutex: remove manual optional_mutex.c --- tests/optional_mutex/normal/Makefile.BSD | 7 +------ tests/optional_mutex/pthread/Makefile.BSD | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/optional_mutex/normal/Makefile.BSD b/tests/optional_mutex/normal/Makefile.BSD index b70fba79..4c4ed126 100644 --- a/tests/optional_mutex/normal/Makefile.BSD +++ b/tests/optional_mutex/normal/Makefile.BSD @@ -11,14 +11,9 @@ LIBCPERCIVA_DIR = ../../.. .PATH.c : .. SRCS = main.c -# Handle optional_mutex (this cannot be part of liball). -.PATH.c : ${LIBCPERCIVA_DIR}/util -SRCS += optional_mutex.c +# libcperciva includes IDIRS += -I${LIBCPERCIVA_DIR}/util -# Required define. -CFLAGS.optional_mutex.c= -DOPTIONAL_MUTEX_PTHREAD_NO - test: all ./${PROG} diff --git a/tests/optional_mutex/pthread/Makefile.BSD b/tests/optional_mutex/pthread/Makefile.BSD index b74cf7c5..ba013d09 100644 --- a/tests/optional_mutex/pthread/Makefile.BSD +++ b/tests/optional_mutex/pthread/Makefile.BSD @@ -14,14 +14,9 @@ LIBCPERCIVA_DIR = ../../.. .PATH.c : .. SRCS = main.c -# Handle optional_mutex (this cannot be part of liball). -.PATH.c : ${LIBCPERCIVA_DIR}/util -SRCS += optional_mutex.c +# libcperciva includes IDIRS += -I${LIBCPERCIVA_DIR}/util -# Required define. -CFLAGS.optional_mutex.c= -DOPTIONAL_MUTEX_PTHREAD_YES - # Special test-only define. CFLAGS.main.c= -DNUM_THREADS=10 From 4ba9f311caeec9deff66a2a7ff89867d658c74fd Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 16 Aug 2023 13:38:30 -0700 Subject: [PATCH 5/5] build: run `make Makefiles` --- liball/optional_mutex_normal/Makefile | 25 +++++++++++++++++++++++++ liball/optional_mutex_pthread/Makefile | 25 +++++++++++++++++++++++++ perftests/http/Makefile | 2 +- perftests/https/Makefile | 2 +- perftests/network-ssl/Makefile | 2 +- tests/aws/Makefile | 2 +- tests/buildall/Makefile | 2 +- tests/buildsingles/Makefile | 2 +- tests/crc32/Makefile | 2 +- tests/crypto_aes/Makefile | 2 +- tests/crypto_aesctr/Makefile | 2 +- tests/crypto_entropy/Makefile | 2 +- tests/daemonize/Makefile | 2 +- tests/elasticarray/Makefile | 2 +- tests/events/Makefile | 2 +- tests/getopt-longjmp/Makefile | 2 +- tests/getopt/Makefile | 2 +- tests/heap/Makefile | 2 +- tests/humansize/Makefile | 2 +- tests/json/Makefile | 2 +- tests/md5/Makefile | 2 +- tests/monoclock/Makefile | 2 +- tests/mpool/Makefile | 2 +- tests/optional_mutex/normal/Makefile | 6 ++---- tests/optional_mutex/pthread/Makefile | 6 ++---- tests/parsenum/Makefile | 2 +- tests/readpass_file/Makefile | 2 +- tests/setuidgid/Makefile | 2 +- tests/sha1/Makefile | 2 +- tests/sha256/Makefile | 2 +- tests/sock_util/Makefile | 2 +- tests/sysendian/Makefile | 2 +- tests/warnp/Makefile | 2 +- 33 files changed, 83 insertions(+), 37 deletions(-) create mode 100644 liball/optional_mutex_normal/Makefile create mode 100644 liball/optional_mutex_pthread/Makefile diff --git a/liball/optional_mutex_normal/Makefile b/liball/optional_mutex_normal/Makefile new file mode 100644 index 00000000..87d59def --- /dev/null +++ b/liball/optional_mutex_normal/Makefile @@ -0,0 +1,25 @@ +.POSIX: +# AUTOGENERATED FILE, DO NOT EDIT +LIB=liball_optional_mutex_normal.a +SRCS=optional_mutex.c +IDIRS=-I../../util +SUBDIR_DEPTH=../.. +RELATIVE_DIR=liball/optional_mutex_normal + +all: + if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ + cd ${SUBDIR_DEPTH}; \ + ${MAKE} BUILD_SUBDIR=${RELATIVE_DIR} \ + BUILD_TARGET=${PROG} buildsubdir; \ + else \ + ${MAKE} ${LIB}; \ + fi + +clean: + rm -f ${LIB} ${SRCS:.c=.o} + +${LIB}:${SRCS:.c=.o} + ${AR} ${ARFLAGS} ${LIB} ${SRCS:.c=.o} + +optional_mutex.o: ../../util/optional_mutex.c ../../util/optional_mutex.h + ${CC} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -DAPISUPPORT_CONFIG_FILE=\"apisupport-config.h\" -I../.. ${IDIRS} ${CPPFLAGS} ${CFLAGS} -DOPTIONAL_MUTEX_PTHREAD_NO -c ../../util/optional_mutex.c -o optional_mutex.o diff --git a/liball/optional_mutex_pthread/Makefile b/liball/optional_mutex_pthread/Makefile new file mode 100644 index 00000000..3ccf9ef0 --- /dev/null +++ b/liball/optional_mutex_pthread/Makefile @@ -0,0 +1,25 @@ +.POSIX: +# AUTOGENERATED FILE, DO NOT EDIT +LIB=liball_optional_mutex_pthread.a +SRCS=optional_mutex.c +IDIRS=-I../../util +SUBDIR_DEPTH=../.. +RELATIVE_DIR=liball/optional_mutex_pthread + +all: + if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ + cd ${SUBDIR_DEPTH}; \ + ${MAKE} BUILD_SUBDIR=${RELATIVE_DIR} \ + BUILD_TARGET=${PROG} buildsubdir; \ + else \ + ${MAKE} ${LIB}; \ + fi + +clean: + rm -f ${LIB} ${SRCS:.c=.o} + +${LIB}:${SRCS:.c=.o} + ${AR} ${ARFLAGS} ${LIB} ${SRCS:.c=.o} + +optional_mutex.o: ../../util/optional_mutex.c ../../util/optional_mutex.h + ${CC} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -DAPISUPPORT_CONFIG_FILE=\"apisupport-config.h\" -I../.. ${IDIRS} ${CPPFLAGS} ${CFLAGS} -DOPTIONAL_MUTEX_PTHREAD_YES -c ../../util/optional_mutex.c -o optional_mutex.o diff --git a/perftests/http/Makefile b/perftests/http/Makefile index 37218fbd..bbfc69ce 100644 --- a/perftests/http/Makefile +++ b/perftests/http/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I ../../events -I ../../http -I ../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=perftests/http -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/perftests/https/Makefile b/perftests/https/Makefile index 5c336fe9..84bc9c7f 100644 --- a/perftests/https/Makefile +++ b/perftests/https/Makefile @@ -6,7 +6,7 @@ IDIRS=-I ../../events -I ../../http -I ../../util LDADD_REQ=-lssl -lcrypto SUBDIR_DEPTH=../.. RELATIVE_DIR=perftests/https -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/perftests/network-ssl/Makefile b/perftests/network-ssl/Makefile index a93f28ff..85b1a0f3 100644 --- a/perftests/network-ssl/Makefile +++ b/perftests/network-ssl/Makefile @@ -6,7 +6,7 @@ IDIRS=-I ../../events -I ../../network_ssl -I ../../util LDADD_REQ=-lssl -lcrypto SUBDIR_DEPTH=../.. RELATIVE_DIR=perftests/network-ssl -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/aws/Makefile b/tests/aws/Makefile index 3ee69c36..b3e83b39 100644 --- a/tests/aws/Makefile +++ b/tests/aws/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../aws -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/aws -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/buildall/Makefile b/tests/buildall/Makefile index 40aa940c..05bfbe3b 100644 --- a/tests/buildall/Makefile +++ b/tests/buildall/Makefile @@ -5,7 +5,7 @@ SRCS=main.c LDADD_REQ=-lcrypto SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/buildall -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/buildsingles/Makefile b/tests/buildsingles/Makefile index 025ab544..89b3ca68 100644 --- a/tests/buildsingles/Makefile +++ b/tests/buildsingles/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../alg -I../../aws -I../../cpusupport -I../../crypto -I../../datastruct -I../../events -I../../external/queue -I../../http -I../../netbuf -I../../network -I../../network_ssl -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/buildsingles -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/crc32/Makefile b/tests/crc32/Makefile index dcf4f747..44d108e8 100644 --- a/tests/crc32/Makefile +++ b/tests/crc32/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../alg -I../../cpusupport -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/crc32 -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/crypto_aes/Makefile b/tests/crypto_aes/Makefile index 87159f66..2ed27beb 100644 --- a/tests/crypto_aes/Makefile +++ b/tests/crypto_aes/Makefile @@ -6,7 +6,7 @@ IDIRS=-I../../cpusupport -I../../crypto -I../../util LDADD_REQ=-lcrypto SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/crypto_aes -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/crypto_aesctr/Makefile b/tests/crypto_aesctr/Makefile index f8e57ac7..db4f1fb7 100644 --- a/tests/crypto_aesctr/Makefile +++ b/tests/crypto_aesctr/Makefile @@ -6,7 +6,7 @@ IDIRS=-I../../cpusupport -I../../crypto -I../../util LDADD_REQ=-lcrypto SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/crypto_aesctr -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/crypto_entropy/Makefile b/tests/crypto_entropy/Makefile index d2ad8956..15d71cf4 100644 --- a/tests/crypto_entropy/Makefile +++ b/tests/crypto_entropy/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../crypto -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/crypto_entropy -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/daemonize/Makefile b/tests/daemonize/Makefile index efcba0fe..04e97297 100644 --- a/tests/daemonize/Makefile +++ b/tests/daemonize/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/daemonize -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/elasticarray/Makefile b/tests/elasticarray/Makefile index c7f06814..7624d937 100644 --- a/tests/elasticarray/Makefile +++ b/tests/elasticarray/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../datastruct SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/elasticarray -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/events/Makefile b/tests/events/Makefile index 9a1aecdb..5c582c2b 100644 --- a/tests/events/Makefile +++ b/tests/events/Makefile @@ -5,7 +5,7 @@ SRCS=main.c events_counter.c events_interrupter.c IDIRS=-I../../events -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/events -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/getopt-longjmp/Makefile b/tests/getopt-longjmp/Makefile index 84ed2b7a..e6a6a922 100644 --- a/tests/getopt-longjmp/Makefile +++ b/tests/getopt-longjmp/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/getopt-longjmp -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/getopt/Makefile b/tests/getopt/Makefile index 1e1b38a0..8914f745 100644 --- a/tests/getopt/Makefile +++ b/tests/getopt/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/getopt -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/heap/Makefile b/tests/heap/Makefile index f55cee35..2b5eaaea 100644 --- a/tests/heap/Makefile +++ b/tests/heap/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../datastruct -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/heap -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/humansize/Makefile b/tests/humansize/Makefile index db4d6691..74744195 100644 --- a/tests/humansize/Makefile +++ b/tests/humansize/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/humansize -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/json/Makefile b/tests/json/Makefile index 2e57f7db..da320abf 100644 --- a/tests/json/Makefile +++ b/tests/json/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I ../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/json -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/md5/Makefile b/tests/md5/Makefile index 98b3597f..517312b0 100644 --- a/tests/md5/Makefile +++ b/tests/md5/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../alg -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/md5 -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/monoclock/Makefile b/tests/monoclock/Makefile index 296d82ea..2cd42438 100644 --- a/tests/monoclock/Makefile +++ b/tests/monoclock/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/monoclock -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/mpool/Makefile b/tests/mpool/Makefile index 46938f06..c67e318a 100644 --- a/tests/mpool/Makefile +++ b/tests/mpool/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../datastruct -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/mpool -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/optional_mutex/normal/Makefile b/tests/optional_mutex/normal/Makefile index 85f19088..ec24df8b 100644 --- a/tests/optional_mutex/normal/Makefile +++ b/tests/optional_mutex/normal/Makefile @@ -1,11 +1,11 @@ .POSIX: # AUTOGENERATED FILE, DO NOT EDIT PROG=test_optional_mutex_normal -SRCS=main.c optional_mutex.c +SRCS=main.c IDIRS=-I../../../util SUBDIR_DEPTH=../../.. RELATIVE_DIR=tests/optional_mutex/normal -LIBALL=../../../liball/liball.a +LIBALL=../../../liball/liball.a ../../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ @@ -24,8 +24,6 @@ ${PROG}:${SRCS:.c=.o} ${LIBALL} main.o: ../main.c ../../../util/optional_mutex.h ../../../util/warnp.h ${CC} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -DAPISUPPORT_CONFIG_FILE=\"apisupport-config.h\" -I../../.. ${IDIRS} ${CPPFLAGS} ${CFLAGS} -c ../main.c -o main.o -optional_mutex.o: ../../../util/optional_mutex.c ../../../util/optional_mutex.h - ${CC} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -DAPISUPPORT_CONFIG_FILE=\"apisupport-config.h\" -I../../.. ${IDIRS} ${CPPFLAGS} ${CFLAGS} -DOPTIONAL_MUTEX_PTHREAD_NO -c ../../../util/optional_mutex.c -o optional_mutex.o test: all ./${PROG} diff --git a/tests/optional_mutex/pthread/Makefile b/tests/optional_mutex/pthread/Makefile index 07d8667d..01515c86 100644 --- a/tests/optional_mutex/pthread/Makefile +++ b/tests/optional_mutex/pthread/Makefile @@ -1,12 +1,12 @@ .POSIX: # AUTOGENERATED FILE, DO NOT EDIT PROG=test_optional_mutex_pthread -SRCS=main.c optional_mutex.c +SRCS=main.c IDIRS=-I../../../util LDADD_REQ=-lpthread SUBDIR_DEPTH=../../.. RELATIVE_DIR=tests/optional_mutex/pthread -LIBALL=../../../liball/liball.a +LIBALL=../../../liball/liball.a ../../../liball/optional_mutex_pthread/liball_optional_mutex_pthread.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ @@ -25,8 +25,6 @@ ${PROG}:${SRCS:.c=.o} ${LIBALL} main.o: ../main.c ../../../util/optional_mutex.h ../../../util/warnp.h ${CC} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -DAPISUPPORT_CONFIG_FILE=\"apisupport-config.h\" -I../../.. ${IDIRS} ${CPPFLAGS} ${CFLAGS} -DNUM_THREADS=10 -c ../main.c -o main.o -optional_mutex.o: ../../../util/optional_mutex.c ../../../util/optional_mutex.h - ${CC} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -DAPISUPPORT_CONFIG_FILE=\"apisupport-config.h\" -I../../.. ${IDIRS} ${CPPFLAGS} ${CFLAGS} -DOPTIONAL_MUTEX_PTHREAD_YES -c ../../../util/optional_mutex.c -o optional_mutex.o test: all ./${PROG} diff --git a/tests/parsenum/Makefile b/tests/parsenum/Makefile index 1e091295..d4818538 100644 --- a/tests/parsenum/Makefile +++ b/tests/parsenum/Makefile @@ -6,7 +6,7 @@ IDIRS=-I../../util LDADD_REQ=-lm SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/parsenum -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/readpass_file/Makefile b/tests/readpass_file/Makefile index 18f9e428..8c82ee39 100644 --- a/tests/readpass_file/Makefile +++ b/tests/readpass_file/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/readpass_file -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/setuidgid/Makefile b/tests/setuidgid/Makefile index 8b685173..02245e73 100644 --- a/tests/setuidgid/Makefile +++ b/tests/setuidgid/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/setuidgid -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/sha1/Makefile b/tests/sha1/Makefile index 47835e09..560d483b 100644 --- a/tests/sha1/Makefile +++ b/tests/sha1/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../alg -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/sha1 -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/sha256/Makefile b/tests/sha256/Makefile index 294ccfc3..8e8cf17f 100644 --- a/tests/sha256/Makefile +++ b/tests/sha256/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../alg -I../../cpusupport -I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/sha256 -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/sock_util/Makefile b/tests/sock_util/Makefile index b7dee3d4..58b5ef86 100644 --- a/tests/sock_util/Makefile +++ b/tests/sock_util/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/sock_util -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/sysendian/Makefile b/tests/sysendian/Makefile index 28961236..7f91e28b 100644 --- a/tests/sysendian/Makefile +++ b/tests/sysendian/Makefile @@ -5,7 +5,7 @@ SRCS=main.c IDIRS=-I../../util SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/sysendian -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_normal/liball_optional_mutex_normal.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \ diff --git a/tests/warnp/Makefile b/tests/warnp/Makefile index 4454f88b..796eb668 100644 --- a/tests/warnp/Makefile +++ b/tests/warnp/Makefile @@ -6,7 +6,7 @@ IDIRS=-I../../util LDADD_REQ=-lpthread SUBDIR_DEPTH=../.. RELATIVE_DIR=tests/warnp -LIBALL=../../liball/liball.a +LIBALL=../../liball/liball.a ../../liball/optional_mutex_pthread/liball_optional_mutex_pthread.a all: if [ -z "$${HAVE_BUILD_FLAGS}" ]; then \