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

The Makefile generated by premake5 gmake2 calls sh.exe #2196

Open
ghost opened this issue Mar 24, 2024 · 9 comments
Open

The Makefile generated by premake5 gmake2 calls sh.exe #2196

ghost opened this issue Mar 24, 2024 · 9 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 24, 2024

I'm using a standalone MinGW distro with mingw32-make. If the Makefile generated by premake5 gmake2 requires a POSIX environment then it's useless for me. The reason why I use a standalone MinGW distro is because I don't want to install a full MSYS2.

@ghost ghost added the bug label Mar 24, 2024
@ghost ghost closed this as completed Mar 24, 2024
@ghost
Copy link
Author

ghost commented Mar 25, 2024

The document is confusing. It said:

gmake2 : Generate GNU Makefiles (including Cygwin and MinGW)

The original MinGW.org is pretty much dead. No one remember it. People are now all using MinGW-w64. Even so, the statement above is wrong. The original MinGW.org is also pure Win32 like MinGW-w64. But it does have something called MSYS to provide a POSIX environment. MSYS to the original MinGW.org is the same as MSYS2 to MinGW-w64.

@Peter0x44
Copy link
Contributor

@iahung2 it does not require a "posix" environment. cmd.exe works fine too.
Are you encountering some issues regarding using gcc?

@ghost ghost reopened this Mar 31, 2024
@ghost
Copy link
Author

ghost commented Mar 31, 2024

@iahung2 it does not require a "posix" environment. cmd.exe works fine too. Are you encountering some issues regarding using gcc?

I can confirm with you that it calls sh.exe. Since there is no sh.exe in PATH, it failed to create the process. Not to mention that when using MSYS2, only the POSIX version of make works. mingw32-make will not work.

SpartanJ/ecode#141

@Peter0x44
Copy link
Contributor

@iahung2 make (or mingw32-make, it doesn't matter) will search your PATH for an sh.exe and use it if it's present. This is documented behavior.

@Peter0x44
Copy link
Contributor

If you wish to enforce a certain shell, you should use:
make SHELL=cmd (if this is a problem)
Premake's generated makefiles should work under both.

@ghost
Copy link
Author

ghost commented Apr 5, 2024

If you wish to enforce a certain shell, you should use: make SHELL=cmd (if this is a problem) Premake's generated makefiles should work under both.

This statement is plainly wrong. It needs a POSIX environment. I have tested in Windows Command Prompt. The error is always about it's failed to CreateProcess a random POSIX utility that simply doesn't exist in a pure Windows environment.

p/s: I have removed anything related to MSYS2 in the PATH environment variable. The MinGW in PATH is a standalone MinGW distro by niXman.

@ghost
Copy link
Author

ghost commented Apr 5, 2024

This is the command I used in Windows Command Prompt:

premake5 gmake2
mingw32-make SHELL=cmd config=release_x86_64 -C make/windows -j4

I downloaded premake-5.0.0-beta2-windows.zip from your website and extracted it into the root of eepp directory.

With SHELL=cmd and MSYS2 removed from PATH, it seems to no longer call sh.exe, but now it's trying to call cc.

p/s: If you want to prove me wrong, please give me a command that works.

@Peter0x44
Copy link
Contributor

@iahung2 the "mingw environment by NixMan" does not provide an alias for cc->gcc. You can make one, or test by adding CC=gcc to your command.

@Peter0x44
Copy link
Contributor

Peter0x44 commented Apr 5, 2024

This statement is plainly wrong. It needs a POSIX environment.

YOUR statement is plainly wrong. I have done exactly this, and even fixed bugs with the configuration you described before. You need to make your tone more calm.

@ghost ghost closed this as completed Apr 5, 2024
@ghost ghost reopened this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant