aboutsummaryrefslogtreecommitdiff
path: root/patches/mame2003_plus/1000-trimui-build.patch
blob: 8b2bbacdb22bbd7b8bd5076c0c908163ab4a2e73 (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
diff --git a/Makefile b/Makefile
index 14082f8..364a327 100644
--- a/Makefile
+++ b/Makefile
@@ -489,6 +489,23 @@ else ifeq ($(platform), gcw0)
 	fpic := -fPIC -nostdlib
 	CFLAGS += -lm -march=mips32 -mtune=mips32r2 -mhard-float
 
+# Trimui
+else ifeq ($(platform), trimui)
+	TARGET = $(TARGET_NAME)_libretro.so
+	CC = $(CROSS_COMPILE)gcc
+	CXX = $(CROSS_COMPILE)g++
+	AR = $(CROSS_COMPILE)ar
+	LDFLAGS += -shared -Wl,--version-script=link.T -Wl,-no-undefined -fno-PIC -flto
+	CFLAGS += -std=c99 -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -mtune=arm926ej-s -fno-PIC -flto
+	CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions
+	LIBS := -lc -lgcc -lm
+	CPU_ARCH := arm
+	ARM = 1
+	OPTIMIZE := -Ofast -DNDEBUG
+	ifeq (,$(DEBUG))
+		LDFLAGS += -s
+	endif
+
 # RetroFW
 else ifeq ($(platform), retrofw)
 	TARGET := $(TARGET_NAME)_libretro.so
@@ -795,10 +812,19 @@ CFLAGS += -DRETRO_PROFILE=$(RETRO_PROFILE)
 # Disable optimization when debugging #####################
 ifeq ($(DEBUG), 1)
 	CFLAGS += -O0 -g3
+else ifneq (,$(OPTIMIZE))
+	CFLAGS += $(OPTIMIZE)
 else
 	CFLAGS += -O2 -DNDEBUG
 endif
 
+ifeq ($(PROFILE), GENERATE)
+	CFLAGS	+= -fprofile-generate=./profile/mame2003_plus
+	LDFLAGS	+= -lgcov
+else ifeq ($(PROFILE), APPLY)
+	CFLAGS	+= -fprofile-use -fprofile-dir=../profile/mame2003_plus -fbranch-probabilities
+endif
+
 ifneq (,$(findstring msvc,$(platform)))
 ifeq ($(DEBUG),1)
 	CFLAGS += -MTd