From 4889f240fe1a237f549a3efb82c989e97842e1df Mon Sep 17 00:00:00 2001 From: RDR8 Date: Wed, 29 Mar 2017 12:59:46 -0500 Subject: [PATCH 1/3] Restore inadvertant changes to Makefiles --- examples/Makefile | 11 +++++++++-- src/Makefile | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 22438f2f4..70e563711 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -87,7 +87,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources + CFLAGS = -O2 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources --profiling #-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing #-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) endif @@ -122,7 +122,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI) INCLUDES += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) - # add standard directories for GNU/Linux ifeq ($(PLATFORM_OS),WINDOWS) # external libraries headers # GLFW3 @@ -130,6 +129,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # OpenAL Soft INCLUDES += -I../src/external/openal_soft/include endif + ifeq ($(PLATFORM_OS),LINUX) + # you may optionally create this directory and install raylib + # and related headers there. Edit ../src/Makefile appropriately. + INCLUDES += -I/usr/local/include/raylib + endif + ifeq ($(PLATFORM_OS),OSX) + # additional directories for MacOS + endif endif # define library paths containing required libs diff --git a/src/Makefile b/src/Makefile index 598a9be42..0931ef3c6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -172,9 +172,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources - #-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing - #-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) + CFLAGS = -O2 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources + # -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 endif ifeq ($(PLATFORM),PLATFORM_RPI) CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces From f65bd8e4a05813e8c67348d42cce270a9bc05d0d Mon Sep 17 00:00:00 2001 From: RDR8 Date: Wed, 29 Mar 2017 14:49:20 -0500 Subject: [PATCH 2/3] Edit examples/Makefile PLATFORM_WEB CFLAGS to match src/Makefile --- examples/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Makefile b/examples/Makefile index 70e563711..1a4be85a8 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -87,7 +87,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS = -O2 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources --profiling + CFLAGS = -O2 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources #-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing #-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) endif From 44de97ea160b0be2591be1108c389479faab8d45 Mon Sep 17 00:00:00 2001 From: RDR8 Date: Wed, 29 Mar 2017 16:04:29 -0500 Subject: [PATCH 3/3] Fine-tuning PLATFORM_WEB CFLAGS --- examples/Makefile | 8 +++++--- src/Makefile | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 1a4be85a8..b7b83f9b9 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -87,9 +87,11 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS = -O2 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources - #-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing - #-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) + CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources + # -O2 # if used, also set --memory-init-file 0 + # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) + #-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing + #-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) endif ifeq ($(PLATFORM),PLATFORM_RPI) CFLAGS = -O2 -s -Wall -std=gnu99 -fgnu89-inline diff --git a/src/Makefile b/src/Makefile index 0931ef3c6..4259a66bb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -172,7 +172,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS = -O2 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources + CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources + # -O2 # if used, also set --memory-init-file 0 + # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) # -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