star-meteo

Time varying meteorological data
git clone git://git.meso-star.fr/star-meteo.git
Log | Files | Refs | README | LICENSE

commit 5b612d5a716d8b1b404666e7ecb256b4dca46bba
parent 7599cf89ad8f43deaa41f17a3dfa6927118d6ccc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 13 Aug 2025 12:30:39 +0200

Fix Makefile issues

Ensure that the .config file is a requirement for .o, .d, and .so files
rather than for the library target. This is not only more accurate, as
these files do indeed require prior configuration, but also more robust,
as .d files can no longer be generated without first ensuring that their
dependencies are satisfied (i.e., that the .config file has been
generated correctly). Previously, this was not guaranteed.

Compile the smeteo utility by forcing the use of the C89 standard
instead of letting GCC use its default C dialect.

Make the test target dependent on the util target, and not directly on
the smeteo binary, which must be compiled via the util target to ensure
the automatic generation of its .d files.

Diffstat:
MMakefile | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -42,7 +42,7 @@ library: .config $(DEP) echo "$(LIBNAME_SHARED)";\ fi) -$(DEP) $(OBJ): config.mk +$(LIBNAME_SHARED) B$(DEP) $(OBJ): config.mk .config $(LIBNAME_SHARED): $(OBJ) $(CC) $(CFLAGS_LIB) -o $@ $(OBJ) $(LDFLAGS_LIB) @@ -67,7 +67,7 @@ libsmsh.o: $(OBJ) $(CC) $(CFLAGS_LIB) -c $< -o $@ ################################################################################ -# utils +# Utils ################################################################################ UTIL_SRC = src/smeteo_main.c UTIL_OBJ = $(UTIL_SRC:.c=.o) @@ -77,7 +77,7 @@ PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG) INCS_UTIL = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags rsys smeteo-local) LIBS_UTIL = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs rsys smeteo-local) -CFLAGS_UTIL = $(CFLAGS_EXE) $(INCS_UTIL) +CFLAGS_UTIL = -std=c89 $(CFLAGS_EXE) $(INCS_UTIL) LDFLAGS_UTIL = $(LDFLAGS_EXE) $(LIBS_UTIL) util: library $(UTIL_DEP) @@ -215,7 +215,7 @@ clean_test: rm -f test.txt for i in $(TEST_SRC); do rm -f "$$(basename "$${i}" ".c")"; done -test: tests smeteo +test: tests util @err=0; \ for i in $(TEST_SRC); do \ test="$$(basename "$${i}" ".c")"; \