Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHELL and .SHELLFLAGS are ignored? #6

Open
studyingegret opened this issue Apr 2, 2023 · 0 comments
Open

SHELL and .SHELLFLAGS are ignored? #6

studyingegret opened this issue Apr 2, 2023 · 0 comments

Comments

@studyingegret
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant