Fix Makefile platform detection
Now works with buildroot. Signed-off-by: Mahyar Koshkouei <mahyar.koshkouei@gmail.com>
This commit is contained in:
parent
fd7fb797da
commit
7534a3d6e9
30
Makefile
30
Makefile
|
@ -4,15 +4,25 @@ DEBUG := 0
|
||||||
|
|
||||||
ifeq ($(platform),)
|
ifeq ($(platform),)
|
||||||
platform = unix
|
platform = unix
|
||||||
ifeq ($(shell uname -a),)
|
ifeq ($(shell uname -s),)
|
||||||
|
EXE_EXT = .exe
|
||||||
platform = win
|
platform = win
|
||||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
else ifneq ($(findstring MINGW,$(shell uname -s)),)
|
||||||
platform = win
|
platform = win
|
||||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
else ifneq ($(findstring Darwin,$(shell uname -s)),)
|
||||||
platform = osx
|
platform = osx
|
||||||
else ifneq ($(findstring win,$(shell uname -a)),)
|
ifeq ($(shell uname -p),powerpc)
|
||||||
|
arch = ppc
|
||||||
|
else
|
||||||
|
arch = intel
|
||||||
|
endif
|
||||||
|
else ifneq ($(findstring win,$(shell uname -s)),)
|
||||||
platform = win
|
platform = win
|
||||||
endif
|
endif
|
||||||
|
else ifneq (,$(findstring armv,$(platform)))
|
||||||
|
override platform += unix
|
||||||
|
else ifneq (,$(findstring rpi3,$(platform)))
|
||||||
|
override platform += unix
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_NAME := mpv
|
TARGET_NAME := mpv
|
||||||
|
@ -36,15 +46,11 @@ ifeq ($(STATIC_LINKING), 1)
|
||||||
EXT := a
|
EXT := a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(platform), unix)
|
ifneq (,$(findstring unix,$(platform)))
|
||||||
EXT ?= so
|
EXT ?= so
|
||||||
TARGET := $(TARGET_NAME)_libretro.$(EXT)
|
TARGET := $(TARGET_NAME)_libretro.$(EXT)
|
||||||
fpic := -fPIC
|
fpic := -fPIC
|
||||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||||
else ifeq ($(platform), linux-portable)
|
|
||||||
TARGET := $(TARGET_NAME)_libretro.$(EXT)
|
|
||||||
fpic := -fPIC -nostdlib
|
|
||||||
SHARED := -shared -Wl,--version-script=link.T
|
|
||||||
else ifneq (,$(findstring osx,$(platform)))
|
else ifneq (,$(findstring osx,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro.dylib
|
TARGET := $(TARGET_NAME)_libretro.dylib
|
||||||
fpic := -fPIC
|
fpic := -fPIC
|
||||||
|
@ -95,6 +101,10 @@ OBJECTS := mpv-libretro.o
|
||||||
LDFLAGS += -lmpv
|
LDFLAGS += -lmpv
|
||||||
CFLAGS += -Wall -pedantic $(fpic)
|
CFLAGS += -Wall -pedantic $(fpic)
|
||||||
|
|
||||||
|
ifneq (,$(findstring gles,$(platform)))
|
||||||
|
CFLAGS += -DHAVE_OPENGLES
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(findstring qnx,$(platform)))
|
ifneq (,$(findstring qnx,$(platform)))
|
||||||
CFLAGS += -Wc,-std=c99
|
CFLAGS += -Wc,-std=c99
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue