commit 01a131486e7d7e8cfe21ee4c146bac87522b4f29
parent bb7d3995629b9a1f33bd680b7b255fa5c32521d3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sat, 14 Oct 2023 13:14:25 +0200
Change library order when linking test executables
Make sure that the pkg-config directive for the sck 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 sck 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
@@ -144,7 +144,7 @@ $(TEST_OBJ): config.mk sck-local.pc
$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SCK_CFLAGS) -c $(@:.o=.c) -o $@
test_sck: config.mk sck-local.pc $(LIBNAME)
- $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(SCK_LIBS)
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SCK_LIBS) $(RSYS_LIBS)
test_sck_load: config.mk sck-local.pc $(LIBNAME)
- $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(SCK_LIBS) -lm
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SCK_LIBS) $(RSYS_LIBS) -lm