summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRay <[email protected]>2019-01-08 12:36:37 +0100
committerRay <[email protected]>2019-01-08 12:36:37 +0100
commit397b1a77a22d6a2308e9bad50d0f74a9a46e85c0 (patch)
treee871fd03a11110aadab696f527e74968eef3a61b /examples
parent18fc9676f3bcbe2190c8d6e4158d2827e692a330 (diff)
downloadraylib.com-397b1a77a22d6a2308e9bad50d0f74a9a46e85c0.tar.gz
raylib.com-397b1a77a22d6a2308e9bad50d0f74a9a46e85c0.zip
Update Makefile
Diffstat (limited to 'examples')
-rw-r--r--examples/web/Makefile24
1 files changed, 14 insertions, 10 deletions
diff --git a/examples/web/Makefile b/examples/web/Makefile
index 31deca4..1bc9ea3 100644
--- a/examples/web/Makefile
+++ b/examples/web/Makefile
@@ -171,14 +171,25 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS += -std=gnu99
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
- # -O2 # if used, also set --memory-init-file 0
+ # -Os # size optimization
+ # -O2 # optimization level 2, if used, also set --memory-init-file 0
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
+ # -s USE_GLFW=3 # Use glfw3 library (context/input management)
+ # -s USE_SDL=2 # Use SDL2 library, required for audio backend
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
# -s USE_PTHREADS=1 # multithreading support
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
+ # -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
+ # -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
+ # --profiling # include information for code profiling
# --preload-file resources # specify a resources folder for data compilation
- CFLAGS += -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1
+ CFLAGS += -Os -s USE_GLFW=3 -s USE_SDL=2 -s WASM=1 -s FORCE_FILESYSTEM=1
+
+ # NOTE: Simple raylib examples are compiled to be interpreter by emterpreter, that way,
+ # we can compile same code for ALL platforms with no change required, but, working on bigger
+ # projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
+ # logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference.
# Define a custom shell .html and output extension
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
@@ -368,20 +379,13 @@ core/core_color_select: core/core_color_select.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
# compile [core] example - drop files
+# NOTE: File drop not supported on PLATFORM_ANDROID and PLATFORM_RPI (native)
core/core_drop_files: core/core_drop_files.c
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
-else
- @echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI
-endif
# compile [core] example - storage values
core/core_storage_values: core/core_storage_values.c
-ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
-else
- @echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
-endif
# compile [core] example - gestures detection
core/core_gestures_detection: core/core_gestures_detection.c