Ignore:
Timestamp:
Jun 17, 2012, 10:45:31 PM (13 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

Location:
trunk/src/kmk
Files:
9 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

    • Property svn:ignore
      •  

        old new  
        1313stamp-*
        1414makebook*
         15
        1516.*gdbinit
         17.gdb_history
         18
        1619*.dep
        1720*.dvi
         
        3134*.pg
        3235*.pgs
         36
        3337README
        3438README.DOS
        3539README.W32
         40README.OS2
        3641aclocal.m4
        3742autom4te.cache
         
        5257config.h.W32
        5358config.h-vms
         59
        5460loadavg
        5561loadavg.c
        5662make
         63
        5764.deps
        5865.dep_segment
         66ID
         67TAGS
         68
        5969_*
        6070sun4
         
        7282sol2
        7383i486-linux
         84
        7485customs
         86
        7587install-sh
        7688mkinstalldirs
         89
         90.directive.asc
  • trunk/src/kmk/tests

    • Property svn:ignore
      --- 
      +++ 
      
  • trunk/src/kmk/tests/scripts/variables/DEFAULT_GOAL

    • Property svn:keywords deleted
    r969 r2591  
    7474'foo');
    7575
     76# TEST #5: .DEFAULT_GOAL containing just whitespace (Savannah bug #25697)
     77
     78run_make_test('
     79N =
     80.DEFAULT_GOAL = $N  $N  # Just whitespace
     81
     82foo: ; @echo "boo"
     83',
     84              '', "#MAKE#: *** No targets.  Stop.\n", 512);
    7685
    7786# This tells the test driver that the perl test script executed properly.
  • trunk/src/kmk/tests/scripts/variables/MAKE

    r969 r2591  
    11#                                                                    -*-perl-*-
    22
    3 $description = "The following test creates a makefile to test MAKE \n"
    4               ."(very generic)";
     3$description = "Test proper behavior of the MAKE variable";
    54
    65$details = "DETAILS";
    76
    8 open(MAKEFILE,"> $makefile");
     7run_make_test(q!
     8TMP  := $(MAKE)
     9MAKE := $(subst X=$(X),,$(MAKE))
     10all:
     11        @echo $(TMP)
     12        $(MAKE) -f #MAKEFILE# foo
    913
    10 # The Contents of the MAKEFILE ...
     14foo:
     15        @echo $(MAKE)
     16!,
     17              '',
     18              "#MAKEPATH#\n#MAKEPATH# -f #MAKEFILE# foo\n"
     19              . "#MAKE#[1]: Entering directory `#PWD#'\n"
     20              . "#MAKEPATH#\n#MAKE#[1]: Leaving directory `#PWD#'\n");
    1121
    12 print MAKEFILE "TMP  := \$(MAKE)\n";
    13 print MAKEFILE "MAKE := \$(subst X=\$(X),,\$(MAKE))\n\n";
    14 print MAKEFILE "all:\n";
    15 print MAKEFILE "\t\@echo \$(TMP)\n";
    16 print MAKEFILE "\t\$(MAKE) -f $makefile foo\n\n";
    17 print MAKEFILE "foo:\n";
    18 print MAKEFILE "\t\@echo \$(MAKE)\n";
    19 
    20 # END of Contents of MAKEFILE
    21 
    22 close(MAKEFILE);
    23 
    24 # Create the answer to what should be produced by this Makefile
    25 $answer = "$mkpath\n$mkpath -f $makefile foo\n"
    26         . "${make_name}[1]: Entering directory `$pwd'\n"
    27         . "$mkpath\n${make_name}[1]: Leaving directory `$pwd'\n";
    28 
    29 &run_make_with_options($makefile,"",&get_logfile,0);
    30 
    31 &rmfiles("foo");
    32 # COMPARE RESULTS
    33 &compare_output($answer,&get_logfile(1));
     22rmfiles("foo");
    3423
    35241;
  • trunk/src/kmk/tests/scripts/variables/MAKEFILES

    r969 r2591  
    3232&compare_output($answer,&get_logfile(1));
    3333
     34# TEST 2: Verify that included makefiles don't set the default goal.
     35# See Savannah bug #13401.
     36
     37create_file('xx-inc.mk', '
     38include_goal: ; @echo $@
     39include xx-ind.mk
     40');
     41
     42create_file('xx-ind.mk', '
     43indirect_goal: ; @echo $@
     44');
     45
     46run_make_test(q!
     47top: ; @echo $@
     48!,
     49              'MAKEFILES=xx-inc.mk', "top\n");
     50
     51unlink(qw(xx-inc.mk xx-ind.mk));
     52
    34531;
  • trunk/src/kmk/tests/scripts/variables/MFILE_LIST

    • Property svn:keywords deleted
  • trunk/src/kmk/tests/scripts/variables/SHELL

    • Property svn:keywords deleted
    r1969 r2591  
    5050$extraENV{SHELL} = $mshell;
    5151
    52 # bird: This was wrong, see Savannah bug #24655. Fixed in kBuild.
    53 run_make_test("all: export SHELL := /./$mshell\n".'
    54 all:;@echo "$(SHELL) $$SHELL"
    55 ', '', "/./$mshell /./$mshell");
     52# bird: This was wrong at some point, see Savannah bug #24655. Was first fixed in kBuild.
     53run_make_test("
     54SHELL := /././$mshell
     55one: two
     56two: export SHELL := /./$mshell\n".'
     57one two:;@echo "$@: $(SHELL) $$SHELL"
     58', '', "two: /./$mshell /./$mshell\none: /././$mshell $mshell\n");
     59
     60# Test .SHELLFLAGS
     61
     62# We don't know the output here: on Solaris for example, every line printed
     63# by the shell in -x mode has a trailing space (!!)
     64my $script = 'true; true';
     65my $flags = '-xc';
     66my $out = `/bin/sh $flags '$script' 2>&1`;
     67
     68run_make_test(qq!
     69.SHELLFLAGS = $flags
     70all: ; \@$script
     71!,
     72              '', $out);
     73
     74# We can't just use "false" because on different systems it provides a
     75# different exit code--once again Solaris: false exits with 255 not 1
     76$script = 'true; false; true';
     77$flags = '-xec';
     78$out = `/bin/sh $flags '$script' 2>&1`;
     79my $err = $? >> 8;
     80
     81run_make_test(qq!
     82.SHELLFLAGS = $flags
     83all: ; \@$script
     84!,
     85              '', "$out#MAKE#: *** [all] Error $err\n", 512);
    5686
    57871;
  • trunk/src/kmk/tests/scripts/variables/automatic

    r1984 r2591  
    108108unlink('foo');
    109109
     110# TEST #4: ensure prereq ordering is correct when the commmand target has none
     111# See Savannah bug #21198
     112
     113run_make_test('
     114all : A B
     115all : ; @echo $@ -- $^ -- $<
     116all : C D
     117all : E F
     118A B C D E F G H : ; @:
     119',
     120              '', "all -- A B C D E F -- A\n");
     121
    1101221;
  • trunk/src/kmk/tests/scripts/variables/flavors

    r1970 r2591  
    55$details = "";
    66
    7 open(MAKEFILE, "> $makefile");
     7# TEST 0: Recursive
    88
    9 # The Contents of the MAKEFILE ...
    10 
    11 print MAKEFILE <<'EOF';
     9run_make_test('
     10ugh = Goodbye
    1211foo = $(bar)
    1312bar = ${ugh}
    1413ugh = Hello
     14all: ; @echo $(foo)
     15',
     16              '', "Hello\n");
    1517
    16 all: multi ; @echo $(foo)
    17 
    18 multi: ; $(multi)
    19 
    20 x := foo
    21 y := $(x) bar
    22 x := later
    23 
    24 nullstring :=
    25 space := $(nullstring) $(nullstring)
    26 
    27 next: ; @echo $x$(space)$y
    28 
    29 define multi
    30 @echo hi
    31 echo there
    32 endef
    33 
    34 ifdef BOGUS
    35 define
    36 @echo error
    37 endef
    38 endif
    39 
    40 define outer
    41  define inner
    42   A = B
    43  endef
    44 endef
    45 
    46 $(eval $(outer))
    47 
    48 outer: ; @echo $(inner)
    49 
    50 EOF
    51 
    52 # END of Contents of MAKEFILE
    53 
    54 close(MAKEFILE);
    55 
    56 # TEST #1
    57 # -------
    58 
    59 &run_make_with_options($makefile, "", &get_logfile);
    60 $answer = "hi\necho there\nthere\nHello\n";
    61 &compare_output($answer, &get_logfile(1));
    62 
    63 # TEST #2
    64 # -------
    65 
    66 &run_make_with_options($makefile, "next", &get_logfile);
    67 $answer = "later foo bar\n";
    68 &compare_output($answer, &get_logfile(1));
    69 
    70 # TEST #3
    71 # -------
    72 
    73 &run_make_with_options($makefile, "BOGUS=true", &get_logfile, 512);
    74 $answer = "$makefile:24: *** empty variable name.  Stop.\n";
    75 &compare_output($answer, &get_logfile(1));
    76 
    77 # TEST #4
    78 # -------
    79 
    80 &run_make_with_options($makefile, "outer", &get_logfile);
    81 $answer = "A = B\n";
    82 &compare_output($answer, &get_logfile(1));
    83 
    84 # Clean up from "old style" testing.  If all the above tests are converted to
    85 # run_make_test() syntax than this line can be removed.
    86 $makefile = undef;
    87 
    88 # -------------------------
    89 # Make sure that prefix characters apply properly to define/endef values.
    90 #
    91 # There's a bit of oddness here if you try to use a variable to hold the
    92 # prefix character for a define.  Even though something like this:
    93 #
    94 #       define foo
    95 #       echo bar
    96 #       endef
    97 #
    98 #       all: ; $(V)$(foo)
    99 #
    100 # (where V=@) can be seen by the user to be obviously different than this:
    101 #
    102 #       define foo
    103 #       $(V)echo bar
    104 #       endef
    105 #
    106 #       all: ; $(foo)
    107 #
    108 # and the user thinks it should behave the same as when the "@" is literal
    109 # instead of in a variable, that can't happen because by the time make
    110 # expands the variables for the command line and sees it begins with a "@" it
    111 # can't know anymore whether the prefix character came before the variable
    112 # reference or was included in the first line of the variable reference.
    113 
    114 # TEST #5
    115 # -------
     18# TEST 1: Simple
    11619
    11720run_make_test('
    118 define FOO
    119 $(V1)echo hello
    120 $(V2)echo world
    121 endef
    122 all: ; @$(FOO)
    123 ', '', 'hello
    124 world');
     21bar = Goodbye
     22foo := $(bar)
     23bar = ${ugh}
     24ugh = Hello
     25all: ; @echo $(foo)
     26',
     27              '', "Goodbye\n");
    12528
    126 # TEST #6
    127 # -------
    128 
    129 run_make_test(undef, 'V1=@ V2=@', 'hello
    130 world');
    131 
    132 # TEST #7
    133 # -------
     29# TEST 2: Append to recursive
    13430
    13531run_make_test('
    136 define FOO
    137 $(V1)echo hello
    138 $(V2)echo world
    139 endef
    140 all: ; $(FOO)
    141 ', 'V1=@', 'hello
    142 echo world
    143 world');
     32foo = Hello
     33ugh = Goodbye
     34foo += $(bar)
     35bar = ${ugh}
     36ugh = Hello
     37all: ; @echo $(foo)
     38',
     39              '', "Hello Hello\n");
    14440
    145 # TEST #8
    146 # -------
    147 
    148 run_make_test(undef, 'V2=@', 'echo hello
    149 hello
    150 world');
    151 
    152 # TEST #9
    153 # -------
    154 
    155 run_make_test(undef, 'V1=@ V2=@', 'hello
    156 world');
    157 
    158 # TEST #10
    159 # -------
    160 # Test the basics; a "@" internally to the variable applies to only one line.
    161 # A "@" before the variable applies to the entire variable.
     41# TEST 3: Append to simple
    16242
    16343run_make_test('
    164 define FOO
    165 @echo hello
    166 echo world
    167 endef
    168 define BAR
    169 echo hello
    170 echo world
    171 endef
     44foo := Hello
     45ugh = Goodbye
     46bar = ${ugh}
     47foo += $(bar)
     48ugh = Hello
     49all: ; @echo $(foo)
     50',
     51              '', "Hello Goodbye\n");
    17252
    173 all: foo bar
    174 foo: ; $(FOO)
    175 bar: ; @$(BAR)
    176 ', '-j1', 'hello
    177 echo world
    178 world
    179 hello
    180 world
    181 ');
     53# TEST 4: Conditional pre-set
     54
     55run_make_test('
     56foo = Hello
     57ugh = Goodbye
     58bar = ${ugh}
     59foo ?= $(bar)
     60ugh = Hello
     61all: ; @echo $(foo)
     62',
     63              '', "Hello\n");
     64
     65# TEST 5: Conditional unset
     66
     67run_make_test('
     68ugh = Goodbye
     69bar = ${ugh}
     70foo ?= $(bar)
     71ugh = Hello
     72all: ; @echo $(foo)
     73',
     74              '', "Hello\n");
    18275
    183761;
Note: See TracChangeset for help on using the changeset viewer.