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

[build] [web] Fix examples Makefile for PLATFORM_WEB #4434

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

asdqwe
Copy link
Contributor

@asdqwe asdqwe commented Oct 25, 2024

eb04154 changed emmake make to mingw32-make for PLATFORM_WEB. However, mingw32-make isn't always present (e.g.: Linux hosts), which leads to these:

~/raylib-master/examples$ make PLATFORM=PLATFORM_WEB core/core_basic_window
find . -type f -executable -delete
rm -fv *.o
Cleaning done
mingw32-make -f Makefile.Web core/core_basic_window
make: mingw32-make: No such file or directory
make: *** [Makefile:660: core/core_basic_window] Error 127

Since emmake is usually provided by Emscripten's emsdk, this PR checks if emmake is present. If it is, uses it. If not, falls back to mingw32-make.

@raysan5 raysan5 merged commit 8b36253 into raysan5:master Oct 25, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 25, 2024

@asdqwe Merging... let me test it on Windows... here the result launching the examples/Makefile from Windows to call examples/Makefile.Web (also modified):

mingw32-make models/models_gpu_skinning PLATFORM=PLATFORM_WEB -B
Process started (PID=20276) >>>
process_begin: CreateProcess(NULL, type emmake, ...) failed.
Makefile:200: pipe: No error
mingw32-make -f Makefile.Web models/models_gpu_skinning
make[1]: Entering directory 'C:/GitHub/raylib/examples'
emcc -o models/models_gpu_skinning.html models/models_gpu_skinning.c -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -Os -I. -I../src -I../src/external -L. -L../src -L../src -sUSE_GLFW=3 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=ccall --shell-file ../src/shell.html ../src/libraylib.a -DPLATFORM_WEB -sTOTAL_MEMORY=67108864 \
    --preload-file models/resources/models/gltf/greenman.glb@resources/models/gltf/greenman.glb \
    --preload-file models/resources/shaders/glsl100/skinning.vs@resources/shaders/glsl100/skinning.vs \
    --preload-file models/resources/shaders/glsl100/skinning.fs@resources/shaders/glsl100/skinning.fs
make[1]: Leaving directory 'C:/GitHub/raylib/examples'

It works but note that, for some reason emmake is not properly detected on Windows...

@raysan5
Copy link
Owner

raysan5 commented Oct 25, 2024

@asdqwe asdqwe deleted the fix-examples-makefile-web branch October 25, 2024 22:15
@raysan5
Copy link
Owner

raysan5 commented Oct 25, 2024

@asdqwe Probably a good idea to add the check, so we avoid a first line failure.

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

Successfully merging this pull request may close these issues.

2 participants