commit 0fe56f3d3fca35278c91a0b9480d8a4f7160b41d
parent adfe3bb2c63840474954982d500ff09dc95ff5de
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 30 Oct 2023 12:03:58 +0100
Update test compilation
Make sure that the pkg-config directive for the local library appears as
the first compiler flag to be used to ensure that headers are searched
for first in the local path. This is because the compiler look for
directories in the left-to-right order in which the -I option appear.
So, to force inclusion of local headers the -I./src directive must
appear first when compiling.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -137,11 +137,11 @@ clean_test:
$(SHELL) make.sh clean_test $(TEST_SRC)
$(TEST_DEP): config.mk sck-local.pc
- @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SCK_CFLAGS) \
+ @$(CC) $(CFLAGS_EXE) $(SCK_CFLAGS) $(RSYS_CFLAGS) \
-MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@
$(TEST_OBJ): config.mk sck-local.pc
- $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SCK_CFLAGS) -c $(@:.o=.c) -o $@
+ $(CC) $(CFLAGS_EXE) $(SCK_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@
test_sck: config.mk sck-local.pc $(LIBNAME)
$(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SCK_LIBS) $(RSYS_LIBS)