aboutsummaryrefslogtreecommitdiff
path: root/patches/mame2000/1000-trimui-build.patch
blob: b02c1ccbf4e3fc2c5abdcb0335c2ce8d263317ce (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
50
51
52
53
54
diff --git a/Makefile b/Makefile
index 4b0667a..34df34e 100644
--- a/Makefile
+++ b/Makefile
@@ -335,6 +335,26 @@ else ifeq ($(platform), gcw0)
    DISABLE_ERROR_LOGGING := 1
    CFLAGS += -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 += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -mtune=arm926ej-s -fno-PIC -flto
+	CFLAGS += -fsingle-precision-constant
+	CFLAGS += -fno-exceptions -fcommon -fno-unwind-tables -fno-asynchronous-unwind-tables
+	CFLAGS += -funroll-loops -fno-optimize-sibling-calls
+	DISABLE_ERROR_LOGGING := 1
+  ARM = 1
+	USE_CYCLONE = 1
+	USE_DRZ80 = 1
+  OPTIMIZE := -Ofast -DNDEBUG
+	ifeq (,$(DEBUG))
+		LDFLAGS += -s
+	endif
+
 # Windows MSVC 2010 x64
 else ifeq ($(platform), windows_msvc2010_x64)
 	CC  = cl.exe
@@ -522,6 +542,8 @@ endif
 
 ifeq ($(DEBUG), 1)
 CFLAGS += -O0 -g
+else ifneq (,$(OPTIMIZE))
+CFLAGS += $(OPTIMIZE)
 else
 CFLAGS += -O2 -DNDEBUG
 endif
@@ -531,6 +553,13 @@ RM = rm -f
 LIBS = -lm
 OBJ = obj
 
+ifeq ($(PROFILE), GENERATE)
+	CFLAGS	+= -fprofile-generate=./profile/mame2000
+	LIBS	+= -lgcov
+else ifeq ($(PROFILE), APPLY)
+	CFLAGS	+= -fprofile-use -fprofile-dir=../profile/mame2000 -fbranch-probabilities
+endif
+
 ifeq ($(HAVE_RZLIB),)
 ZLIB_INCLUDE := -Isrc/zlib
 endif