commit 981e84ace8c3baebd87827d6809cc2ee802951ca
parent 70e41dfae615781efecf5507646d62577c359519
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sat, 14 Oct 2023 15:17:47 +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
@@ -138,7 +138,7 @@ $(TEST_OBJ): config.mk sars-local.pc
$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SARS_CFLAGS) -c $(@:.o=.c) -o $@
test_sars: config.mk sars-local.pc $(LIBNAME)
- $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(SARS_LIBS)
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SARS_LIBS) $(RSYS_LIBS)
test_sars_load: config.mk sars-local.pc $(LIBNAME)
- $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(SARS_LIBS) -lm
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SARS_LIBS) $(RSYS_LIBS) -lm