star-buffer

Load 1D arrays in binary format
git clone git://git.meso-star.fr/star-buffer.git
Log | Files | Refs | README | LICENSE

commit ef6b8572b941f84127ef8f007967a3e267484dc7
parent f706c10d8c5435d3747f3984d072d37e50dd9982
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 27 Oct 2023 16:54:50 +0200

Update test compilation and 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 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:
MMakefile | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -136,11 +136,11 @@ clean_test: $(SHELL) make.sh clean_test $(TEST_SRC) $(TEST_DEP): config.mk sbuf-local.pc - @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SBUF_CFLAGS) \ + @$(CC) $(CFLAGS_EXE) $(SBUF_CFLAGS) $(RSYS_CFLAGS) \ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ $(TEST_OBJ): config.mk sbuf-local.pc - $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SBUF_CFLAGS) -c $(@:.o=.c) -o $@ + $(CC) $(CFLAGS_EXE) $(SBUF_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ -test_sbuf test_sbuf_load: config.mk sbuf-local.pc - $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(SBUF_LIBS) +test_sbuf test_sbuf_load: config.mk sbuf-local.pc $(LIBNAME) + $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SBUF_LIBS) $(RSYS_LIBS)