rnsl

Load a list of strings expanded by the shell
git clone git://git.meso-star.fr/rnsl.git
Log | Files | Refs | README | LICENSE

commit 402f6372d65b6782f505e996fb2bbfaea1eb3f38
parent cc551d9d0b836e3137e451938e80e4fb5c06ef20
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 31 Oct 2023 11:37:47 +0100

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 @@ -143,11 +143,11 @@ clean_test: $(SHELL) make.sh clean_test $(TEST_SRC) file.txt $(TEST_DEP): config.mk rnsl-local.pc - @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(RNSL_CFLAGS) \ + @$(CC) $(CFLAGS_EXE) $(RNSL_CFLAGS) $(RSYS_CFLAGS) \ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ $(TEST_OBJ): config.mk rnsl-local.pc - $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(RNSL_CFLAGS) -c $(@:.o=.c) -o $@ + $(CC) $(CFLAGS_EXE) $(RNSL_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ -test_rnsl test_rnsl_load: config.mk rnsl-local.pc - $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(RNSL_LIBS) +test_rnsl test_rnsl_load: config.mk rnsl-local.pc $(LIBNAME) + $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RNSL_LIBS) $(RSYS_LIBS)