atrri

Refractive indices varying with wavelength
git clone git://git.meso-star.fr/atrri.git
Log | Files | Refs | README | LICENSE

commit 67d672b92c212b475964f6726681c718f97a6e00
parent 267fa16d6d1c91817199e427fa7d09ef87833d82
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 31 Oct 2023 09:18:26 +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 @@ -137,13 +137,13 @@ clean_test: $(SHELL) make.sh clean_test $(TEST_SRC) $(TEST_DEP): config.mk atrri-local.pc - @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(ATRRI_CFLAGS) \ + @$(CC) $(CFLAGS_EXE) $(ATRRI_CFLAGS) $(RSYS_CFLAGS) \ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ $(TEST_OBJ): config.mk atrri-local.pc - $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(ATRRI_CFLAGS) -c $(@:.o=.c) -o $@ + $(CC) $(CFLAGS_EXE) $(ATRRI_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ test_atrri \ test_atrri_load \ -: config.mk atrri-local.pc - $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(RSYS_LIBS) $(ATRRI_LIBS) -lm +: config.mk atrri-local.pc $(LIBNAME) + $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(ATRRI_LIBS) $(RSYS_LIBS) -lm