make(1): allow to build using GCC 9 during development

This commit is contained in:
rillig 2020-08-09 05:51:04 +00:00
parent f645bd71ad
commit 5f58857059

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.83 2020/08/08 13:50:23 rillig Exp $
# $NetBSD: Makefile,v 1.84 2020/08/09 05:51:04 rillig Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
PROG= make
@ -56,6 +56,18 @@ COPTS+= -fsanitize=undefined
LDADD+= -fsanitize=undefined
.endif
# Whether to compile with GCC 9 from pkgsrc, during development.
USE_GCC9?= no
.if ${USE_GCC9} == "yes"
# CC is set further down in this file
COPTS+= -Wno-attributes # for abs and labs
COPTS.arch.c+= -Wno-error=format-truncation
COPTS.dir.c+= -Wno-error=format-truncation
COPTS.main.c+= -Wno-error=format-truncation
COPTS.meta.c+= -Wno-error=format-truncation
COPTS.parse.c+= -Wno-error=format-truncation
.endif
USE_META?= yes
.if ${USE_META:tl} != "no"
@ -96,6 +108,10 @@ COPTS.job.c+= -Wno-format-nonliteral
COPTS.parse.c+= -Wno-format-nonliteral
COPTS.var.c+= -Wno-format-nonliteral
.if ${USE_GCC9} == "yes"
CC= /usr/pkg/gcc9/bin/gcc
.endif
.if defined(TOOLDIR)
# This is a native NetBSD build, use libutil rather than the local emalloc etc.
CPPFLAGS+= -DUSE_EMALLOC