deptgt-end-fail.mk revision 1.5
1# $NetBSD: deptgt-end-fail.mk,v 1.5 2020/12/07 00:53:30 rillig Exp $ 2# 3# Tests for an errors in the main target, its dependencies, 4# the .END node and its dependencies. 5# 6# Before 2020-11-25, an error in the .END target did not print the "Stop.", 7# even though this was intended. The cause for this was a missing condition 8# in Compat_Run, in the code handling the .END node. 9 10test: .PHONY 11 12# The default stop-on-error mode is not as interesting to test since it 13# stops right after the first error. 14.MAKEFLAGS: -k 15 16.for all in ok ERR 17. for all-dep in ok ERR 18. for end in ok ERR 19. for end-dep in ok ERR 20. for target in ${all}-${all-dep}-${end}-${end-dep} 21test: ${target} 22${target}: .PHONY .SILENT 23 echo Test case all=${all} all-dep=${all-dep} end=${end} end-dep=${end-dep}. 24 ${MAKE} -r -f ${MAKEFILE} \ 25 all=${all} all-dep=${all-dep} \ 26 end=${end} end-dep=${end-dep} \ 27 all; \ 28 echo "exit status $$?" 29 echo 30 echo 31. endfor 32. endfor 33. endfor 34. endfor 35.endfor 36 37.if make(all) 38 39all all-dep end-dep: .PHONY 40 41CMD.ok= true 42CMD.ERR= false 43 44all: all-dep 45 : Making ${.TARGET} from ${.ALLSRC}. 46 @${CMD.${all}} 47 48all-dep: 49 : Making ${.TARGET} out of nothing. 50 @${CMD.${all-dep}} 51 52.END: end-dep 53 : Making ${.TARGET} from ${.ALLSRC}. 54 @${CMD.${end}} 55 56end-dep: 57 : Making ${.TARGET} out of nothing. 58 @${CMD.${end-dep}} 59 60.endif 61 62# Until 2020-12-07, several of the test cases printed "`all' not remade 63# because of errors.", followed by "exit status 0", which contradicted 64# each other. 65 66# XXX: As of 2020-12-06, '.END' is made if 'all' fails, but if a dependency 67# of 'all' fails, it is skipped. This is inconsistent. 68