From 29d8b48503f3064cdc1f3a87c01b4264e716a220 Mon Sep 17 00:00:00 2001 From: Palaui Date: Tue, 9 Dec 2014 13:10:05 +0100 Subject: Corrected some bugs... [core] Added SetMousePosition() [models] LoadHeightmap() - Corrected textures bug [raymath] Functions renaming [WEB] Prepare environment for emscripten! --- src/makefile | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index bb37748a..76984bbe 100644 --- a/src/makefile +++ b/src/makefile @@ -24,7 +24,7 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX +# Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_DESKTOP_MAC PLATFORM_WEB PLATFORM ?= PLATFORM_RPI # define raylib graphics api depending on selected platform @@ -40,16 +40,26 @@ endif # NOTE: makefiles targets require tab indentation # define compiler: gcc for C program, define as g++ for C++ -CC = gcc +ifeq ($(PLATFORM),PLATFORM_WEB) + # define emscripten compiler + CC = emcc +else + # define default gcc compiler + CC = gcc +endif # define compiler flags: # -O2 defines optimization level # -Wall turns on most, but not all, compiler warnings # -std=c99 use standard C from 1999 revision +ifeq ($(PLATFORM),PLATFORM_WEB) + CFLAGS = -O3 -s USE_GLFW=3 -s LEGACY_GL_EMULATION=1 +else ifeq ($(PLATFORM),PLATFORM_RPI) CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline else - CFLAGS = -O2 -Wall -std=c99 -fgnu89-inline + CFLAGS = -O2 -Wall -std=c99 +endif endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes @@ -69,11 +79,16 @@ default: raylib # compile raylib library raylib: $(OBJS) +ifeq ($(PLATFORM),PLATFORM_WEB) + emcc $(OBJS) -o raylib.bc +else ar rcs libraylib.a $(OBJS) +endif # compile core module +# emcc core.c -o core.bc -DPLATFORM_DESKTOP core.o: core.c - $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile rlgl module rlgl.o: rlgl.c @@ -85,19 +100,19 @@ raymath.o: raymath.c # compile shapes module shapes.o: shapes.c - $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile textures module textures.o: textures.c - $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile text module text.o: text.c - $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile models module models.o: models.c - $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile audio module audio.o: audio.c -- cgit v1.2.3