mirror of
				https://github.com/raysan5/raylib.git
				synced 2025-10-26 12:27:01 +00:00 
			
		
		
		
	Included required paths for web compilation
This commit is contained in:
		
							
								
								
									
										43
									
								
								src/Makefile
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								src/Makefile
									
									
									
									
									
								
							| @@ -47,12 +47,16 @@ PLATFORM ?= PLATFORM_DESKTOP | |||||||
| # define YES if you want shared/dynamic version of library instead of static (default) | # define YES if you want shared/dynamic version of library instead of static (default) | ||||||
| SHARED ?= NO | SHARED ?= NO | ||||||
|  |  | ||||||
| # define NO to use OpenAL Soft as static library (or shared by default) | # use OpenAL Soft as shared library (.so / .dll) | ||||||
|  | # NOTE: If defined NO, static OpenAL Soft library should be provided | ||||||
| SHARED_OPENAL ?= NO | SHARED_OPENAL ?= NO | ||||||
|  |  | ||||||
| # on PLATFORM_WEB force OpenAL Soft shared library | # on PLATFORM_WEB force OpenAL Soft shared library | ||||||
| ifeq ($(PLATFORM),PLATFORM_WEB) | ifeq ($(PLATFORM),PLATFORM_WEB) | ||||||
|     SHARED_OPENAL ?= YES |     SHARED_OPENAL = YES | ||||||
|  | endif | ||||||
|  | ifeq ($(PLATFORM),PLATFORM_ANDROID) | ||||||
|  |     SHARED_OPENAL = YES | ||||||
| endif | endif | ||||||
|  |  | ||||||
| # determine if the file has root access (only for installing raylib) | # determine if the file has root access (only for installing raylib) | ||||||
| @@ -78,6 +82,17 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) | |||||||
|     endif |     endif | ||||||
| endif | endif | ||||||
|  |  | ||||||
|  | ifeq ($(PLATFORM),PLATFORM_WEB) | ||||||
|  |     # Emscripten required variables | ||||||
|  |     EMSDK_PATH = C:/emsdk | ||||||
|  |     EMSCRIPTEN_VERSION = 1.37.9 | ||||||
|  |     CLANG_VERSION=e1.37.9_64bit | ||||||
|  |     PYTHON_VERSION=2.7.5.3_64bit | ||||||
|  |     NODE_VERSION=4.1.1_64bit | ||||||
|  |     export PATH=$(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) | ||||||
|  |     EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) | ||||||
|  | endif | ||||||
|  |  | ||||||
| ifeq ($(PLATFORM),PLATFORM_ANDROID) | ifeq ($(PLATFORM),PLATFORM_ANDROID) | ||||||
|     # Android NDK path |     # Android NDK path | ||||||
|     # NOTE: Required for standalone toolchain generation |     # NOTE: Required for standalone toolchain generation | ||||||
| @@ -179,32 +194,17 @@ endif | |||||||
| #  -std=gnu99           defines C language mode (GNU C from 1999 revision) | #  -std=gnu99           defines C language mode (GNU C from 1999 revision) | ||||||
| #  -fgnu89-inline       declaring inline functions support (GCC optimized) | #  -fgnu89-inline       declaring inline functions support (GCC optimized) | ||||||
| #  -Wno-missing-braces  ignore invalid warning (GCC bug 53119) | #  -Wno-missing-braces  ignore invalid warning (GCC bug 53119) | ||||||
| #  -D_DEFAULT_SOURCE    use with -std=c99 on Linux and PLATFORM_WEB | #  -D_DEFAULT_SOURCE    use with -std=c99 | ||||||
| ifeq ($(PLATFORM),PLATFORM_DESKTOP) | CFLAGS = -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces | ||||||
|     ifeq ($(PLATFORM_OS),WINDOWS) |  | ||||||
|         CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces |  | ||||||
|     endif |  | ||||||
|     ifeq ($(PLATFORM_OS),LINUX) |  | ||||||
|         CFLAGS = -O1 -Wall -std=c99 -D_DEFAULT_SOURCE |  | ||||||
|     endif |  | ||||||
|     ifeq ($(PLATFORM_OS),OSX) |  | ||||||
|         CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces |  | ||||||
|     endif |  | ||||||
| endif |  | ||||||
| ifeq ($(PLATFORM),PLATFORM_RPI) |  | ||||||
|     CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces |  | ||||||
| endif |  | ||||||
| ifeq ($(PLATFORM),PLATFORM_WEB) | ifeq ($(PLATFORM),PLATFORM_WEB) | ||||||
|     CFLAGS = -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources |     CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources | ||||||
|     # -O2                        # if used, also set --memory-init-file 0 |     # -O2                        # if used, also set --memory-init-file 0 | ||||||
|     # --memory-init-file 0       # to avoid an external memory initialization code file (.mem) |     # --memory-init-file 0       # to avoid an external memory initialization code file (.mem) | ||||||
|     # -s ALLOW_MEMORY_GROWTH=1   # to allow memory resizing |     # -s ALLOW_MEMORY_GROWTH=1   # to allow memory resizing | ||||||
|     # -s TOTAL_MEMORY=16777216   # to specify heap memory size (default = 16MB) |     # -s TOTAL_MEMORY=16777216   # to specify heap memory size (default = 16MB) | ||||||
|     # -s USE_PTHREADS=1          # multithreading support |     # -s USE_PTHREADS=1          # multithreading support | ||||||
| endif | endif | ||||||
| ifeq ($(PLATFORM),PLATFORM_ANDROID) |  | ||||||
|     CFLAGS = -O1 -Wall -std=c99 -fgnu89-inline -Wno-missing-braces |  | ||||||
| endif |  | ||||||
|  |  | ||||||
| #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes | #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes | ||||||
|  |  | ||||||
| @@ -377,6 +377,7 @@ external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h | |||||||
| utils.o : utils.c utils.h | utils.o : utils.c utils.h | ||||||
| 	$(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) | 	$(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) | ||||||
|  |  | ||||||
|  |  | ||||||
| # It installs generated and needed files to compile projects using raylib. | # It installs generated and needed files to compile projects using raylib. | ||||||
| # The installation works manually. | # The installation works manually. | ||||||
| # TODO: add other platforms. | # TODO: add other platforms. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ray
					Ray