| 1 |
# -*-perl-*- |
| 2 |
|
| 3 |
$description = "Test proper behavior of MAKEFLAGS"; |
| 4 |
|
| 5 |
$details = "DETAILS"; |
| 6 |
|
| 7 |
# Normal flags aren't prefixed with "-" |
| 8 |
run_make_test(q! |
| 9 |
all: ; @echo $(MAKEFLAGS) |
| 10 |
!, |
| 11 |
'-e -r -R', 'erR'); |
| 12 |
|
| 13 |
# Long arguments mean everything is prefixed with "-" |
| 14 |
run_make_test(q! |
| 15 |
all: ; @echo $(MAKEFLAGS) |
| 16 |
!, |
| 17 |
'--no-print-directory -e -r -R --trace', "Reading makefiles... |
| 18 |
Updating makefiles... |
| 19 |
Updating goal targets... |
| 20 |
File 'all' does not exist. |
| 21 |
Must remake target 'all'. |
| 22 |
#MAKEFILE#:2: target 'all' does not exist |
| 23 |
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
| 24 |
echo erR -xnormal --no-print-directory |
| 25 |
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
| 26 |
erR -xnormal --no-print-directory |
| 27 |
Successfully remade target file 'all'. |
| 28 |
"); |
| 29 |
|
| 30 |
|
| 31 |
# Recursive invocations of make should accumulate MAKEFLAGS values. |
| 32 |
# Savannah bug #2216 |
| 33 |
run_make_test(q! |
| 34 |
MSG = Fails |
| 35 |
all: |
| 36 |
@echo '$@: MAKEFLAGS=$(MAKEFLAGS)' |
| 37 |
@MSG=Works $(MAKE) -e -f #MAKEFILE# jump |
| 38 |
jump: |
| 39 |
@echo '$@ $(MSG): MAKEFLAGS=$(MAKEFLAGS)' |
| 40 |
@$(MAKE) -f #MAKEFILE# print |
| 41 |
print: |
| 42 |
@echo '$@ $(MSG): MAKEFLAGS=$(MAKEFLAGS)' |
| 43 |
.PHONY: all jump print |
| 44 |
!, |
| 45 |
'--no-print-directory', |
| 46 |
'all: MAKEFLAGS= --no-print-directory |
| 47 |
jump Works: MAKEFLAGS=e --no-print-directory |
| 48 |
print Works: MAKEFLAGS=e --no-print-directory'); |
| 49 |
|
| 50 |
1; |
| 51 |
|
| 52 |
### Local Variables: |
| 53 |
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) |
| 54 |
### End: |