Add support for compilation modes

This commit is contained in:
Pierre Pronchery 2022-04-30 02:02:08 +02:00
parent a79535107d
commit 1d3ae53c60
3 changed files with 24 additions and 3 deletions

View File

@ -6,6 +6,13 @@ subdirs=data,doc,include,src,tests
targets=tests
dist=Makefile,COPYING,config.h,config.sh
#modes
[mode::debug]
title=Debug
[mode::release]
title=Release
#targets
[tests]
type=command

View File

@ -1,12 +1,19 @@
targets=libcpp
cppflags_force=-I ../../include
cppflags_force=-I../../include
cppflags=
cflags_force=`pkg-config --cflags libSystem` -fPIC
cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all
cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags_force=`pkg-config --libs libSystem`
ldflags=
dist=Makefile,common.h,parser.h
#modes
[mode::debug]
[mode::release]
cppflags_force=-I../../include -DNDEBUG
cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector
#targets
[libcpp]
type=library

View File

@ -3,11 +3,18 @@ targets=cpp
cppflags_force=-I ../include
cppflags=
cflags_force=`pkg-config --cflags libSystem` -fPIE
cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all
cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags_force=`pkg-config --libs libSystem`
ldflags=-pie -Wl,-z,relro -Wl,-z,now
dist=Makefile
#modes
[mode::debug]
[mode::release]
cppflags_force=-I ../include -DNDEBUG
cflags=-W -Wall -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector
#targets
[cpp]
type=binary