aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2018-04-04 17:07:48 +0200
committerDuncaen <mail@duncano.de>2018-04-04 17:32:10 +0200
commit8d709679d375b3c42b0cb9f02d2845f56e468453 (patch)
tree6aeef35dead947bec8ff731c043b689268b113aa
parentc65a1b6de670353829fc841dc5c72ad7c072d42b (diff)
downloadlobase-8d709679d375b3c42b0cb9f02d2845f56e468453.tar.gz
mk: add WARNINGS
-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}