aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/mk/bsd.lib.mk2
-rw-r--r--share/mk/bsd.prog.mk19
2 files changed, 19 insertions, 2 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 4ad78316247b..58bce19512b8 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -21,7 +21,9 @@ SHLIB_LINK?= ${SHLIB_NAME:R}
SONAME?= ${SHLIB_NAME}
.endif
+.if defined(CRUNCH_CFLAGS)
CFLAGS+= ${CRUNCH_CFLAGS}
+.endif
.if defined(DEBUG_FLAGS)
CFLAGS+= ${DEBUG_FLAGS}
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 43bb9e8e2c47..8ae4063a3b65 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -5,8 +5,17 @@
.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm
-CFLAGS+=${COPTS} ${DEBUG_FLAGS}
+.if defined(COPTS)
+CFLAGS+=${COPTS}
+.endif
+
+.if defined(DEBUG_FLAGS)
+CFLAGS+=${DEBUG_FLAGS}
+.endif
+
+.if defined(CRUNCH_CFLAGS)
CFLAGS+=${CRUNCH_CFLAGS}
+.endif
.if !defined(DEBUG_FLAGS)
STRIP?= -s
@@ -79,7 +88,13 @@ all: objwarn ${PROG} ${SCRIPTS}
all: _manpages
.endif
-CLEANFILES+= ${PROG} ${OBJS}
+.if defined(PROG)
+CLEANFILES+= ${PROG}
+.endif
+
+.if defined(OBJS)
+CLEANFILES+= ${OBJS}
+.endif
.if defined(PROG)
_EXTRADEPEND: