Merge pull request #373 from Martinfx/master

Added support FreeBSD
This commit is contained in:
Ray 2017-10-28 22:22:04 +02:00 committed by GitHub
commit 52cd0395b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 4 deletions

View file

@ -54,12 +54,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
LIBPATH=linux
else
endif
UNAMEOS=$(shell uname)
ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD
LIBPATH=linux
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX
LIBPATH=osx
endif
endif
endif
endif
@ -90,6 +94,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
endif
ifeq ($(PLATFORM_OS),FREEBSD)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/freebsd
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
@ -106,6 +113,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler
CC = clang
endif
ifeq ($(PLATFORM_OS),FREEBSD)
# FreeBSD default compiler
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES)
@ -178,6 +189,13 @@ endif
# Define library paths containing required libs
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD)
INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
LDFLAGS += -L/opt/vc/lib
endif
@ -215,6 +233,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libglfw3-dev libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -lglfw -framework OpenGL -framework OpenAL -framework Cocoa
endif
ifeq ($(PLATFORM_OS),FREEBSD)
# Libraries for FreeBSD desktop compiling
# NOTE: Required packages: glfw openal-soft mesa-libs
LDLIBS = -lraylib -lglfw -lGL -lopenal -lpthread -lm
# On XWindow requires also below libraries
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling