]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Fix support for building a PROG_CXX, and PROG, directly.
authorbdrewery <bdrewery@FreeBSD.org>
Wed, 14 Oct 2015 05:50:16 +0000 (05:50 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Wed, 14 Oct 2015 05:50:16 +0000 (05:50 +0000)
For example in lib/atf/libatf-c++/tests/detail it is now possible to
run 'make application_test'.  This was intended to worked for PROGS,
but lacked support for PROGS_CXX.

Also fix redefining the main PROG target to recurse.  This isn't needed
since the main process is setting PROG/PROG_CXX to handle it directly
via bsd.prog.mk.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

share/mk/bsd.progs.mk

index 3efa691f45a89eeda7694393e18426449c6d8a98..2da30c70ebb59daaa00b29cc1e054a24d3320989 100644 (file)
@@ -31,6 +31,9 @@ UPDATE_DEPENDFILE_PROG = ${PROGS:[1]}
 # They may have asked us to build just one
 .for t in ${PROGS}
 .if make($t)
+.if ${PROGS_CXX:M${t}}
+PROG_CXX ?= $t
+.endif
 PROG ?= $t
 .endif
 .endfor
@@ -61,7 +64,7 @@ UPDATE_DEPENDFILE ?= yes
 UPDATE_DEPENDFILE ?= NO
 
 # prog.mk will do the rest
-.else
+.else # !defined(PROG)
 all: ${PROGS}
 
 # We cannot capture dependencies for meta mode here
@@ -80,7 +83,7 @@ $v =
 # handle being called [bsd.]progs.mk
 .include <bsd.prog.mk>
 
-.if !empty(PROGS) && !defined(_RECURSING_PROGS)
+.if !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG)
 # tell progs.mk we might want to install things
 PROGS_TARGETS+= checkdpadd clean cleandepend cleandir depend install
 
@@ -130,4 +133,4 @@ $p.$t: .PHONY .MAKE
 .for t in ${PROGS_TARGETS:O:u}
 $t: ${PROGS:%=%.$t}
 .endfor
-.endif
+.endif # !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG)