stardis-solver

Solve coupled heat transfers
git clone git://git.meso-star.fr/stardis-solver.git
Log | Files | Refs | README | LICENSE

commit b98ef8a65888de6a8a32f0249aeea7a0d3e3ff4f
parent 36485bb457b9e63dfad16d1eb714df0069ab1bd8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 15 Dec 2023 09:38:45 +0100

Add a sdis_version.h.in template

This file defines the macros for the library version. Their value is
generated when invoking make install from Makefile macros that define
the current version of the library. The resulting sdis_version.h header
is then installed with the other header files.

Note that this file was generated when the project relied on the CMake
build system. We deleted it when we replaced CMake with POSIX make,
because it seemed that this file was dispensable because it was not
used. This is actually not the case and at least the Stardis command
line program, which interfaces this library, expects to find this header
file. Hence this commit.

Diffstat:
M.gitignore | 1+
MMakefile | 10+++++++++-
Mconfig.mk | 5++++-
Asrc/sdis_version.h.in | 23+++++++++++++++++++++++
4 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -12,3 +12,4 @@ test* rng_state tags *.pc +src/sdis_version.h diff --git a/Makefile b/Makefile @@ -127,10 +127,17 @@ sdis-local.pc: sdis.pc.in config.mk -e 's#@MPI@#$(PKG_$(DISTRIB_PARALLELISM))#g'\ sdis.pc.in > $@ -install: build_library pkg +src/sdis_version.h: src/sdis_version.h.in config.mk + sed -e 's#@VERSION_MAJOR@#$(VERSION_MAJOR)#g' \ + -e 's#@VERSION_MINOR@#$(VERSION_MINOR)#g' \ + -e 's#@VERSION_PATCH@#$(VERSION_PATCH)#g' \ + src/sdis_version.h.in > $@ + +install: build_library pkg src/sdis_version.h @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME) @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib/pkgconfig" sdis.pc @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/" src/sdis.h + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/" src/sdis_version.h @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/stardis-solver" \ COPYING README.md @@ -140,6 +147,7 @@ uninstall: rm -f "$(DESTDIR)$(PREFIX)/share/doc/stardis-solver/COPYING" rm -f "$(DESTDIR)$(PREFIX)/share/doc/stardis-solver/README.md" rm -f "$(DESTDIR)$(PREFIX)/include/sdis.h" + rm -f "$(DESTDIR)$(PREFIX)/include/sdis_version.h" ################################################################################ # Miscellaneous targets diff --git a/config.mk b/config.mk @@ -1,4 +1,7 @@ -VERSION = 0.15.0 +VERSION_MAJOR = 0 +VERSION_MINOR = 15 +VERSION_PATCH = 0 +VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) PREFIX = /usr/local LIB_TYPE = SHARED diff --git a/src/sdis_version.h.in b/src/sdis_version.h.in @@ -0,0 +1,23 @@ +/* Copyright (C) 2016-2023 |Méso|Star> (contact@meso-star.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef SDIS_VERSION_H +#define SDIS_VERSION_H + +#define SDIS_VERSION_MAJOR @VERSION_MAJOR@ +#define SDIS_VERSION_MINOR @VERSION_MINOR@ +#define SDIS_VERSION_PATCH @VERSION_PATCH@ + +#endif /* SDIS_VERSION_H */