aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bsd.lib.mk8
-rw-r--r--mk/bsd.own.mk6
-rw-r--r--mk/bsd.prog.mk5
3 files changed, 19 insertions, 0 deletions
diff --git a/mk/bsd.lib.mk b/mk/bsd.lib.mk
index 62b9dfa..202f0e7 100644
--- a/mk/bsd.lib.mk
+++ b/mk/bsd.lib.mk
@@ -8,6 +8,14 @@ CPPFLAGS+= -I${.TOPDIR}/include -include compat.h \
LDFLAGS += $(LDADD)
+ifeq ($(WARNINGS),yes)
+CFLAGS+= ${CDIAGFLAGS}
+CXXFLAGS+= ${CXXDIAGFLAGS}
+endif
+
+CFLAGS+= ${COPTS}
+CXXFLAGS+= ${CXXOPTS}
+
CFILES = $(filter %.c,$(SRCS))
YFILES = $(filter %.y,$(SRCS))
LFILES = $(filter %.l,$(SRCS))
diff --git a/mk/bsd.own.mk b/mk/bsd.own.mk
index 51f8a90..d141ab4 100644
--- a/mk/bsd.own.mk
+++ b/mk/bsd.own.mk
@@ -43,6 +43,12 @@ LIBOWN?= $(BINOWN)
LIBGRP?= $(BINGRP)
LIBMODE?= ${NONBINMODE}
+ifndef CDIAGFLAGS
+CDIAGFLAGS= -Wall -Wpointer-arith -Wuninitialized -Wstrict-prototypes
+CDIAGFLAGS+= -Wmissing-prototypes -Wunused -Wsign-compare
+CDIAGFLAGS+= -Wshadow
+endif
+
INSTALL_COPY?= -c
ifndef DEBUG
INSTALL_STRIP?= -s
diff --git a/mk/bsd.prog.mk b/mk/bsd.prog.mk
index 514a103..83fc504 100644
--- a/mk/bsd.prog.mk
+++ b/mk/bsd.prog.mk
@@ -20,6 +20,11 @@ endif
LDFLAGS+= -L$(dir $(LIBC)) $(LDADD) -lopenbsd
+ifeq ($(WARNINGS),yes)
+CFLAGS+= ${CDIAGFLAGS}
+CXXFLAGS+= ${CXXDIAGFLAGS}
+endif
+
CFLAGS+= ${COPTS}
CXXFLAGS+= ${CXXOPTS}