star-stl

Load STereo Lithography (StL) file format
git clone git://git.meso-star.fr/star-stl.git
Log | Files | Refs | README | LICENSE

commit 028b3f7fe702d59be8bf24f3054783d8395cb471
parent 86878f35f7b23d0ba016644956eac882be47d611
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 19 Jul 2023 13:49:41 +0200

Update Makefile targets of tests and .d files

The tests depend on the linker flags set in the config.mk file and the
local pkg-config file. These dependency are not really necessary since
these executables depend on their object file which themselves depend on
config.mk the pc file. So in any case, their linking would be redone even
without this change which in all rigor remains necessary.

Like .o files, the .d files depend on the contents of the config.mk file
and the pc file, including the value of build flags such as include
directories to search for headers and macro definitions. In addition,
the .d files of the tests no longer use the inference rule defined for
the library and now rely on its own targets with its own compilation
flags used for its compilation. If in practice this does not change
anything, it is more rigorous.

Diffstat:
MMakefile | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile @@ -37,7 +37,7 @@ build_library: .config $(DEP) echo "$(LIBNAME_SHARED)";\ fi) -$(OBJ) $(DEP): config.mk +$(DEP) $(OBJ): config.mk $(LIBNAME_SHARED): $(OBJ) $(CC) -std=c99 $(CFLAGS) $(RSYS_CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(SOFLAGS) $(RSYS_LIBS) -lm @@ -130,8 +130,11 @@ clean_test: rm -f corner.stl corner_bin.stl test_basic.stl test_basic2.stl $(SHELL) make.sh clean_test $(TEST_SRC) -test_sstl test_sstl_load: config.mk - $(CC) -o $@ src/$@.o $(RSYS_LIBS) $(SSTL_LIBS) -lm +$(TEST_DEP): config.mk sstl-local.pc + @$(CC) -std=c89 $(CFLAGS) $(RSYS_CFLAGS) $(SSTL_CFLAGS) -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ $(TEST_OBJ): config.mk sstl-local.pc $(CC) -std=c89 $(CFLAGS) $(RSYS_CFLAGS) $(SSTL_CFLAGS) -c $(@:.o=.c) -o $@ + +test_sstl test_sstl_load: config.mk sstl-local.pc + $(CC) -o $@ src/$@.o $(RSYS_LIBS) $(SSTL_LIBS) -lm