3 $description = 'Test the $(file ...) function.';
12 $(file >file.out,$(A))
13 $(foreach L,$(B),$(file >> file.out,$L))
14 x:;@echo hi; cat file.out
16 '', "hi\na\nb\nc\nd");
20 # Test >> to a non-existent file
26 $(file >> file.out,$(A))
33 # Test > to a read-only file
35 chmod(0444, 'file.out');
37 # Find the error that will be printed
38 # This seems complicated, but we need the message from the C locale
41 $loc = POSIX::setlocale(POSIX::LC_MESSAGES);
42 POSIX::setlocale(POSIX::LC_MESSAGES, 'C');
45 open(my $F, '>', 'file.out') and die "Opened read-only file!\n";
47 $loc and POSIX::setlocale(POSIX::LC_MESSAGES, $loc);
54 $(file > file.out,$(A))
57 '', "#MAKEFILE#:6: *** open: file.out: $e. Stop.",
62 # Use variables for operator and filename
70 $(file $(OP) $(FN),$(A))
77 # Don't add newlines if one already exists
84 $(file >file.out,$(A))