3 # Updated 6.16.93 variable "MAKE" is default was environment override
4 # For make 3.63 and above
6 $description = "The following test creates a makefile to verify
7 test the foreach function.";
9 $details = "This is a test of the foreach function in gnu make.
10 This function starts with a space separated list of
11 names and a variable. Each name in the list is subsituted
12 into the variable and the given text evaluated. The general
13 form of the command is $(foreach var,$list,$text). Several
14 types of foreach loops are tested\n";
17 open(MAKEFILE,"> $makefile");
19 # The Contents of the MAKEFILE ...
21 # On WIN32 systems, the user's path is found in %Path% ($Path)
23 $pathvar = (($port_type eq 'Windows') ? "Path" : "PATH");
26 foo = bletch null \@ garf
29 auto_var = udef space CC null $pathvar MAKE foo CFLAGS WHITE \@ <
30 av = \$(foreach var, \$(auto_var), \$(origin \$(var)) )
31 override WHITE := BLACK
32 for_var = \$(addsuffix .c,foo \$(null) \$(foo) \$(space) \$(av) )
33 fe = \$(foreach var2, \$(for_var),\$(subst .c,.o, \$(var2) ) )
43 &run_make_with_options($makefile,
44 "-e WHITE=WHITE CFLAGS=",
47 # Create the answer to what should be produced by this Makefile
48 $answer = "undefined file default file environment default file command line override automatic automatic
49 foo.o bletch.o null.o @.o garf.o .o .o undefined.o file.o default.o file.o environment.o default.o file.o command.o line.o override.o automatic.o automatic.o\n";
51 &compare_output($answer,&get_logfile(1));