star-3dstl

Create star-3d geometries from StL files
git clone git://git.meso-star.fr/star-3dstl.git
Log | Files | Refs | README | LICENSE

commit 624683ccd8d3d28bb0b1042e5dab7fb8255433d2
parent feeba4bc259692bc5f19c7160df8d701c280206f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 19 Jul 2023 14:35:51 +0200

Update Makefile targets of tests and .d files

The tests depend on the linker flags set in the config.mk file and the
pkg-config file of the library. This dependency is not really necessary
since these executables depend on their object file which themselves
depend on the config.mk file and 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, including the value of build flags such as include directories to
search for headers and macro definitions. In addition, the .d file of
the test no longer use the inference rule defined for the library and
now rely on its own target with its own compilation flags used for its
compilation. If in practice this does not change anything, it is more
rigorous.

The explicit dependency of the .o and .d test files to their
corresponding source is removed since it is defined in the .d file.

Do not use the "$<" macro when compiling tests because its meaning is
undefined elsewhere than in inference rules.

Diffstat:
MMakefile | 12+++++++-----
1 file changed, 7 insertions(+), 5 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) $(CFLAGS) $(DPDC_CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(SOFLAGS) $(DPDC_LIBS) @@ -136,10 +136,12 @@ test: build_tests clean_test: rm -f test_s3dstl test_empty.stl -$(TEST_OBJ) $(TEST_DEP): config.mk +src/test_s3dstl.d: config.mk s3dstl-local.pc + @$(CC) $(CFLAGS) $(RSYS_CFLAGS) $(S3D_CFLAGS) $(S3DSTL_CFLAGS) $(SSTL_CFLAGS) \ + -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ -src/test_s3dstl.o: src/test_s3dstl.c s3dstl-local.pc - $(CC) $(CFLAGS) $(RSYS_CFLAGS) $(S3D_CFLAGS) $(S3DSTL_CFLAGS) $(SSTL_CFLAGS) -c $< -o $@ +src/test_s3dstl.o: config.mk s3dstl-local.pc + $(CC) $(CFLAGS) $(RSYS_CFLAGS) $(S3D_CFLAGS) $(S3DSTL_CFLAGS) $(SSTL_CFLAGS) -c $(@:.o=.c) -o $@ -test_s3dstl: src/test_s3dstl.o s3dstl-local.pc +test_s3dstl: src/test_s3dstl.o config.mk s3dstl-local.pc $(CC) -o $@ src/$@.o $(RSYS_LIBS) $(S3D_LIBS) $(S3DSTL_LIBS) $(SSTL_LIBS)