From afde8c5439a8ef0c6ea4bd85b3ba03c85310ffe9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 15 Feb 2023 14:44:36 +0000 Subject: Update build system Signed-off-by: Laurent Bercot --- Makefile | 1 - package/deps.mak | 1 + src/tests/test-switch.wrapper | 2 +- tools/gen-deps.sh | 11 +++++++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d6dc278..f13b059 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,6 @@ CC = $(error Please use ./configure first) STATIC_LIBS := SHARED_LIBS := -INTERNAL_LIBS := EXTRA_TARGETS := LIB_DEFS := diff --git a/package/deps.mak b/package/deps.mak index 9d01146..ec98fd2 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -187,3 +187,4 @@ test-switch: EXTRA_LIBS := -lskarnet ${SOCKET_LIB} ${SYSCLOCK_LIB} test-switch: src/tests/test-switch.o ${LIBNSSS} test-unix: EXTRA_LIBS := -lskarnet test-unix: src/tests/test-unix.o ${LIBNSSS} +INTERNAL_LIBS := diff --git a/src/tests/test-switch.wrapper b/src/tests/test-switch.wrapper index 387595f..0c683ec 100755 --- a/src/tests/test-switch.wrapper +++ b/src/tests/test-switch.wrapper @@ -1,4 +1,4 @@ -#!/bin/sh -ex +#!/bin/sh -e S=./.test-switch-socket F=./.test-switch-fifo diff --git a/tools/gen-deps.sh b/tools/gen-deps.sh index 27e5b3e..befe021 100755 --- a/tools/gen-deps.sh +++ b/tools/gen-deps.sh @@ -7,6 +7,8 @@ echo '# This file has been generated by tools/gen-deps.sh' echo '#' echo +internal_libs= + for dir in src/include/${package} src/* ; do for file in $(ls -1 $dir | grep -- \\.h$) ; do { @@ -70,8 +72,12 @@ for dir in $(ls -1 src | grep -v ^include) ; do echo else echo "lib${file}.a.xyzzy:$(echo "$deps" | sed 's/\.o/.lo/g')" echo endif - echo "lib${file}.so.xyzzy: EXTRA_LIBS :=$libs" - echo "lib${file}.so.xyzzy:$(echo "$deps" | sed 's/\.o/.lo/g')" + if grep -E "^LIB_DEFS [+:]=" package/targets.mak | grep -qF "$file" ; then + echo "lib${file}.so.xyzzy: EXTRA_LIBS :=$libs" + echo "lib${file}.so.xyzzy:$(echo "$deps" | sed 's/\.o/.lo/g')" + else + internal_libs="$internal_libs lib${file}.a.xyzzy" + fi done for file in $(ls -1 src/$dir/deps-exe) ; do @@ -91,3 +97,4 @@ for dir in $(ls -1 src | grep -v ^include) ; do echo "$file: src/$dir/$file.o$deps" done done +echo "INTERNAL_LIBS :=$internal_libs" -- cgit 1.4.1