gnumake-windows icon indicating copy to clipboard operation
gnumake-windows copied to clipboard

SHELL and .SHELLFLAGS are ignored?

Open studyingegret opened this issue 1 year ago • 0 comments

SHELL and .SHELLFLAGS don't seem to have effect:

Building test.exe
#include <stdio.h>

int main(int argc, char *argv[]) {
    printf("Program name: %s\n", argv[0]);
    puts("Arguments:");
    if (argc <= 1)
        puts(" -None-");
    else {
        for (int i = 1; i < argc; i++)
            printf("  %s\n", argv[i]);
    }
    int a, b;
    scanf("%i %i", &a, &b);
    printf("%i\n", a + b);
    return 0;
}
cl test.c
SHELL = test.exe
.SHELLFLAGS = a b c
$(info SHELL=$(SHELL))

.PHONY: default

default:
	1 2

Expected output:

Program name: [test.exe or similar]
Arguments:
  a
  b
  c
3

Actual output:

SHELL=test.exe
1 2
'1' is not recognized as an internal or external command,
operable program or batch file.
make: *** [m.make:20: default] Error 1

It shows that Make is able to locate test.exe, but ignores SHELL (and .SHELLFLAGS?) in practice.

Executable: pre-built gnumake-4.3.exe

studyingegret avatar Apr 02 '23 15:04 studyingegret