2022-02-05 20:03:50 +00:00
|
|
|
# $NetBSD: varname-dot-make-jobs.mk,v 1.3 2022/01/26 22:47:03 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2022-02-05 20:03:50 +00:00
|
|
|
# Tests for the special .MAKE.JOBS variable, which is defined in jobs mode
|
|
|
|
# only. There it contains the number of jobs that may run in parallel.
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
.MAIN: all
|
|
|
|
|
|
|
|
echo: .PHONY
|
|
|
|
@echo ${.MAKE.JOBS:Uundefined}
|
2020-09-05 16:11:04 +00:00
|
|
|
|
|
|
|
all:
|
2022-02-05 20:03:50 +00:00
|
|
|
@${MAKE} -r -f ${MAKEFILE} echo
|
|
|
|
@${MAKE} -r -f ${MAKEFILE} echo -j1
|
|
|
|
@${MAKE} -r -f ${MAKEFILE} echo -j5
|
|
|
|
@${MAKE} -r -f ${MAKEFILE} echo -j20
|
|
|
|
@${MAKE} -r -f ${MAKEFILE} echo -j00000000000000000000000000000001
|
|
|
|
|
|
|
|
# expect: undefined
|
|
|
|
# expect: 1
|
|
|
|
# expect: 5
|
|
|
|
# expect: 20
|
|
|
|
# The value of .MAKE.JOBS is the exact text given in the command line, not the
|
|
|
|
# canonical number. This doesn't have practical consequences though.
|
|
|
|
# expect: 00000000000000000000000000000001
|