2 $description = "Test the .INCLUDE_DIRS special variable.";
9 $dir =~ s,.*/([^/]+)$,../$1,;
11 if (-d '/usr/include') {
12 # Test #1: The content of .INCLUDE_DIRS depends on the platform for which
13 # make was built. What we know for sure is that it shouldn't be
17 ifeq ($(.INCLUDE_DIRS),)
18 $(warning .INCLUDE_DIRS is empty)
27 # Test #2: Make sure -I paths end up in .INCLUDE_DIRS.
31 $(warning dir is empty)
34 ifeq ($(filter $(dir),$(.INCLUDE_DIRS)),)
35 $(warning .INCLUDE_DIRS does not contain $(dir): $(.INCLUDE_DIRS))
41 "-I$dir dir=$dir", '');
43 # Find the default .INCLUDE_DIRS
44 create_file('defaultdirs.mk', "\$(info \$(.INCLUDE_DIRS))\nall:;\@:\n");
45 my $cmd = subst_make_string("#MAKEPATH# -f defaultdirs.mk");
49 unlink('defaultdirs.mk');
52 ifneq (\$(.INCLUDE_DIRS),$dirs)
53 \$(warning Mismatched \$(.INCLUDE_DIRS) != $dirs)
59 # Verify that -I- disables content from .INCLUDE_DIRS
62 ifneq ($(.INCLUDE_DIRS),)
63 $(warning Mismatched $(.INCLUDE_DIRS) != )
69 # Prefix -I dirs to the front
70 mkdir('somedir', 0777);
72 my $xdirs = $dirs ? " $dirs" : '';
74 ifneq (\$(.INCLUDE_DIRS),somedir$xdirs)
75 \$(warning Mismatched '\$(.INCLUDE_DIRS)' != 'somedir$xdirs')
81 # Verify .INCLUDE_DIRS contains files after -I-
84 ifneq ($(.INCLUDE_DIRS),somedir)
85 $(warning Mismatched $(.INCLUDE_DIRS) != somedir)
89 '-I - -I somedir', '');
93 # This tells the test driver that the perl test script executed properly.