commit b46c2959653b32011c5c5a8838eb0f6babf18a02
parent c4bea9d445a0325727b360c507319876e538f1cd
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 31 Oct 2023 12:18:40 +0100
Update test compilation and link edition
Make sure that the pkg-config directive for the local library appears as
the first compiler flag to be used and the first library to be linked,
to ensure that headers and libraries are searched for first in the local
path. This is because the compiler and linker look for directories in
the left-to-right order in which the -I and -L options appear. So, to
force inclusion of local headers and link editing with the local version
of the library, the -I./src and -L./ directives must appear first when
compiling and linking.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -159,11 +159,11 @@ clean_test:
rm -f test_rngrd src/test_rngrd.o
$(TEST_DEP): config.mk rngrd-local.pc
- @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(RNGRD_CFLAGS) \
+ @$(CC) $(CFLAGS_EXE) $(RNGRD_CFLAGS) $(RSYS_CFLAGS) \
-MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@
src/test_rngrd.o: config.mk rngrd-local.pc
- $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(RNGRD_CFLAGS) -c $(@:.o=.c) -o $@
+ $(CC) $(CFLAGS_EXE) $(RNGRD_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@
test_rngrd: src/test_rngrd.o config.mk rngrd-local.pc $(LIBNAME)
- $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(RNGRD_LIBS)
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RNGRD_LIBS) $(RSYS_LIBS)