aboutsummaryrefslogtreecommitdiff
path: root/patches/bluemsx/1000-trimui-build.patch
blob: b140866e3796fe8db55887e32906bc3f74528c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/Makefile.libretro b/Makefile.libretro
index 0e8b073..aec4ea2 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -428,6 +428,20 @@ else ifneq (,$(findstring armv,$(platform)))
 	endif
 	PLATFORM_DEFINES += -DARM
 
+# TRIMUI
+else ifeq ($(platform), trimui)
+	TARGET := $(TARGET_NAME)_libretro.so
+	CC = $(CROSS_COMPILE)gcc
+	CXX = $(CROSS_COMPILE)g++
+	AR = $(CROSS_COMPILE)ar
+	SHARED := -shared -Wl,-version-script=link.T
+	LDFLAGS += -fno-PIC -flto
+	CFLAGS += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -mtune=arm926ej-s -fno-PIC -flto
+	OPTIMIZE := -Ofast -DNDEBUG
+	ifeq (,$(DEBUG))
+		LDFLAGS += -s
+	endif
+
 # emscripten
 else ifeq ($(platform), emscripten)
 	TARGET := $(TARGET_NAME)_libretro_$(platform).bc
@@ -678,6 +692,9 @@ endif
 ifeq ($(DEBUG), 1)
 	CFLAGS += -O0 -g
 	CXXFLAGS += -O0 -g
+else ifneq (,$(OPTIMIZE))
+	CFLAGS += $(OPTIMIZE)
+	CXXFLAGS += $(OPTIMIZE) -fno-exceptions -fno-rtti -DHAVE_STDINT_H -DNDEBUG
 else
 	CFLAGS += -O2
 	CXXFLAGS += -O2 -fno-exceptions -fno-rtti -DHAVE_STDINT_H -DNDEBUG
@@ -698,6 +715,13 @@ ifeq ($(LOG_PERFORMANCE), 1)
 	CXXFLAGS += -DLOG_PERFORMANCE
 endif
 
+ifeq ($(PROFILE), GENERATE)
+	CFLAGS	+= -fprofile-generate=./profile/$(TARGET_NAME)
+	LDFLAGS	+= -lgcov
+else ifeq ($(PROFILE), APPLY)
+	CFLAGS	+= -fprofile-use -fprofile-dir=../profile/$(TARGET_NAME) -fbranch-probabilities
+endif
+
 include Makefile.common
 
 DEFINES := $(PLATFORM_DEFINES) $(COREDEFINES)