From 76c3dc9b44d799bcd33389caf34af9dbe4120cd7 Mon Sep 17 00:00:00 2001 From: Milan Skocic Date: Thu, 21 Nov 2024 10:41:46 +0100 Subject: [PATCH] Add building profile in Makefile for C code. --- C/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/C/Makefile b/C/Makefile index d43d14b..c55b096 100644 --- a/C/Makefile +++ b/C/Makefile @@ -1,3 +1,9 @@ +ifeq ($(profile), debug) + CFLAGS = $(CFLAGS_DEBUG) +else + CFLAGS=$(CFLAGS_RELEASE) +endif + PY=python GEN_C=../scripts/gen_c.py GEN_H=../scripts/gen_headers.py @@ -37,10 +43,10 @@ include/%.h: ../data/%.toml build: sources $(C_OBJ) example: ./example/example.c build static shared - gcc $< -I./include -L./build/ -lcodata $(CFLAGS_RELEASE) $(FPM_CFLAGS) -o ./build/$@ -Wl,-rpath=. + gcc $< -I./include -L./build/ -lcodata $(CFLAGS) $(FPM_CFLAGS) -o ./build/$@ -Wl,-rpath=. build/%.o: src/%.c - gcc -c -I./include -fPIC $(CFLAGS_RELEASE) $(FPM_CFLAGS) $< -o $@ + gcc -c -I./include -fPIC $(CFLAGS) $(FPM_CFLAGS) $< -o $@ # ---------------------------------------------------------------------