From f328d583a2124a0cb6b96ed97b40f25b540452df Mon Sep 17 00:00:00 2001
From: Dima Dorfman
Date: Wed, 5 Sep 2001 20:10:59 +0000
Subject: [PATCH] Use CFLAGS, not COPTS, in the Makefile. bsd.prog.mk
conveniently adds COPTS towards the end of final CFLAGS so that it can be
used to override Makefile and other defaults. Using it in Makefiles risks
having options set using it clobbered when somebody uses it on the command
line.
Approved by: bde
---
sbin/ifconfig/Makefile | 2 +-
sbin/ping/Makefile | 4 ++--
usr.bin/chpass/Makefile | 4 ++--
usr.bin/logger/Makefile | 2 +-
usr.bin/split/Makefile | 3 ++-
usr.sbin/inetd/Makefile | 4 ++--
6 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index fd60e0680f28..08d130cb873a 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -28,7 +28,7 @@ DPADD= ${LIBIPX}
LDADD= -lipx
.endif
-COPTS= -DNS -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings \
+CFLAGS+=-DNS -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings \
-Wnested-externs -I..
.include
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index 1cb5d07f86a6..45ca4497d746 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@ -4,9 +4,9 @@
PROG= ping
MAN= ping.8
BINMODE=4555
-COPTS+= -Wall -Wmissing-prototypes
+CFLAGS+=-Wall -Wmissing-prototypes
.if ${MACHINE_ARCH} == "alpha"
-COPTS+= -fno-builtin # GCC's builtin memcpy doesn't do unaligned copies
+CFLAGS+=-fno-builtin # GCC's builtin memcpy doesn't do unaligned copies
.endif
DPADD= ${LIBM}
LDADD= -lm
diff --git a/usr.bin/chpass/Makefile b/usr.bin/chpass/Makefile
index 8b2db0b19407..393087328729 100644
--- a/usr.bin/chpass/Makefile
+++ b/usr.bin/chpass/Makefile
@@ -22,11 +22,11 @@ LINKS+= ${BINDIR}/chpass ${BINDIR}/ypchsh
MLINKS= chpass.1 chfn.1 chpass.1 chsh.1
MLINKS+= chpass.1 ypchpass.1 chpass.1 ypchfn.1 chpass.1 ypchsh.1
-COPTS+= -DYP -I. -I${.CURDIR}/../../libexec/ypxfr \
+CFLAGS+=-DYP -I. -I${.CURDIR}/../../libexec/ypxfr \
-I${.CURDIR}/../../usr.sbin/rpc.yppasswdd -Dyp_error=warnx
#Some people need this, uncomment to activate
-#COPTS+= -DRESTRICT_FULLNAME_CHANGE
+#CFLAGS+=-DRESTRICT_FULLNAME_CHANGE
DPADD= ${LIBRPCSVC} ${LIBCRYPT} ${LIBMD}
LDADD+= -lrpcsvc -lcrypt -lmd
diff --git a/usr.bin/logger/Makefile b/usr.bin/logger/Makefile
index 163cdec2678f..48c52513500d 100644
--- a/usr.bin/logger/Makefile
+++ b/usr.bin/logger/Makefile
@@ -2,6 +2,6 @@
# $FreeBSD$
PROG= logger
-COPTS+= -DINET6
+CFLAGS+=-DINET6
.include
diff --git a/usr.bin/split/Makefile b/usr.bin/split/Makefile
index ffac658297f4..3b55092f68d8 100644
--- a/usr.bin/split/Makefile
+++ b/usr.bin/split/Makefile
@@ -1,6 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
PROG= split
-COPTS+= -Wall
+CFLAGS+=-Wall
.include
diff --git a/usr.sbin/inetd/Makefile b/usr.sbin/inetd/Makefile
index 2e1d831dc461..cf82f76340e7 100644
--- a/usr.sbin/inetd/Makefile
+++ b/usr.sbin/inetd/Makefile
@@ -9,8 +9,8 @@ MLINKS= inetd.8 inetd.conf.5
SRCS= inetd.c builtins.c
#WARNS?= 2
-COPTS+= -DLOGIN_CAP
-#COPTS+= -DSANITY_CHECK
+CFLAGS+= -DLOGIN_CAP
+#CFLAGS+= -DSANITY_CHECK
DPADD= ${LIBUTIL} ${LIBWRAP}
LDADD= -lutil -lwrap