| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.kern.inc,v 1.293 2022/01/06 17:05:32 christos Exp $ | | 1 | # $NetBSD: Makefile.kern.inc,v 1.294 2022/08/03 09:37:37 riastradh Exp $ |
2 | # | | 2 | # |
3 | # This file contains common `MI' targets and definitions and it is included | | 3 | # This file contains common `MI' targets and definitions and it is included |
4 | # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. | | 4 | # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. |
5 | # | | 5 | # |
6 | # Each target in this file should be protected with `if !target(target)' | | 6 | # Each target in this file should be protected with `if !target(target)' |
7 | # or `if !commands(target)' and each variable should only be conditionally | | 7 | # or `if !commands(target)' and each variable should only be conditionally |
8 | # assigned `VAR ?= VALUE', so that everything can be overridden. | | 8 | # assigned `VAR ?= VALUE', so that everything can be overridden. |
9 | # | | 9 | # |
10 | # DEBUG is set to -g if debugging. | | 10 | # DEBUG is set to -g if debugging. |
11 | # PROF is set to -pg if profiling. | | 11 | # PROF is set to -pg if profiling. |
12 | # | | 12 | # |
13 | # To specify debugging, add the config line: makeoptions DEBUG="-g" | | 13 | # To specify debugging, add the config line: makeoptions DEBUG="-g" |
14 | # A better way is to specify -g only for a few files. | | 14 | # A better way is to specify -g only for a few files. |
| @@ -72,26 +72,27 @@ CPPFLAGS+= -std=gnu99 | | | @@ -72,26 +72,27 @@ CPPFLAGS+= -std=gnu99 |
72 | CPPFLAGS+= -DKERNEL_DIR | | 72 | CPPFLAGS+= -DKERNEL_DIR |
73 | .endif | | 73 | .endif |
74 | DEFCOPTS?= -O2 | | 74 | DEFCOPTS?= -O2 |
75 | COPTS?= ${DEFCOPTS} | | 75 | COPTS?= ${DEFCOPTS} |
76 | DBG= # might contain unwanted -Ofoo | | 76 | DBG= # might contain unwanted -Ofoo |
77 | CWARNFLAGS+= -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith | | 77 | CWARNFLAGS+= -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith |
78 | CWARNFLAGS+= -Wmissing-prototypes -Wstrict-prototypes | | 78 | CWARNFLAGS+= -Wmissing-prototypes -Wstrict-prototypes |
79 | CWARNFLAGS+= -Wold-style-definition | | 79 | CWARNFLAGS+= -Wold-style-definition |
80 | CWARNFLAGS+= -Wswitch -Wshadow | | 80 | CWARNFLAGS+= -Wswitch -Wshadow |
81 | CWARNFLAGS+= -Wcast-qual -Wwrite-strings | | 81 | CWARNFLAGS+= -Wcast-qual -Wwrite-strings |
82 | CWARNFLAGS+= -Wno-unreachable-code | | 82 | CWARNFLAGS+= -Wno-unreachable-code |
83 | #CWARNFLAGS+= -Wc++-compat -Wno-error=c++-compat | | 83 | #CWARNFLAGS+= -Wc++-compat -Wno-error=c++-compat |
84 | CWARNFLAGS+= -Wno-pointer-sign -Wno-attributes | | 84 | CWARNFLAGS+= -Wno-pointer-sign -Wno-attributes |
| | | 85 | CWARNFLAGS+= -Wno-type-limits |
85 | . if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \ | | 86 | . if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \ |
86 | ${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep" | | 87 | ${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep" |
87 | CWARNFLAGS+= -Wextra -Wno-unused-parameter | | 88 | CWARNFLAGS+= -Wextra -Wno-unused-parameter |
88 | . endif | | 89 | . endif |
89 | . if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" | | 90 | . if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" |
90 | CWARNFLAGS+= -Wold-style-definition | | 91 | CWARNFLAGS+= -Wold-style-definition |
91 | . endif | | 92 | . endif |
92 | # Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3, | | 93 | # Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3, |
93 | # but our sources aren't up for it yet. | | 94 | # but our sources aren't up for it yet. |
94 | CWARNFLAGS+= -Wno-sign-compare | | 95 | CWARNFLAGS+= -Wno-sign-compare |
95 | | | 96 | |
96 | CWARNFLAGS.clang+= -Wno-unknown-pragmas -Wno-conversion \ | | 97 | CWARNFLAGS.clang+= -Wno-unknown-pragmas -Wno-conversion \ |
97 | -Wno-self-assign -Wno-error=address-of-packed-member \ | | 98 | -Wno-self-assign -Wno-error=address-of-packed-member \ |