commit 2172c05c7483399eb5e732ca18e8304213b14773
parent 940d26112b6278513d16b78f17b4fb246f38d171
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 30 Mar 2025 17:29:46 +0200
Add the name of the core library to config.mk
In this way, each command can use it as a prerequisite, and thus
re-execute its build command when it is updated.
Diffstat:
5 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/Makefile.atmosphere b/Makefile.atmosphere
@@ -96,7 +96,7 @@ LDFLAGS_CMD = $(LDFLAGS_EXE) $$($(PKG_CONFIG_LOCAL) --static --libs htrdr-atmosp
command: library $(CMD_DEP)
@$(MAKE) -fMakefile.atmosphere -f$(CMD_DEP) htrdr-atmosphere
-htrdr-atmosphere: $(CMD_OBJ) $(LIBNAME)
+htrdr-atmosphere: $(CMD_OBJ) $(LIBNAME) $(CORE_NAME)
$(CC) $(CFLAGS_CMD) -o $@ $(CMD_OBJ) $(LDFLAGS_CMD)
$(CMD_DEP) $(CMD_OBJ): config.mk htrdr-atmosphere.pc
diff --git a/Makefile.combustion b/Makefile.combustion
@@ -96,7 +96,7 @@ LDFLAGS_CMD = $(LDFLAGS_EXE) $$($(PKG_CONFIG_LOCAL) --static --libs htrdr-combus
command: library $(CMD_DEP)
@$(MAKE) -fMakefile.combustion -f$(CMD_DEP) htrdr-combustion
-htrdr-combustion: $(CMD_OBJ) $(LIBNAME)
+htrdr-combustion: $(CMD_OBJ) $(LIBNAME) $(CORE_NAME)
$(CC) $(CFLAGS_CMD) -o $@ $(CMD_OBJ) $(LDFLAGS_CMD)
$(CMD_DEP):
@@ -123,7 +123,7 @@ tests: library $(TEST_DEP)
# Link with all obj files in the combustion library since the test checks
# hidden functions
-test_htrdr_combustion_laser: $(TEST_OBJ)
+test_htrdr_combustion_laser: $(TEST_OBJ) $(CORE_NAME)
$(CC) $(CFLAGS_TEST) -o $@ $(TEST_OBJ) $(OBJ) $(LDFLAGS_TEST)
$(TEST_DEP):
diff --git a/Makefile.core b/Makefile.core
@@ -26,9 +26,9 @@
include config.mk
-LIBNAME_STATIC = libhtrdr-core.a
-LIBNAME_SHARED = libhtrdr-core.so
-LIBNAME = $(LIBNAME_$(LIB_TYPE))
+LIBNAME_STATIC = $(CORE_NAME_STATIC)
+LIBNAME_SHARED = $(CORE_NAME_SHARED)
+LIBNAME = $(CORE_NAME)
default: core
diff --git a/Makefile.planets b/Makefile.planets
@@ -99,7 +99,7 @@ LDFLAGS_CMD = $(LDFLAGS_EXE) $$($(PKG_CONFIG_LOCAL) --static --libs htrdr-planet
command: library $(CMD_DEP)
@$(MAKE) -fMakefile.planets -f$(CMD_DEP) htrdr-planets
-htrdr-planets: $(CMD_OBJ) $(LIBNAME)
+htrdr-planets: $(CMD_OBJ) $(LIBNAME) $(CORE_NAME)
$(CC) $(CFLAGS_CMD) -o $@ $(CMD_OBJ) $(LDFLAGS_CMD)
$(CMD_DEP):
@@ -126,7 +126,7 @@ tests: library $(TEST_DEP)
# Link with all obj files in the planet library since the test checks
# hidden functions
-test_htrdr_planets_source: $(TEST_OBJ)
+test_htrdr_planets_source: $(TEST_OBJ) $(CORE_NAME)
$(CC) $(CFLAGS_TEST) -o $@ $(TEST_OBJ) $(OBJ) $(LDFLAGS_TEST)
$(TEST_DEP):
diff --git a/config.mk b/config.mk
@@ -124,6 +124,13 @@ PLANETS_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs\
$(MPI_PC) htrdr-core rnatm rngrd rsys s3d sbuf scam smsh ssf star-sp svx) -lm
################################################################################
+# Name of the core library
+################################################################################
+CORE_NAME_STATIC = libhtrdr-core.a
+CORE_NAME_SHARED = libhtrdr-core.so
+CORE_NAME = $(CORE_NAME_$(LIB_TYPE))
+
+################################################################################
# Compilation options
################################################################################
WFLAGS =\