mrumtl

Describe materials that vary spectrally
git clone git://git.meso-star.fr/mrumtl.git
Log | Files | Refs | README | LICENSE

commit d5a4c2f320496f5dce48a5f831171cd61f268326
parent 0c7da196ed707267d90570e749a2ff57db1f0e53
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 30 Oct 2023 15:28:06 +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 @@ -138,15 +138,15 @@ clean_test: $(SHELL) make.sh clean_test $(TEST_SRC) $(TEST_DEP): config.mk mrumtl-local.pc - @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(MRUMTL_CFLAGS) \ + @$(CC) $(CFLAGS_EXE) $(MRUMTL_CFLAGS) $(RSYS_CFLAGS) \ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ $(TEST_OBJ): config.mk mrumtl-local.pc - $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(MRUMTL_CFLAGS) -c $(@:.o=.c) -o $@ + $(CC) $(CFLAGS_EXE) $(MRUMTL_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ test_mrumtl \ test_mrumtl_bands \ test_mrumtl_wlens \ test_mrumtl_load \ -: config.mk mrumtl-local.pc - $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(MRUMTL_LIBS) +: config.mk mrumtl-local.pc $(LIBNAME) + $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(MRUMTL_LIBS) $(RSYS_LIBS)