star-cmap

Mapping values onto color ramps
git clone git://git.meso-star.fr/star-cmap.git
Log | Files | Refs | README | LICENSE

commit 646a7a288863b976b2e5192f14868059a6b15092
parent ef6ccea88981825b96477b49957acbf42ceee767
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 27 Oct 2023 16:16:10 +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 @@ -189,14 +189,14 @@ clean_test: while read -r i; do rm -f "$${i}.ppm"; done $(TEST_DEP): config.mk scmap-local.pc - @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SCMAP_CFLAGS) \ + @$(CC) $(CFLAGS_EXE) $(SCMAP_CFLAGS) $(RSYS_CFLAGS) \ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ $(TEST_OBJ): config.mk scmap-local.pc - $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SCMAP_CFLAGS) -c $(@:.o=.c) -o $@ + $(CC) $(CFLAGS_EXE) $(SCMAP_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ -test_scmap test_scmap_palettes: config.mk scmap-local.pc +test_scmap test_scmap_palettes: config.mk scmap-local.pc $(LIBNAME) $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SCMAP_LIBS) $(RSYS_LIBS) -test_scmap_fetch_color: config.mk scmap-local.pc +test_scmap_fetch_color: config.mk scmap-local.pc $(LIBNAME) $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SCMAP_LIBS) $(RSYS_LIBS) -lm