Merge c81948357b into fad81f36e4
This commit is contained in:
commit
2d50bfa8cd
73
src/makefile
73
src/makefile
|
|
@ -21,10 +21,59 @@
|
|||
#
|
||||
#**************************************************************************************************
|
||||
|
||||
PLATFORM_OS = UNDEFINED
|
||||
PLATFORM_ARCH = UNDEFINED
|
||||
|
||||
# detect OS and architecture
|
||||
ifeq ($(OS),Windows_NT)
|
||||
PLATFORM_OS = WIN
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
|
||||
PLATFORM_ARCH = 64
|
||||
endif
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
|
||||
PLATFORM_ARCH = 32
|
||||
endif
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
UNAME_P := $(shell uname -mp)
|
||||
PLATFORM_OS = LINUX
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
UNAME_P := $(shell uname -m)
|
||||
PLATFORM_OS = OSX
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME_P),x86_64)
|
||||
PLATFORM_ARCH = 64
|
||||
endif
|
||||
ifneq ($(filter %86,$(UNAME_P)),)
|
||||
PLATFORM_ARCH = 32
|
||||
endif
|
||||
endif
|
||||
|
||||
# define raylib platform to compile for
|
||||
# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB
|
||||
PLATFORM ?= PLATFORM_DESKTOP
|
||||
|
||||
# define default targets to compile for
|
||||
TARGET_OS ?= $(PLATFORM_OS)
|
||||
TARGET_ARCH ?= $(PLATFORM_ARCH)
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||
TARGET_OS = LINUX
|
||||
TARGET_ARCH = ARM
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||
TARGET_OS = WEB
|
||||
TARGET_ARCH = WEB
|
||||
endif
|
||||
|
||||
# prompt current target
|
||||
$(info **** RUNNING OS = $(PLATFORM_OS), RUNNING ARCH = $(PLATFORM_ARCH))
|
||||
$(info **** TARGET PLATFORM = $(PLATFORM), TARGET OS = $(TARGET_OS), TARGET ARCH = $(TARGET_ARCH))
|
||||
|
||||
# define raylib graphics api depending on selected platform
|
||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||
# define raylib graphics api to use (on RPI, OpenGL ES 2.0 must be used)
|
||||
|
|
@ -46,8 +95,13 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||
# define emscripten compiler
|
||||
CC = emcc
|
||||
else
|
||||
# define default gcc compiler
|
||||
CC = gcc
|
||||
ifeq ($(PLATFORM_OS),OSX)
|
||||
# define llvm compiler for mac
|
||||
CC = clang
|
||||
else
|
||||
# define default gcc compiler
|
||||
CC = gcc
|
||||
endif
|
||||
endif
|
||||
|
||||
# define compiler flags:
|
||||
|
|
@ -69,6 +123,14 @@ else
|
|||
INCLUDES = -I.
|
||||
endif
|
||||
|
||||
# include external libraries
|
||||
#glfw3
|
||||
INCLUDES += -I. -I../external/glfw3/include
|
||||
#glew
|
||||
INCLUDES += -I. -I../external/glew/include
|
||||
#Open AL
|
||||
INCLUDES += -I. -I../external/openal_soft/include
|
||||
|
||||
# define all object files required
|
||||
OBJS = core.o rlgl.o raymath.o shapes.o text.o textures.o models.o audio.o utils.o stb_vorbis.o
|
||||
|
||||
|
|
@ -130,16 +192,21 @@ clean:
|
|||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||
rm -f *.o libraylib.a
|
||||
else
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX)
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
find . -type f -executable -delete
|
||||
rm -f *.o libraylib.a
|
||||
else
|
||||
ifeq ($(PLATFORM_OS),OSX)
|
||||
find . -type f -perm +ugo+x -delete
|
||||
rm -f *.o libraylib.a
|
||||
else
|
||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||
del *.o libraylib.bc
|
||||
else
|
||||
del *.o libraylib.a
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@echo Cleaning done
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,11 @@
|
|||
#include <stdlib.h> // Declares malloc() and free() for memory management, rand()
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_11)
|
||||
#include <GL/gl.h> // Basic OpenGL include
|
||||
//#include <OpenGL/gl.h> // Basic OpenGL include (OSX)
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include <OpenGL/gl.h> // Basic OpenGL include (OSX)
|
||||
#else
|
||||
#include <GL/gl.h> // Basic OpenGL include
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_33)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user