Cleanup Makefile

Additionally strip the output object file.

Signed-off-by: Mahyar Koshkouei <mahyar.koshkouei@gmail.com>
This commit is contained in:
Mahyar Koshkouei 2018-01-07 20:31:28 +00:00
parent 052a95b7bf
commit 0d92199936
1 changed files with 41 additions and 59 deletions

View File

@ -1,9 +1,9 @@
STATIC_LINKING := 0
AR := ar
DEBUG := 1
DEBUG := 0
ifeq ($(platform),)
platform = unix
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
@ -15,21 +15,6 @@ else ifneq ($(findstring win,$(shell uname -a)),)
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
TARGET_NAME := mpv
LIBM = -lm
@ -49,7 +34,7 @@ endif
endif
ifeq ($(STATIC_LINKING), 1)
EXT := a
EXT := a
endif
ifeq ($(platform), unix)
@ -70,11 +55,9 @@ else ifneq (,$(findstring ios,$(platform)))
TARGET := $(TARGET_NAME)_libretro_ios.dylib
fpic := -fPIC
SHARED := -dynamiclib
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
DEFINES := -DIOS
CC = cc -arch armv7 -isysroot $(IOSSDK)
ifeq ($(platform),ios9)
@ -83,7 +66,7 @@ CFLAGS += -miphoneos-version-min=8.0
else
CC += -miphoneos-version-min=5.0
CFLAGS += -miphoneos-version-min=5.0
endif
endif #ifneq ios
else ifneq (,$(findstring qnx,$(platform)))
TARGET := $(TARGET_NAME)_libretro_qnx.so
fpic := -fPIC
@ -105,16 +88,15 @@ else
endif
LDFLAGS += $(LIBM) -lmpv
LIBRETRO-COM = -Ilibretro-common/include
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
CFLAGS += -Ofast -s
endif
OBJECTS := mpv-libretro.o
CFLAGS += -Wall -pedantic $(LIBRETRO-COM) $(fpic)
CFLAGS += -Wall -pedantic $(fpic)
ifneq (,$(findstring qnx,$(platform)))
CFLAGS += -Wc,-std=c99
@ -128,7 +110,7 @@ $(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS)
$(CC) $(fpic) $(SHARED) $(CFLAGS) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c