Improve bsd.progs.mk compatibility with bsd.prog.mk
1. Do not install FILES/SCRIPTS multiple times if PROGS is specified; this is already handled via bsd.prog.mk when it's called recursively (PR: 191055, 191955). 2. Some variables, like BINDIR and PROGNAME, default to a value if unset whereas others get appended to, like CFLAGS. Add support for the former case (PR: 191056) 3. Make "checkdpadd" and "clean" available targets for recursive execution. Reviewed by: marcel, sjg Phabric: D822 PR: 191055, 191056, 191955 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
d60351df8f
commit
68e69f7343
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272055
@ -42,10 +42,15 @@ PROG ?= $t
|
|||||||
|
|
||||||
.if defined(PROG)
|
.if defined(PROG)
|
||||||
# just one of many
|
# just one of many
|
||||||
PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS
|
PROG_OVERRIDE_VARS += BINDIR MAN SRCS
|
||||||
|
PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD ${PROG_OVERRIDE_VARS}
|
||||||
.for v in ${PROG_VARS:O:u}
|
.for v in ${PROG_VARS:O:u}
|
||||||
.if defined(${v}.${PROG}) || defined(${v}_${PROG})
|
.if empty(${PROG_OVERRIDE_VARS:M$v})
|
||||||
$v += ${${v}_${PROG}:U${${v}.${PROG}}}
|
.if defined(${v}.${PROG})
|
||||||
|
$v += ${${v}.${PROG}}
|
||||||
|
.elif defined(${v}_${PROG})
|
||||||
|
$v += ${${v}_${PROG}}
|
||||||
|
.endif
|
||||||
.else
|
.else
|
||||||
$v ?=
|
$v ?=
|
||||||
.endif
|
.endif
|
||||||
@ -61,7 +66,7 @@ UPDATE_DEPENDFILE ?= NO
|
|||||||
DEPENDFILE?= .depend.${PROG}
|
DEPENDFILE?= .depend.${PROG}
|
||||||
# prog.mk will do the rest
|
# prog.mk will do the rest
|
||||||
.else
|
.else
|
||||||
all: ${PROGS}
|
all: ${FILES} ${PROGS} ${SCRIPTS}
|
||||||
|
|
||||||
# We cannot capture dependencies for meta mode here
|
# We cannot capture dependencies for meta mode here
|
||||||
UPDATE_DEPENDFILE = NO
|
UPDATE_DEPENDFILE = NO
|
||||||
@ -75,7 +80,7 @@ UPDATE_DEPENDFILE = NO
|
|||||||
|
|
||||||
.ifndef _RECURSING_PROGS
|
.ifndef _RECURSING_PROGS
|
||||||
# tell progs.mk we might want to install things
|
# tell progs.mk we might want to install things
|
||||||
PROGS_TARGETS+= cleandepend cleandir cleanobj depend install
|
PROGS_TARGETS+= checkdpadd clean cleandepend cleandir cleanobj depend install
|
||||||
|
|
||||||
.for p in ${PROGS}
|
.for p in ${PROGS}
|
||||||
.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
|
.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
|
||||||
@ -98,18 +103,15 @@ $p.$t: .PHONY .MAKE
|
|||||||
$t: ${PROGS:%=%.$t}
|
$t: ${PROGS:%=%.$t}
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
SCRIPTS_TARGETS+= cleandepend cleandir cleanobj depend install
|
.if empty(PROGS) && !empty(SCRIPTS)
|
||||||
|
|
||||||
.for p in ${SCRIPTS}
|
.for t in ${PROGS_TARGETS:O:u}
|
||||||
.for t in ${SCRIPTS_TARGETS:O:u}
|
scripts.$t: .PHONY .MAKE
|
||||||
$p.$t: .PHONY .MAKE
|
(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} SUBDIR= _RECURSING_PROGS= \
|
||||||
(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
|
$t)
|
||||||
SUBDIR= SCRIPT=$p ${x.$p} ${@:E})
|
$t: scripts.$t
|
||||||
.endfor
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
.for t in ${SCRIPTS_TARGETS:O:u}
|
|
||||||
$t: ${SCRIPTS:%=%.$t}
|
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.endif
|
||||||
|
Loading…
Reference in New Issue
Block a user