head	1.13;
access;
symbols
	netbsd-11-0-RC4:1.13
	netbsd-11-0-RC3:1.13
	netbsd-11-0-RC2:1.13
	netbsd-11-0-RC1:1.13
	perseant-exfatfs-base-20250801:1.13
	netbsd-11:1.13.0.4
	netbsd-11-base:1.13
	netbsd-10-1-RELEASE:1.11
	perseant-exfatfs-base-20240630:1.13
	perseant-exfatfs:1.13.0.2
	perseant-exfatfs-base:1.13
	netbsd-8-3-RELEASE:1.10
	netbsd-9-4-RELEASE:1.10
	netbsd-10-0-RELEASE:1.11
	netbsd-10-0-RC6:1.11
	netbsd-10-0-RC5:1.11
	netbsd-10-0-RC4:1.11
	netbsd-10-0-RC3:1.11
	netbsd-10-0-RC2:1.11
	netbsd-10-0-RC1:1.11
	netbsd-10:1.11.0.6
	netbsd-10-base:1.11
	netbsd-9-3-RELEASE:1.10
	cjep_sun2x-base1:1.11
	cjep_sun2x:1.11.0.4
	cjep_sun2x-base:1.11
	cjep_staticlib_x-base1:1.11
	netbsd-9-2-RELEASE:1.10
	cjep_staticlib_x:1.11.0.2
	cjep_staticlib_x-base:1.11
	netbsd-9-1-RELEASE:1.10
	phil-wifi-20200421:1.10
	phil-wifi-20200411:1.10
	is-mlppp:1.10.0.18
	is-mlppp-base:1.10
	phil-wifi-20200406:1.10
	netbsd-8-2-RELEASE:1.10
	netbsd-9-0-RELEASE:1.10
	netbsd-9-0-RC2:1.10
	netbsd-9-0-RC1:1.10
	phil-wifi-20191119:1.10
	netbsd-9:1.10.0.16
	netbsd-9-base:1.10
	phil-wifi-20190609:1.10
	netbsd-8-1-RELEASE:1.10
	netbsd-8-1-RC1:1.10
	pgoyette-compat-merge-20190127:1.10
	pgoyette-compat-20190127:1.10
	pgoyette-compat-20190118:1.10
	pgoyette-compat-1226:1.10
	pgoyette-compat-1126:1.10
	pgoyette-compat-1020:1.10
	pgoyette-compat-0930:1.10
	pgoyette-compat-0906:1.10
	netbsd-7-2-RELEASE:1.8
	pgoyette-compat-0728:1.10
	netbsd-8-0-RELEASE:1.10
	phil-wifi:1.10.0.14
	phil-wifi-base:1.10
	pgoyette-compat-0625:1.10
	netbsd-8-0-RC2:1.10
	pgoyette-compat-0521:1.10
	pgoyette-compat-0502:1.10
	pgoyette-compat-0422:1.10
	netbsd-8-0-RC1:1.10
	pgoyette-compat-0415:1.10
	pgoyette-compat-0407:1.10
	pgoyette-compat-0330:1.10
	pgoyette-compat-0322:1.10
	pgoyette-compat-0315:1.10
	netbsd-7-1-2-RELEASE:1.8
	pgoyette-compat:1.10.0.12
	pgoyette-compat-base:1.10
	netbsd-7-1-1-RELEASE:1.8
	matt-nb8-mediatek:1.10.0.10
	matt-nb8-mediatek-base:1.10
	perseant-stdc-iso10646:1.10.0.8
	perseant-stdc-iso10646-base:1.10
	netbsd-8:1.10.0.6
	netbsd-8-base:1.10
	prg-localcount2-base3:1.10
	prg-localcount2-base2:1.10
	prg-localcount2-base1:1.10
	prg-localcount2:1.10.0.4
	prg-localcount2-base:1.10
	pgoyette-localcount-20170426:1.10
	bouyer-socketcan-base1:1.10
	pgoyette-localcount-20170320:1.10
	netbsd-7-1:1.8.0.28
	netbsd-7-1-RELEASE:1.8
	netbsd-7-1-RC2:1.8
	netbsd-7-nhusb-base-20170116:1.8
	bouyer-socketcan:1.10.0.2
	bouyer-socketcan-base:1.10
	pgoyette-localcount-20170107:1.9
	netbsd-7-1-RC1:1.8
	pgoyette-localcount-20161104:1.9
	netbsd-7-0-2-RELEASE:1.8
	localcount-20160914:1.9
	netbsd-7-nhusb:1.8.0.26
	netbsd-7-nhusb-base:1.8
	pgoyette-localcount-20160806:1.9
	pgoyette-localcount-20160726:1.9
	pgoyette-localcount:1.9.0.2
	pgoyette-localcount-base:1.9
	netbsd-7-0-1-RELEASE:1.8
	netbsd-7-0:1.8.0.24
	netbsd-7-0-RELEASE:1.8
	netbsd-7-0-RC3:1.8
	netbsd-7-0-RC2:1.8
	netbsd-7-0-RC1:1.8
	netbsd-5-2-3-RELEASE:1.5
	netbsd-5-1-5-RELEASE:1.5
	netbsd-6-0-6-RELEASE:1.8
	netbsd-6-1-5-RELEASE:1.8
	netbsd-7:1.8.0.22
	netbsd-7-base:1.8
	yamt-pagecache-base9:1.8
	yamt-pagecache-tag8:1.8
	netbsd-6-1-4-RELEASE:1.8
	netbsd-6-0-5-RELEASE:1.8
	tls-earlyentropy:1.8.0.20
	tls-earlyentropy-base:1.8
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.8
	riastradh-drm2-base3:1.8
	netbsd-6-1-3-RELEASE:1.8
	netbsd-6-0-4-RELEASE:1.8
	netbsd-5-2-2-RELEASE:1.5
	netbsd-5-1-4-RELEASE:1.5
	netbsd-6-1-2-RELEASE:1.8
	netbsd-6-0-3-RELEASE:1.8
	netbsd-5-2-1-RELEASE:1.5
	netbsd-5-1-3-RELEASE:1.5
	netbsd-6-1-1-RELEASE:1.8
	riastradh-drm2-base2:1.8
	riastradh-drm2-base1:1.8
	riastradh-drm2:1.8.0.14
	riastradh-drm2-base:1.8
	netbsd-6-1:1.8.0.18
	netbsd-6-0-2-RELEASE:1.8
	netbsd-6-1-RELEASE:1.8
	netbsd-6-1-RC4:1.8
	netbsd-6-1-RC3:1.8
	agc-symver:1.8.0.16
	agc-symver-base:1.8
	netbsd-6-1-RC2:1.8
	netbsd-6-1-RC1:1.8
	yamt-pagecache-base8:1.8
	netbsd-5-2:1.5.0.30
	netbsd-6-0-1-RELEASE:1.8
	yamt-pagecache-base7:1.8
	netbsd-5-2-RELEASE:1.5
	netbsd-5-2-RC1:1.5
	matt-nb6-plus-nbase:1.8
	yamt-pagecache-base6:1.8
	netbsd-6-0:1.8.0.12
	netbsd-6-0-RELEASE:1.8
	netbsd-6-0-RC2:1.8
	tls-maxphys:1.8.0.10
	tls-maxphys-base:1.8
	matt-nb6-plus:1.8.0.8
	matt-nb6-plus-base:1.8
	netbsd-6-0-RC1:1.8
	yamt-pagecache-base5:1.8
	yamt-pagecache-base4:1.8
	netbsd-6:1.8.0.6
	netbsd-6-base:1.8
	netbsd-5-1-2-RELEASE:1.5
	netbsd-5-1-1-RELEASE:1.5
	yamt-pagecache-base3:1.8
	yamt-pagecache-base2:1.8
	yamt-pagecache:1.8.0.4
	yamt-pagecache-base:1.8
	cherry-xenmp:1.8.0.2
	cherry-xenmp-base:1.8
	bouyer-quota2-nbase:1.7
	bouyer-quota2:1.7.0.2
	bouyer-quota2-base:1.7
	matt-mips64-premerge-20101231:1.7
	matt-nb5-mips64-premerge-20101231:1.5
	matt-nb5-pq3:1.5.0.28
	matt-nb5-pq3-base:1.5
	netbsd-5-1:1.5.0.26
	netbsd-5-1-RELEASE:1.5
	netbsd-5-1-RC4:1.5
	matt-nb5-mips64-k15:1.5
	netbsd-5-1-RC3:1.5
	netbsd-5-1-RC2:1.5
	netbsd-5-1-RC1:1.5
	netbsd-5-0-2-RELEASE:1.5
	matt-nb5-mips64-premerge-20091211:1.5
	matt-premerge-20091211:1.7
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.5
	matt-nb4-mips64-k7-u2a-k9b:1.5
	matt-nb5-mips64-u1-k1-k5:1.5
	matt-nb5-mips64:1.5.0.24
	netbsd-5-0-1-RELEASE:1.5
	jym-xensuspend-nbase:1.7
	netbsd-5-0:1.5.0.22
	netbsd-5-0-RELEASE:1.5
	netbsd-5-0-RC4:1.5
	netbsd-5-0-RC3:1.5
	netbsd-5-0-RC2:1.5
	jym-xensuspend:1.5.0.20
	jym-xensuspend-base:1.7
	netbsd-5-0-RC1:1.5
	netbsd-5:1.5.0.18
	netbsd-5-base:1.5
	matt-mips64-base2:1.5
	matt-mips64:1.5.0.16
	mjf-devfs2:1.5.0.14
	mjf-devfs2-base:1.5
	netbsd-4-0-1-RELEASE:1.4
	wrstuden-revivesa-base-3:1.5
	wrstuden-revivesa-base-2:1.5
	wrstuden-fixsa-newbase:1.4
	wrstuden-revivesa-base-1:1.5
	yamt-pf42-base4:1.5
	yamt-pf42-base3:1.5
	hpcarm-cleanup-nbase:1.5
	yamt-pf42-baseX:1.5
	yamt-pf42-base2:1.5
	wrstuden-revivesa:1.5.0.12
	wrstuden-revivesa-base:1.5
	yamt-pf42:1.5.0.10
	yamt-pf42-base:1.5
	keiichi-mipv6-nbase:1.5
	keiichi-mipv6:1.5.0.8
	keiichi-mipv6-base:1.5
	matt-armv6-nbase:1.5
	matt-armv6-prevmlocking:1.5
	wrstuden-fixsa-base-1:1.4
	netbsd-4-0:1.4.0.14
	netbsd-4-0-RELEASE:1.4
	cube-autoconf:1.5.0.6
	cube-autoconf-base:1.5
	netbsd-4-0-RC5:1.4
	netbsd-4-0-RC4:1.4
	netbsd-4-0-RC3:1.4
	netbsd-4-0-RC2:1.4
	netbsd-4-0-RC1:1.4
	matt-armv6:1.5.0.4
	matt-armv6-base:1.5
	matt-mips64-base:1.5
	hpcarm-cleanup:1.5.0.2
	hpcarm-cleanup-base:1.5
	netbsd-3-1-1-RELEASE:1.4
	netbsd-3-0-3-RELEASE:1.4
	wrstuden-fixsa:1.4.0.12
	wrstuden-fixsa-base:1.4
	abandoned-netbsd-4-base:1.4
	abandoned-netbsd-4:1.4.0.6
	netbsd-3-1:1.4.0.8
	netbsd-3-1-RELEASE:1.4
	netbsd-3-0-2-RELEASE:1.4
	netbsd-3-1-RC4:1.4
	netbsd-3-1-RC3:1.4
	netbsd-3-1-RC2:1.4
	netbsd-3-1-RC1:1.4
	netbsd-4:1.4.0.10
	netbsd-4-base:1.4
	netbsd-3-0-1-RELEASE:1.4
	netbsd-3-0:1.4.0.4
	netbsd-3-0-RELEASE:1.4
	netbsd-3-0-RC6:1.4
	netbsd-3-0-RC5:1.4
	netbsd-3-0-RC4:1.4
	netbsd-3-0-RC3:1.4
	netbsd-3-0-RC2:1.4
	netbsd-3-0-RC1:1.4
	netbsd-3:1.4.0.2
	netbsd-3-base:1.4;
locks; strict;
comment	@# @;


1.13
date	2023.06.03.21.26.29;	author lukem;	state Exp;
branches;
next	1.12;
commitid	Ei0aZMNlbMuRXxrE;

1.12
date	2023.06.03.08.53.01;	author lukem;	state Exp;
branches;
next	1.11;
commitid	JFrjk5m11qFkNtrE;

1.11
date	2020.09.06.07.20.32;	author mrg;	state Exp;
branches;
next	1.10;
commitid	IFqEYW6MZdeXkXmC;

1.10
date	2017.01.11.12.19.44;	author joerg;	state Exp;
branches;
next	1.9;
commitid	Mzi1RRAPKHaCXxBz;

1.9
date	2015.01.29.03.31.35;	author christos;	state Exp;
branches
	1.9.2.1;
next	1.8;
commitid	w2LJRbMqprqrXR7y;

1.8
date	2011.05.26.12.56.34;	author joerg;	state Exp;
branches;
next	1.7;

1.7
date	2009.04.23.05.25.06;	author lukem;	state Exp;
branches;
next	1.6;

1.6
date	2009.04.22.15.23.06;	author lukem;	state Exp;
branches;
next	1.5;

1.5
date	2007.05.28.12.06.38;	author tls;	state Exp;
branches
	1.5.20.1;
next	1.4;

1.4
date	2004.11.16.05.14.12;	author yamt;	state Exp;
branches;
next	1.3;

1.3
date	2004.11.14.11.26.48;	author yamt;	state Exp;
branches;
next	1.2;

1.2
date	2004.11.11.12.03.53;	author yamt;	state Exp;
branches;
next	1.1;

1.1
date	2004.11.11.11.54.51;	author yamt;	state Exp;
branches;
next	;

1.9.2.1
date	2017.03.20.06.58.08;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.5.20.1
date	2009.05.13.19.20.32;	author jym;	state Exp;
branches;
next	;


desc
@@


1.13
log
@adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
@
text
@#	$NetBSD: Makefile.inc,v 1.12 2023/06/03 08:53:01 lukem Exp $

WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
CWARNFLAGS.clang+=	-Wno-tautological-compare
CWARNFLAGS+=		${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

CPPFLAGS+= -D_OPENBSD_SOURCE

.if exists(${.CURDIR}/../../Makefile.inc)
.include "${.CURDIR}/../../Makefile.inc"
.endif

USE_FORT?=yes	# network client *and* setuid
@


1.12
log
@bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.11 2020/09/06 07:20:32 mrg Exp $
d5 1
a5 2
CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
@


1.11
log
@add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.10 2017/01/11 12:19:44 joerg Exp $
d6 1
a6 1
CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
@


1.10
log
@Disable a couple of warnings until further investigation.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.9 2015/01/29 03:31:35 christos Exp $
d6 1
@


1.9
log
@use strtonum from libc
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.8 2011/05/26 12:56:34 joerg Exp $
d5 1
@


1.9.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.10 2017/01/11 12:19:44 joerg Exp $
a4 1
CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
@


1.8
log
@Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.7 2009/04/23 05:25:06 lukem Exp $
d6 1
a6 1
CPPFLAGS+=	-include ${.CURDIR}/../compat_openbsd.h
@


1.7
log
@WARNS=1 for pf
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.6 2009/04/22 15:23:06 lukem Exp $
d4 1
@


1.6
log
@Enable WARNS=4 by default, except for:
	cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
@
text
@d1 3
a3 1
#	$NetBSD: Makefile.inc,v 1.5 2007/05/28 12:06:38 tls Exp $
@


1.5
log
@Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.4 2004/11/16 05:14:12 yamt Exp $
a4 2
WARNS?=	1

@


1.5.20.1
log
@Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.7 2009/04/23 05:25:06 lukem Exp $
d3 1
a3 1
WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
d5 1
a5 1
CPPFLAGS+=	-include ${.CURDIR}/../compat_openbsd.h
@


1.4
log
@don't use variable arg macro, which is not supported by gcc2.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.3 2004/11/14 11:26:48 yamt Exp $
d10 2
@


1.3
log
@merge after importing pf from openbsd 3.6. (userland part)

some files were imported to the different places from the previous version.
v3_5:
	etc/pf.conf
	etc/pf.os
	etc/spamd.conf
	share/man/man4/pf.4
	share/man/man4/pflog.4
	share/man/man5/pf.conf.5
	share/man/man5/pf.os.5
	share/man/man5/spamd.conf.5
v3_6:
	dist/pf/etc/pf.conf
	dist/pf/etc/pf.os
	dist/pf/etc/spamd.conf
	dist/pf/share/man/man4/pf.4
	dist/pf/share/man/man4/pflog.4
	dist/pf/share/man/man5/pf.conf.5
	dist/pf/share/man/man5/pf.os.5
	dist/pf/share/man/man5/spamd.conf.5
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.2 2004/11/11 12:03:53 yamt Exp $
d3 1
a3 6
# misc OpenBSD compatibility stuffs.
#  NetBSD doesn't have syslog_r.
CPPFLAGS+=	-D'openlog_r(ident, logopt, fac, data)=/*nothing*/'
CPPFLAGS+=	-D'syslog_r(pri, data, ...)=syslog((pri), __VA_ARGS__)'
#  NetBSD doesn't have TAILQ_END.
CPPFLAGS+=	-D'TAILQ_END(h)=NULL'
@


1.2
log
@move common fragments into Makefile.inc.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.inc,v 1.1 2004/11/11 11:54:51 yamt Exp $
d3 2
a4 1
# NetBSD doesn't have syslog_r.
d7 2
@


1.1
log
@move pf reachover makefiles into usr.sbin/pf.  ok'ed by itojun.

before:
	sbin/pfctl
	usr.sbin/authpf
	usr.sbin/spamdb
	libexec/ftp-proxy
	libexec/spamd
	libexec/spamd-setup
	libexec/spamlogd
after:
	usr.sbin/pf/pfctl
	usr.sbin/pf/authpf
	usr.sbin/pf/spamdb
	usr.sbin/pf/ftp-proxy
	usr.sbin/pf/spamd
	usr.sbin/pf/spamd-setup
	usr.sbin/pf/spamlogd
@
text
@d1 7
a7 1
#	$NetBSD$
@

