-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile.debug
95 lines (73 loc) · 2.73 KB
/
Makefile.debug
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
ifeq ($(TARGET),)
TARGET = mame
endif
# set this the operating system you're building for
# (actually you'll probably need your own main makefile anyways)
# MAMEOS = msdos
#MAMEOS = gp2x
MAMEOS = rpi
# extension for executables
# EXE = .exe
EXE = .debug
# CPU core include paths
VPATH=src $(wildcard src/cpu/*)
# compiler, linker and utilities
MD = @mkdir
RM = rm -f
CC = arm-linux-gnueabihf-gcc
CPP = arm-linux-gnueabihf-g++
AS = as
LD = arm-linux-gnueabihf-g++
STRIP = strip
EMULATOR = $(TARGET)$(EXE)
#DEFS = -DGP2X -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS -DINLINE="static __inline" -Dasm="__asm__ __volatile__" -DMAME_UNDERCLOCK -DMAME_FASTSOUND -DENABLE_AUTOFIRE -DBIGCASE
DEFS = -DGP2X -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS -DINLINE="static __inline" -Dasm="__asm__ __volatile__" -DMAME_UNDERCLOCK -DENABLE_AUTOFIRE -DBIGCASE
# -DMAME_MEMINLINE
CFLAGS = -g -fsigned-char $(DEVLIBS) \
-Isrc -Isrc/$(MAMEOS) -Isrc/zlib \
-I/usr/include/SDL \
-I$(SDKSTAGE)/opt/vc/include -I$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads \
-I$(SDKSTAGE)/opt/vc/include/interface/vmcs_host/linux \
-I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include \
-march=armv6 -mfpu=vfp -mfloat-abi=hard \
-ffast-math -fomit-frame-pointer -fstrict-aliasing \
-mstructure-size-boundary=32 -fexpensive-optimizations \
-fweb -frename-registers -falign-functions=16 -falign-loops -falign-labels -falign-jumps \
-finline -finline-functions -fno-common -fno-builtin -fsingle-precision-constant \
-Wall -Wno-sign-compare -Wunused -Wpointer-arith -Wcast-align -Waggregate-return -Wshadow -Wwrite-strings \
-Wno-narrowing
LDFLAGS = $(CFLAGS)
LIBS = -L. -lm -lpthread -lSDL -L$(SDKSTAGE)/opt/vc/lib -lbcm_host -lbrcmGLESv2 -lbrcmEGL -lglib-2.0 -lasound -lrt
OBJ = obj_$(TARGET)_$(MAMEOS)_debug
OBJDIRS = $(OBJ) $(OBJ)/cpu $(OBJ)/sound $(OBJ)/$(MAMEOS) \
$(OBJ)/drivers $(OBJ)/machine $(OBJ)/vidhrdw $(OBJ)/sndhrdw \
$(OBJ)/zlib
all: maketree $(EMULATOR)
# include the various .mak files
include src/core.mak
include src/$(TARGET).mak
include src/rules.mak
include src/sound.mak
include src/$(MAMEOS)/$(MAMEOS).mak
# combine the various definitions to one
CDEFS = $(DEFS) $(COREDEFS) $(CPUDEFS) $(SOUNDDEFS)
$(EMULATOR): $(COREOBJS) $(OSOBJS) $(DRVOBJS)
$(LD) $(LDFLAGS) $(COREOBJS) $(OSOBJS) $(LIBS) $(DRVOBJS) -o $@
$(OBJ)/%.o: src/%.c
@echo Compiling $<...
$(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
$(OBJ)/%.o: src/%.cpp
@echo Compiling $<...
$(CPP) $(CDEFS) $(CFLAGS) -fno-rtti -c $< -o $@
$(OBJ)/%.o: src/%.s
@echo Compiling $<...
$(CPP) $(CDEFS) $(CFLAGS) -c $< -o $@
$(OBJ)/%.o: src/%.S
@echo Compiling $<...
$(CPP) $(CDEFS) $(CFLAGS) -c $< -o $@
$(sort $(OBJDIRS)):
$(MD) $@
maketree: $(sort $(OBJDIRS))
clean:
$(RM) -r $(OBJ)
$(RM) $(EMULATOR)