From c7b7a6ea2978a30f18f68b1fb46428b07ba7f06c Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Wed, 27 Feb 2013 17:53:12 +0100 Subject: [PATCH] Let the build system manage compilation flags Do not hardcode warning and optimisation flags, otherwise the main options (i.e. DBG, CPPFLAGS) will not work as expected. You can still provide specific default by using DBG?=. Doing so leaves the opportunity to override the setting from the commandline, while the default value from the build system is then ignored for that particular package. When crosscompiling, and using build.sh, adding -V DBG= has this same effect as make DBG=. Change-Id: Ic610e4d33b945acad64571e1431f1814291e2d84 --- lib/libgpio/Makefile | 4 ++-- lib/libmthread/Makefile | 2 -- lib/libpadconf/Makefile | 2 +- lib/librefuse/Makefile | 2 +- servers/inet/Makefile | 2 +- share/mk/sys.mk | 3 +-- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/libgpio/Makefile b/lib/libgpio/Makefile index b12822084..d93327518 100644 --- a/lib/libgpio/Makefile +++ b/lib/libgpio/Makefile @@ -1,6 +1,6 @@ -# Makefile for libmthread +# Makefile for libgpio -CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM +CPPFLAGS+= -D_SYSTEM LIB= gpio diff --git a/lib/libmthread/Makefile b/lib/libmthread/Makefile index c30afa63f..9861b7619 100644 --- a/lib/libmthread/Makefile +++ b/lib/libmthread/Makefile @@ -1,7 +1,5 @@ # Makefile for libmthread -CPPFLAGS+= -O1 -Wall -Werror - LIB= mthread SRCS= \ diff --git a/lib/libpadconf/Makefile b/lib/libpadconf/Makefile index c6d1e92b7..9aa95f5a4 100644 --- a/lib/libpadconf/Makefile +++ b/lib/libpadconf/Makefile @@ -1,6 +1,6 @@ # Makefile for libpadconf -CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM +CPPFLAGS+= -D_SYSTEM LIB= padconf diff --git a/lib/librefuse/Makefile b/lib/librefuse/Makefile index de640d259..5a6b9a485 100644 --- a/lib/librefuse/Makefile +++ b/lib/librefuse/Makefile @@ -6,7 +6,7 @@ LIB= refuse LIBDPLIBS+= puffs ${.CURDIR}/../libpuffs .ifdef DEBUG -FUSE_OPT_DEBUG_FLAGS= -g -DFUSE_OPT_DEBUG +FUSE_OPT_DEBUG_FLAGS= -DFUSE_OPT_DEBUG .endif CFLAGS+= ${FUSE_OPT_DEBUG_FLAGS} diff --git a/servers/inet/Makefile b/servers/inet/Makefile index 6445e0398..ea43567ec 100644 --- a/servers/inet/Makefile +++ b/servers/inet/Makefile @@ -21,6 +21,6 @@ MAN= BINDIR?= /usr/sbin -CPPFLAGS+= -I${.CURDIR} -D'ARGS(a)=a' -Wall -Werror +CPPFLAGS+= -I${.CURDIR} -D'ARGS(a)=a' .include diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 6bb19769e..88a9ec20d 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -6,13 +6,12 @@ __MINIX= yes .if defined(__MINIX) .if ${MKSMALL:U} == "yes" +CPPFLAGS+= -DNDEBUG DBG= -Os -CFLAGS+= -DNDEBUG .endif unix?= We run MINIX. -DBG?= -O CPP?= /usr/lib/cpp .endif # defined(__MINIX) unix?= We run NetBSD.