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?=<value>.

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=<value> has
this same effect as make DBG=<value>.

Change-Id: Ic610e4d33b945acad64571e1431f1814291e2d84
This commit is contained in:
Lionel Sambuc 2013-02-27 17:53:12 +01:00
parent 10f4c3fbb1
commit fbd82e76a4
6 changed files with 16 additions and 9 deletions

View file

@ -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 <bsd.lib.mk>

View file

@ -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 <bsd.lib.mk>

View file

@ -1,10 +1,12 @@
# Makefile for libpadconf
CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM
CPPFLAGS+= -D_SYSTEM
LIB= padconf
SRCS= \
padconf.c
WARNS?= 5
.include <bsd.lib.mk>

View file

@ -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 <bsd.lib.mk>

View file

@ -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 <minix.service.mk>

View file

@ -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.