Pass more variables to bsd.prog.mk and

only append to already defined variables.

Submitted by:	Garrett Cooper
This commit is contained in:
sjg 2013-04-22 18:11:29 +00:00
parent eaf646d927
commit dfd2a8c123

View File

@ -36,9 +36,11 @@ PROG ?= $t
.if defined(PROG)
# just one of many
PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS
PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS
.for v in ${PROG_VARS:O:u}
.if defined(${v}.${PROG})
$v += ${${v}_${PROG}:U${${v}.${PROG}}}
.endif
.endfor
# for meta mode, there can be only one!
@ -64,7 +66,8 @@ UPDATE_DEPENDFILE = NO
.include <${.PARSEFILE:S,progs,prog,}>
.ifndef PROG
PROGS_TARGETS += clean
# tell progs.mk we might want to install things
PROGS_TARGETS+= cleandepend cleandir cleanobj depend install
.for p in ${PROGS}
.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)