solstice-pp

Post-processing utilities for the solstice app
git clone git://git.meso-star.com/solstice-pp.git
Log | Files | Refs | README | LICENSE

commit 7a8b3c40dc169e9229284411adf99edb73847ac5
parent ec3d09353b6582420337a37d237cbfb236614e73
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Tue, 23 Jun 2026 17:00:28 +0200

Improve code checking through compile flags

Diffstat:
MMakefile | 22++++++++++++++--------
Mconfig.mk | 50+++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile @@ -17,13 +17,11 @@ include config.mk - -SRC =\ - src/solmaps.c \ - src/solpp.c \ - src/solppraw.c \ - src/solpaths.c -PROG = $(SRC:.c=) +PROG =\ + solmaps \ + solpp \ + solppraw \ + solpaths PROJECTS = themis cyl @@ -39,8 +37,16 @@ clean: rm -rf $(PROG) for i in $(PROJECTS); do $(MAKE) -C "$${i}" clean; done +solmaps: src/solmaps.c + +solpp: src/solpp.c + +solppraw: src/solppraw.c + +solpaths: src/solpaths.c + $(PROG): src/solpp.h - $(CC) -o $@ $(CFLAGS) $@.c + $(CC) -o $@ $(CFLAGS) src/$@.c run: $(PROJECTS) diff --git a/config.mk b/config.mk @@ -13,8 +13,52 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -VERSION = 0.3.1 +VERSION_MAJOR = 0 +VERSION_MINOR = 4 +VERSION_PATCH = 0 +VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) + PREFIX = /usr/local -CFLAGS = -O2 -std=c99 -pedantic -Wall -#CFLAGS = -g -std=c99 -pedantic -Wall +#BUILD_TYPE = RELEASE +BUILD_TYPE = DEBUG + +################################################################################ +# Tools +################################################################################ +AR = ar +CC = cc +LD = ld +OBJCOPY = objcopy +PKG_CONFIG = pkg-config +RANLIB = ranlib + +################################################################################ +# Compilation options +################################################################################ +WFLAGS =\ + -Wall\ + -Wcast-align\ + -Wconversion\ + -Wextra\ + -Wmissing-declarations\ + -Wmissing-prototypes\ + -Wshadow + +CFLAGS_HARDENED =\ + -D_FORTIFY_SOURCES=2\ + -fcf-protection=full\ + -fstack-clash-protection\ + -fstack-protector-strong + +CFLAGS_COMMON =\ + -std=c99\ + -pedantic\ + -fvisibility=hidden\ + -fstrict-aliasing\ + $(CFLAGS_HARDENED)\ + $(WFLAGS) + +CFLAGS_RELEASE = -O2 -DNDEBUG $(CFLAGS_COMMON) +CFLAGS_DEBUG = -g $(CFLAGS_COMMON) +CFLAGS = $(CFLAGS_$(BUILD_TYPE))