Ignore:
Timestamp:
Mar 14, 2018, 10:28:10 PM (7 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

Location:
trunk/src/kmk
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

  • trunk/src/kmk/tests/scripts/options/dash-B

    r2591 r3140  
    2323              '', 'cp bar.x foo');
    2424
    25 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
     25run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'.");
    2626run_make_test(undef, '-B', 'cp bar.x foo');
    2727
     
    2929
    3030utouch(1000, 'foo');
    31 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
     31run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'.");
    3232run_make_test(undef, '-B', 'cp bar.x foo');
    3333
     
    4646',
    4747              '-B', 'MAKE_RESTARTS=
    48 #MAKEFILE#:4: foo.x: No such file or directory
    4948MAKE_RESTARTS=1');
    5049
     
    6463',
    6564              '-B', 'MAKE_RESTARTS=
    66 #MAKEFILE#:4: foo.x: No such file or directory
    6765MAKE_RESTARTS=1
    6866blah.x
     
    8482
    85831;
     84
     85### Local Variables:
     86### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
     87### End:
  • trunk/src/kmk/tests/scripts/options/dash-C

    r969 r3140  
    3535
    3636# Create the answer to what should be produced by this Makefile
    37 $answer = "$make_name: Entering directory `$wpath'\n"
     37$answer = "$make_name: Entering directory '$wpath'\n"
    3838        . "$delete_command EXAMPLE\n"
    39         . "$make_name: Leaving directory `$wpath'\n";
     39        . "$make_name: Leaving directory '$wpath'\n";
    4040
    4141&compare_output($answer,&get_logfile(1));
     
    6363
    6464# Create the answer to what should be produced by this Makefile
    65 $answer = "$make_name: Entering directory `$wpath'\n"
     65$answer = "$make_name: Entering directory '$wpath'\n"
    6666        . "$delete_command EXAMPLEslash\n"
    67         . "$make_name: Leaving directory `$wpath'\n";
     67        . "$make_name: Leaving directory '$wpath'\n";
    6868
    6969&compare_output($answer,&get_logfile(1));
  • trunk/src/kmk/tests/scripts/options/dash-I

    r969 r3140  
    5252
    5353$answer = "$mkpath ANOTHER -f $makefile
    54 ${make_name}[1]: Entering directory `$pwd'
     54${make_name}[1]: Entering directory '$pwd'
    5555This is another included makefile
    56 ${make_name}[1]: Leaving directory `$pwd'\n";
     56${make_name}[1]: Leaving directory '$pwd'\n";
    5757
    5858&run_make_with_options($makefile,"-I $workdir recurse",&get_logfile);
  • trunk/src/kmk/tests/scripts/options/dash-W

    r969 r3140  
    1313# Run it again: nothing should happen
    1414
    15 run_make_test(undef, '', "#MAKE#: `a.x' is up to date.");
     15run_make_test(undef, '', "#MAKE#: 'a.x' is up to date.");
    1616
    1717# Now run it with -W b.x: should rebuild a.x
     
    2222
    2323utouch(1000, 'a.x');
    24 run_make_test(undef, '', "#MAKE#: `a.x' is up to date.");
     24run_make_test(undef, '', "#MAKE#: 'a.x' is up to date.");
    2525run_make_test(undef, '-W b.x', 'echo >> a.x');
    2626
     
    4343baz.x: bar.x ; @echo "touch $@"
    4444',
    45               '', '#MAKEFILE#:3: foo.x: No such file or directory
    46 echo >> bar.x
     45              '', 'echo >> bar.x
    4746touch foo.x
    4847restarts=1
     
    8786
    88871;
     88
     89### Local Variables:
     90### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
     91### End:
  • trunk/src/kmk/tests/scripts/options/dash-k

    r1964 r3140  
    4343               "$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
    4444               "$workdir${pathsep}buffer.h",
    45                "$workdir${pathsep}command.c");
     45               "$workdir${pathsep}command.c");
    4646
    4747&touch(@files_to_touch);
     
    5858# Create the answer to what should be produced by this Makefile
    5959$answer = "cc -c main.c
    60 $make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.
     60$make_name: *** No rule to make target 'kbd.c', needed by 'kbd.o'.
    6161cc -c commands.c
    6262cc -c display.c
    63 $make_name: Target `edit' not remade because of errors.\n";
     63$make_name: Target 'edit' not remade because of errors.\n";
    6464
    6565# COMPARE RESULTS
     
    9393
    9494$answer = "exit 1
    95 $make_name: *** [foo.o] Error 1
    96 $make_name: Target `all' not remade because of errors.\n";
     95$make_name: *** [$makefile2:9: foo.o] Error 1
     96$make_name: Target 'all' not remade because of errors.\n";
    9797
    9898&compare_output($answer, &get_logfile(1));
     
    107107              '-k',
    108108              "#MAKEFILE#:2: ifile: No such file or directory
    109 #MAKE#: *** No rule to make target `no-such-file', needed by `ifile'.
    110 #MAKE#: Failed to remake makefile `ifile'.
     109#MAKE#: *** No rule to make target 'no-such-file', needed by 'ifile'.
     110#MAKE#: Failed to remake makefile 'ifile'.
    111111hi\n",
    112112              512);
  • trunk/src/kmk/tests/scripts/options/dash-n

    r969 r3140  
    44$details = "Try various uses of -n and ensure they all give the correct results.\n";
    55
    6 open(MAKEFILE, "> $makefile");
     6touch('orig');
    77
    8 # The Contents of the MAKEFILE ...
    9 
    10 print MAKEFILE <<'EOMAKE';
    11 
     8run_make_test(q!
    129final: intermediate ; echo >> $@
    1310intermediate: orig ; echo >> $@
    14 
    15 EOMAKE
    16 
    17 close(MAKEFILE);
    18 
    19 &touch('orig');
    20 
    21 # TEST 0
    22 
    23 &run_make_with_options($makefile, "", &get_logfile);
    24 $answer = "echo >> intermediate\necho >> final\n";
    25 &compare_output($answer, &get_logfile(1));
     11!,
     12              '', "echo >> intermediate\necho >> final\n");
    2613
    2714# TEST 1
    2815
    29 &run_make_with_options($makefile, "-Worig -n", &get_logfile);
    30 $answer = "echo >> intermediate\necho >> final\n";
    31 &compare_output($answer, &get_logfile(1));
     16run_make_test(undef, '-Worig -n', "echo >> intermediate\necho >> final\n");
    3217
    33 unlink('orig', 'intermediate', 'final');
     18rmfiles(qw(orig intermediate final));
    3419
    3520# We consider the actual updated timestamp of targets with all
    36 # recursive commands, even with -n.
     21# recursive commands, even with -n.  Switching this to the new model
     22# is non-trivial because we use a trick below to change the log content
     23# before we compare it ...
    3724
    3825$makefile2 = &get_tmpfile;
     
    5744
    5845&run_make_with_options($makefile2, "", &get_logfile);
    59 $answer = "$make_name: `a' is up to date.\n";
     46$answer = "$make_name: 'a' is up to date.\n";
    6047&compare_output($answer, &get_logfile(1));
    6148
     
    6350
    6451&run_make_with_options($makefile2, "-n", &get_logfile);
    65 $answer = "$make_name: `a' is up to date.\n";
     52$answer = "$make_name: 'a' is up to date.\n";
    6653&compare_output($answer, &get_logfile(1));
    6754
    68 unlink('a', 'b', 'c');
     55# TEST 4
     56
     57unlink(qw(a b));
     58
     59&run_make_with_options($makefile2, "-t -n", &get_logfile);
     60
     61open(DASH_N_LOG, ">>" . &get_logfile(1));
     62print DASH_N_LOG "a exists but should not!\n" if -e 'a';
     63print DASH_N_LOG "b exists but should not!\n" if -e 'b';
     64close(DASH_N_LOG);
     65
     66&compare_output("touch b\ntouch a\n", &get_logfile(1));
     67
     68# CLEANUP
     69
     70unlink(qw(a b c));
     71
     72# Ensure -n continues to be included with recursive/re-execed make
     73# See Savannah bug #38051
     74
     75$topmake = &get_tmpfile;
     76$submake = &get_tmpfile;
     77
     78open(MAKEFILE, "> $topmake");
     79print MAKEFILE <<"EOF";
     80foo: ; \@\$(MAKE) -f "$submake" bar
     81EOF
     82close(MAKEFILE);
     83
     84
     85# The bar target should print what would happen, but not actually run
     86open(MAKEFILE, "> $submake");
     87print MAKEFILE <<'EOF';
     88inc: ; touch $@
     89-include inc
     90bar: ; @echo $(strip $(MAKEFLAGS))
     91EOF
     92close(MAKEFILE);
     93
     94&run_make_with_options($topmake, '-n --no-print-directory', &get_logfile);
     95$answer = "$make_command -f \"$submake\" bar\ntouch inc\necho n --no-print-directory\n";
     96&compare_output($answer, &get_logfile(1));
     97
     98unlink('inc');
    6999
    701001;
  • trunk/src/kmk/tests/scripts/options/dash-q

    r969 r3140  
    66# TEST 0
    77
    8 run_make_test('
     8run_make_test(qq!
    99one:
    1010two: ;
    1111three: ; :
    12 four: ; $(.XY)
    13 five: ; \
    14  $(.XY)
    15 six: ; \
    16  $(.XY)
    17         $(.XY)
    18 seven: ; \
    19  $(.XY)
    20         : foo
    21         $(.XY)
    22 ',
     12four: ; \$(.XY)
     13five: ; \\
     14 \$(.XY)
     15six: ; \\
     16 \$(.XY)
     17\t\$(.XY)
     18seven: ; \\
     19 \$(.XY)
     20\t: foo
     21\t\$(.XY)
     22!,
    2323              '-q one', '');
    2424
     
    5555              '-q', '', 256);
    5656
     57# TEST 7 : Savannah bug # 42249
     58# Make sure we exit with 1 even for prerequisite updates
     59run_make_test('
     60build-stamp: ; echo $@
     61build-arch: build-stamp
     62build-x: build-arch
     63build-y: build-x
     64',
     65              '-q build-y', '', 256);
     66
     67# TEST 8
     68# Make sure we exit with 2 on error even with -q
     69run_make_test('
     70build-stamp: ; echo $@
     71build-arch: build-stamp-2
     72build-x: build-arch
     73build-y: build-x
     74',
     75              '-q build-y', "#MAKE#: *** No rule to make target 'build-stamp-2', needed by 'build-arch'.  Stop.\n", 512);
     76
     77# TEST 9 : Savannah bug # 47151
     78# Make sure we exit with 1 when invoking a recursive make
     79run_make_test('
     80foo: bar ; echo foo
     81bar: ; @$(MAKE) -f #MAKEFILE# baz
     82baz: ; echo baz
     83',
     84              '-q foo', '', 256);
     85
    57861;
  • trunk/src/kmk/tests/scripts/options/eval

    r2591 r3140  
    1717              "eval\neval\nall\nrecurse");
    1818
     19# Make sure that --eval is handled correctly during restarting
     20run_make_test(q!
     21all: ; @echo $@
     22-include gen.mk
     23gen.mk: ; @echo > $@
     24!,
     25              '--eval=\$\(info\ eval\)', "eval\neval\nall");
     26
     27unlink('gen.mk');
     28
    19291;
  • trunk/src/kmk/tests/scripts/options/symlinks

    r2591 r3140  
    2727  # With -L, it should update targ
    2828  run_make_test('targ: sym ; @echo make $@ from $<', '',
    29                 "#MAKE#: `targ' is up to date.");
     29                "#MAKE#: 'targ' is up to date.");
    3030  run_make_test(undef, '-L', "make targ from sym");
    3131
     
    3737  # Now update targ; in all cases targ should be up to date.
    3838  &touch('targ');
    39   run_make_test(undef, '', "#MAKE#: `targ' is up to date.");
    40   run_make_test(undef, '-L', "#MAKE#: `targ' is up to date.");
     39  run_make_test(undef, '', "#MAKE#: 'targ' is up to date.");
     40  run_make_test(undef, '-L', "#MAKE#: 'targ' is up to date.");
    4141
    4242  # Add in a new link between sym and dep.  Be sure it's newer than targ.
     
    4747  # Without -L, nothing should happen
    4848  # With -L, it should update targ
    49   run_make_test(undef, '', "#MAKE#: `targ' is up to date.");
     49  run_make_test(undef, '', "#MAKE#: 'targ' is up to date.");
    5050  run_make_test(undef, '-L', "make targ from sym");
    5151
     
    5757  symlink("../$dirname/dep", 'sym');
    5858  run_make_test('targ: sym ; @echo make $@ from $<', '',
    59                 "#MAKE#: *** No rule to make target `sym', needed by `targ'.  Stop.", 512);
     59                "#MAKE#: *** No rule to make target 'sym', needed by 'targ'.  Stop.", 512);
    6060
    6161  run_make_test('targ: sym ; @echo make $@ from $<', '-L',
  • trunk/src/kmk/tests/scripts/options/warn-undefined-variables

    r969 r3140  
    1919# With --warn-undefined-variables, it should warn me
    2020run_make_test(undef, '--warn-undefined-variables',
    21               "#MAKEFILE#:7: warning: undefined variable `UNDEFINED'
    22 #MAKEFILE#:9: warning: undefined variable `UNDEFINED'
     21              "#MAKEFILE#:7: warning: undefined variable 'UNDEFINED'
     22#MAKEFILE#:9: warning: undefined variable 'UNDEFINED'
    2323ref");
    2424
Note: See TracChangeset for help on using the changeset viewer.