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/variables/DEFAULT_GOAL

    r2591 r3140  
    4343',
    4444'',
    45 '#MAKE#: *** No rule to make target `foo\'.  Stop.',
     45"#MAKE#: *** No rule to make target 'foo'.  Stop.",
    4646512);
    4747
  • trunk/src/kmk/tests/scripts/variables/LIBPATTERNS

    r2591 r3140  
    2121all: -lfoo ; @echo "build $@ from $<"
    2222',
    23               '', "#MAKE#: .LIBPATTERNS element `mtest_foo.a' is not a pattern
     23              '', "#MAKE#: .LIBPATTERNS element 'mtest_foo.a' is not a pattern
    2424build all from mtest_foo.a\n");
    2525
  • trunk/src/kmk/tests/scripts/variables/MAKE

    r2591 r3140  
    1717              '',
    1818              "#MAKEPATH#\n#MAKEPATH# -f #MAKEFILE# foo\n"
    19               . "#MAKE#[1]: Entering directory `#PWD#'\n"
    20               . "#MAKEPATH#\n#MAKE#[1]: Leaving directory `#PWD#'\n");
     19              . "#MAKE#[1]: Entering directory '#PWD#'\n"
     20              . "#MAKEPATH#\n#MAKE#[1]: Leaving directory '#PWD#'\n");
    2121
    2222rmfiles("foo");
  • trunk/src/kmk/tests/scripts/variables/MAKEFLAGS

    r2591 r3140  
    1 #                                                                    -*-perl-*-
     1#                                                                    -*-perl-*-
    22
    33$description = "Test proper behavior of MAKEFLAGS";
     
    99all: ; @echo $(MAKEFLAGS)
    1010!,
    11               '-e -r -R', 'Rre');
     11              '-e -r -R', 'erR');
    1212
    1313# Long arguments mean everything is prefixed with "-"
     
    1515all: ; @echo $(MAKEFLAGS)
    1616!,
    17               '--no-print-directory -e -r -R', '--no-print-directory -Rre');
     17              '--no-print-directory -e -r -R --trace', "#MAKEFILE#:2: target 'all' does not exist
     18echo erR --trace --no-print-directory
     19erR --trace --no-print-directory");
    1820
    1921
    20 if ($all_tests) {
    21     # Recursive invocations of make should accumulate MAKEFLAGS values.
    22     # Savannah bug #2216
    23     run_make_test(q!
     22# Recursive invocations of make should accumulate MAKEFLAGS values.
     23# Savannah bug #2216
     24run_make_test(q!
    2425MSG = Fails
    2526all:
     
    2728        @MSG=Works $(MAKE) -e -f #MAKEFILE# jump
    2829jump:
    29         @echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
     30        @echo '$@ $(MSG): MAKEFLAGS=$(MAKEFLAGS)'
    3031        @$(MAKE) -f #MAKEFILE# print
    3132print:
    32         @echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
    33         @echo $(MSG)
     33        @echo '$@ $(MSG): MAKEFLAGS=$(MAKEFLAGS)'
    3434.PHONY: all jump print
    3535!,
    3636                  '--no-print-directory',
    3737                  'all: MAKEFLAGS= --no-print-directory
    38 jump: MAKEFLAGS= --no-print-directory -e
    39 print: MAKEFLAGS= --no-print-directory -e
    40 Works');
    41 }
     38jump Works: MAKEFLAGS=e --no-print-directory
     39print Works: MAKEFLAGS=e --no-print-directory');
    4240
    43411;
     42
     43### Local Variables:
     44### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
     45### End:
  • trunk/src/kmk/tests/scripts/variables/MAKE_RESTARTS

    r969 r3140  
    1212',
    1313              '', 'MAKE_RESTARTS=
    14 #MAKEFILE#:4: foo.x: No such file or directory
    1514MAKE_RESTARTS=1');
    1615
     
    2726',
    2827              '', 'MAKE_RESTARTS=
    29 #MAKEFILE#:4: foo.x: No such file or directory
    3028MAKE_RESTARTS=1
    31 foo.x:1: bar.x: No such file or directory
    3229MAKE_RESTARTS=2');
    3330
     
    4845',
    4946              '', "MAKE_RESTARTS=
    50 #MAKEFILE#:8: foo.x: No such file or directory
    5147MAKE_RESTARTS=1
    52 foo.x:1: bar.x: No such file or directory
    5348MAKE_RESTARTS=2
    5449recurse MAKE_RESTARTS=
     50#MAKE#[1]: Entering directory '#PWD#'
    5551MAKE_RESTARTS=
    56 #MAKE#[1]: Entering directory `#PWD#'
    5752all MAKE_RESTARTS=
    58 #MAKE#[1]: Leaving directory `#PWD#'");
     53#MAKE#[1]: Leaving directory '#PWD#'");
    5954
    6055rmfiles('foo.x', 'bar.x');
    6156
    62571;
     58
     59### Local Variables:
     60### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
     61### End:
  • trunk/src/kmk/tests/scripts/variables/SHELL

    r2591 r3140  
    7272              '', $out);
    7373
     74# Do it again but add spaces to SHELLFLAGS
     75
     76# Some shells (*shakes fist at Solaris*) cannot handle multiple flags in
     77# separate arguments.
     78my $t = `/bin/sh -e -c true 2>/dev/null`;
     79my $multi_ok = $? == 0;
     80
     81if ($multi_ok) {
     82    $flags = '-x -c';
     83    run_make_test(qq!
     84.SHELLFLAGS = $flags
     85all: ; \@$script
     86!,
     87              '', $out);
     88}
     89
    7490# We can't just use "false" because on different systems it provides a
    7591# different exit code--once again Solaris: false exits with 255 not 1
     
    8399all: ; \@$script
    84100!,
    85               '', "$out#MAKE#: *** [all] Error $err\n", 512);
     101              '', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
    86102
    871031;
  • trunk/src/kmk/tests/scripts/variables/define

    r2591 r3140  
    3131endef
    3232
     33define posix ::=
     34@echo $(FOO)
     35endef
     36
    3337append = @echo a
    3438
     
    5054all: ; $(multi)
    5155        $(simple)
     56        $(posix)
    5257        $(append)
    5358        $(cond)
    5459',
    55               '', "echo hi\nhi\nthere\nfoo\na\nb\nfirst\n");
     60              '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n");
     61
     62# TEST 1a: Various new-style define/endef, with no spaces
     63
     64run_make_test('
     65FOO = foo
     66
     67define multi=
     68echo hi
     69@echo $(FOO)
     70endef # this is the end
     71
     72define simple:=
     73@echo $(FOO)
     74endef
     75
     76define posix::=
     77@echo $(FOO)
     78endef
     79
     80append = @echo a
     81
     82define append+=
     83
     84@echo b
     85endef
     86
     87define cond?= # this is a conditional
     88@echo first
     89endef
     90
     91define cond?=
     92@echo second
     93endef
     94
     95FOO = there
     96
     97all: ; $(multi)
     98        $(simple)
     99        $(posix)
     100        $(append)
     101        $(cond)
     102',
     103              '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n");
    56104
    57105# TEST 2: define in true section of conditional (containing conditional)
     
    113161all: ; @echo ok
    114162',
    115               '', "#MAKEFILE#:3: extraneous text after `define' directive\nok\n");
     163              '', "#MAKEFILE#:3: extraneous text after 'define' directive\nok\n");
    116164
    117165# TEST 7: NEGATIVE: extra text after endef
     
    124172all: ; @echo ok
    125173',
    126               '', "#MAKEFILE#:5: extraneous text after `endef' directive\nok\n");
     174              '', "#MAKEFILE#:5: extraneous text after 'endef' directive\nok\n");
    127175
    128176# TEST 8: NEGATIVE: missing endef
     
    135183endef$(NAME)
    136184',
    137               '', "#MAKEFILE#:4: *** missing `endef', unterminated `define'.  Stop.\n", 512);
     185              '', "#MAKEFILE#:4: *** missing 'endef', unterminated 'define'.  Stop.\n", 512);
    138186
    139187# -------------------------
  • trunk/src/kmk/tests/scripts/variables/flavors

    r2591 r3140  
    7474              '', "Hello\n");
    7575
     76# TEST 6: Simple using POSIX syntax
     77run_make_test('
     78bar = Goodbye
     79foo ::= $(bar)
     80bar = ${ugh}
     81ugh = Hello
     82all: ; @echo $(foo)
     83',
     84              '', "Goodbye\n");
     85
     86# TEST 7: POSIX syntax no spaces
     87run_make_test('
     88bar = Goodbye
     89foo::=$(bar)
     90bar = ${ugh}
     91ugh = Hello
     92all: ; @echo $(foo)
     93',
     94              '', "Goodbye\n");
     95
    76961;
  • trunk/src/kmk/tests/scripts/variables/private

    r2591 r3140  
    7676               '', "b=a\na=a\n");
    7777
     78# 9: make sure private suppresses inheritance
     79run_make_test(q!
     80DEFS = FOO
     81all: bar1
     82bar1: private DEFS += 1
     83bar3: private DEFS += 3
     84bar1: bar2
     85bar2: bar3
     86bar1 bar2 bar3: ; @echo '$@: $(DEFS)'
     87!,
     88              '', "bar3: FOO 3\nbar2: FOO\nbar1: FOO 1\n");
     89
     90# 10: Test append with pattern-specific variables and private
     91
     92run_make_test(q!
     93IA = global
     94PA = global
     95PS = global
     96S = global
     97PS = global
     98SV = global
     99b%: IA += b%
     100b%: private PA += b%
     101b%: private PS = b%
     102bar: all
     103bar: IA += bar
     104bar: private PA += bar
     105bar: private PS = bar
     106a%: IA += a%
     107a%: private PA += a%
     108a%: private PS = a%
     109all: IA += all
     110all: private PA += all
     111all: private PS = all
     112
     113bar all: ; @echo '$@: IA=$(IA)'; echo '$@: PA=$(PA)'; echo '$@: PS=$(PS)'
     114!,
     115              '', "all: IA=global b% bar a% all
     116all: PA=global a% all
     117all: PS=all
     118bar: IA=global b% bar
     119bar: PA=global b% bar
     120bar: PS=bar\n");
     121
    781221;
  • trunk/src/kmk/tests/scripts/variables/special

    r2000 r3140  
    1515BAR := bar
    1616
    17 all:
    18         @echo X1 = $(X1)
    19         @echo X2 = $(X2)
    20         @echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
     17all: ; @echo X1 = $(X1); echo X2 = $(X2); echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
    2118',
    2219               '', "X1 =\nX2 = FOO\nLAST = BAR FOO\n");
    2320
     21# SV 45728: Test that undefining a variable is reflected properly
    2422
     23&run_make_test('
     24FOO := foo
     25BAR := bar
     26$(info one: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
     27undefine BAR
     28BAZ := baz
     29$(info two: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
     30all:;@:
     31',
     32               '', "one: BAR FOO\ntwo: BAZ FOO\n");
    2533
    2634# $makefile2 = &get_tmpfile;
     
    3240
    3341# all: foo
    34 #       @echo X1 = $(X1)
    35 #       @echo X2 = $(X2)
    36 #       @echo LAST = $(sort $(.TARGETS))
     42#       @echo X1 = $(X1)
     43#       @echo X2 = $(X2)
     44#       @echo LAST = $(sort $(.TARGETS))
    3745
    3846# X2 := $(sort $(.TARGETS))
     
    5563&run_make_test('
    5664define foo
    57 : foo-one \
     65: foo-one\
    5866foo-two
    5967: foo-three
     
    116124: foo-four');
    117125
     126# Test that the "did you mean TAB" message is printed properly
     127
     128run_make_test(q!
     129$x.
     130!,
     131              '', '#MAKEFILE#:2: *** missing separator.  Stop.', 512);
     132
     133run_make_test(q!
     134foo:
     135        bar
     136!,
     137              '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.', 512);
     138
     139run_make_test(q!
     140.RECIPEPREFIX = :
     141foo:
     142        bar
     143!,
     144              '', '#MAKEFILE#:4: *** missing separator.  Stop.', 512);
     145
    1181461;
     147
     148### Local Variables:
     149### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
     150### End:
Note: See TracChangeset for help on using the changeset viewer.