/usr/src/usr.bin/bmake/Makefile.inc ... .if exists(${.CURDIR}/tests) PROG= make .if ${PROGNAME:U} != "bmake" LINKS= ${BINDIR}/make ${BINDIR}/bmake MLINKS= ${MAN} b${MAN} .endif .endif ... This looks strange, FreeBSD relies that 'make' always exist. As far I understand from git history, probably it should be: .if exists(${.CURDIR}/tests) PROG= make .endif .if ${PROGNAME:U} != "bmake" LINKS= ${BINDIR}/make ${BINDIR}/bmake MLINKS= ${MAN} b${MAN} .endif
Created attachment 245442 [details] patch Not sure that it correct patch, I do not test it with TESTS, only normal build+install without tests dir.
Sorry I don't understand the problem here. The guard `exists(${.CURDIR}/tests)` is to avoid settings that are inappropriate when in the tests directory. usr.bin/bmake/tests should always exist whether you want to build TESTS or not. If that directory does not, that is the problem to fix.
(In reply to Simon J. Gerraty from comment #2) It is my local problem, it is out of usual FreeBSD sources use cases. Software certification requires to provide source files that was really used during build: compiled or copied to distribution. We use ktrace + custom parser to find out files that was open+read/fstat/mmap/copy_file, next we copy files from this list to new dir and try to build FreeBSD to ensure that nothing miss. At this time there is only small number of issues that breaks this, another one: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274273 All this looks simple to fix, patch is simple workaround that we use.
Simply changing the condition to `.if ${.CURDIR:M*make} != ""` would preserve the original intent and also meet your goal