commit 0e348755e2e79a6c74715d3331da21f89b22d42e
parent 0e2a7acbc6bf204b343f97c5eb31ac24da4c5240
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 18 Oct 2023 16:30:30 +0200
Updated test link edition
Add the library as a dependency of the tests that must be linked to it.
This forces make to rerun the linker if the library is changed.
Make sure that the pkg-config directive for the local library appears as
the first library to be linked, to ensure that libraries are searched
for in the local path first. This is because the linker will search
directories in the left-to-right order in which the -L option appears.
So, to force link editing with the local version of the local library,
the -L./ directive must appear first on the link-editing command line.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -140,5 +140,5 @@ $(TEST_DEP): config.mk sstl-local.pc
$(TEST_OBJ): config.mk sstl-local.pc
$(CC) -std=c89 $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SSTL_CFLAGS) -c $(@:.o=.c) -o $@
-test_sstl test_sstl_load: config.mk sstl-local.pc
- $(CC) -std=c89 $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(SSTL_LIBS) -lm
+test_sstl test_sstl_load: config.mk sstl-local.pc $(LIBNAME)
+ $(CC) -std=c89 $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SSTL_LIBS) $(RSYS_LIBS) -lm