From: Lionel Sambuc Date: Wed, 27 Feb 2013 16:53:12 +0000 (+0100) Subject: Let the build system manage compilation flags X-Git-Tag: v3.3.0~1099 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch04.html?a=commitdiff_plain;h=fbd82e76a48340fbe0edb0e9241ec97e5eeaa2ff;p=minix.git 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 --- diff --git a/lib/libgpio/Makefile b/lib/libgpio/Makefile index b12822084..8c5cb2be3 100644 --- a/lib/libgpio/Makefile +++ b/lib/libgpio/Makefile @@ -1,10 +1,12 @@ -# Makefile for libmthread +# Makefile for libgpio -CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM +CPPFLAGS+= -D_SYSTEM LIB= gpio SRCS= \ gpio_omap.c clkconf.c +WARNS?= 5 + .include diff --git a/lib/libmthread/Makefile b/lib/libmthread/Makefile index c30afa63f..95d1876d0 100644 --- a/lib/libmthread/Makefile +++ b/lib/libmthread/Makefile @@ -1,7 +1,5 @@ # Makefile for libmthread -CPPFLAGS+= -O1 -Wall -Werror - LIB= mthread SRCS= \ @@ -16,4 +14,6 @@ SRCS= \ scheduler.c \ key.c +WARNS?= 5 + .include diff --git a/lib/libpadconf/Makefile b/lib/libpadconf/Makefile index c6d1e92b7..1b9d5cb43 100644 --- a/lib/libpadconf/Makefile +++ b/lib/libpadconf/Makefile @@ -1,10 +1,12 @@ # Makefile for libpadconf -CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM +CPPFLAGS+= -D_SYSTEM LIB= padconf SRCS= \ padconf.c +WARNS?= 5 + .include diff --git a/lib/librefuse/Makefile b/lib/librefuse/Makefile index de640d259..2b7fd10dc 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} @@ -16,4 +16,6 @@ WARNS= 4 INCS= fuse.h fuse_opt.h INCSDIR= /usr/include +WARNS?= 5 + .include diff --git a/servers/inet/Makefile b/servers/inet/Makefile index 6445e0398..936b372fb 100644 --- a/servers/inet/Makefile +++ b/servers/inet/Makefile @@ -21,6 +21,8 @@ MAN= BINDIR?= /usr/sbin -CPPFLAGS+= -I${.CURDIR} -D'ARGS(a)=a' -Wall -Werror +CPPFLAGS+= -I${.CURDIR} -D'ARGS(a)=a' + +WARNS?= 5 .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.