-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
161 lines (135 loc) · 4.24 KB
/
Makefile
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/make
#CPPFLAGS := -g -O3 -march=armv7-a -mtune=cortex-a9 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -I. $(shell sdl-config --cflags) $(shell pkg-config --cflags x11)
CFLAGS := -g -O3 -march=native -mtune=native -mfpu=neon-fp16 -mfloat-abi=hard -ftree-vectorize -fno-strict-overflow -mno-unaligned-access -funsafe-math-optimizations -I. $(shell sdl-config --cflags) $(shell pkg-config --cflags x11)
CPPFLAGS := -g -O3 -march=native -mtune=native -mfpu=neon-fp16 -mfloat-abi=hard -ftree-vectorize -fno-strict-overflow -mno-unaligned-access -funsafe-math-optimizations -I. $(shell sdl-config --cflags) $(shell pkg-config --cflags x11)
#LDLIBS := -nostartfiles -lz $(shell sdl-config --libs) $(shell pkg-config --libs x11) -lpopt
LDLIBS := -lz $(shell sdl-config --libs) $(shell pkg-config --libs x11) -lpopt
-include config.mk
# Sane defaults
CONF_GUI?=1
ifeq ($(ARCH),armel)
CONF_BUILD_ASM_CPU?=1
CONF_BUILD_ASM_SPC700?=1
CONF_BUILD_ASM_SA1?=0 # Still not there
CONF_BUILD_MISC_ROUTINES?=misc_armel
else ifeq ($(ARCH),armhf)
CONF_BUILD_ASM_CPU?=1
CONF_BUILD_ASM_SPC700?=1
CONF_BUILD_ASM_SA1?=0 # Still not there
CONF_BUILD_MISC_ROUTINES?=misc_armel
else ifeq ($(ARCH),i386)
CONF_BUILD_ASM_CPU?=0
CONF_BUILD_ASM_SPC700?=0
CONF_BUILD_ASM_SA1?=0
CONF_BUILD_MISC_ROUTINES?=misc_i386
else ifeq ($(ARCH),amd64)
CONF_BUILD_ASM_CPU?=0
CONF_BUILD_ASM_SPC700?=0
CONF_BUILD_ASM_SA1?=0
CONF_BUILD_MISC_ROUTINES?=misc_amd64
endif
# PNG screenshot support (requires libpng)
CONF_PNG?=1
# Hardware pixel doubling (in N8x0)
CONF_XSP?=0
# Hildon Desktop compositing (in Fremantle)
CONF_HD?=1
# Link to libzeemote
CONF_ZEEMOTE?=0
# SNES stuff
OBJS = apu.o c4.o c4emu.o cheats.o cheats2.o clip.o cpu.o cpuexec.o data.o
OBJS += dma.o dsp1.o font.o fxemu.o fxinst.o gfx.o globals.o loadzip.o memmap.o
OBJS += ppu.o sa1.o sdd1.o sdd1emu.o snapshot.o soundux.o spc700.o srtc.o tile.o
OBJS += misc_armel.o
ifeq ($(CONF_BUILD_ASM_CPU), 1)
# ASM CPU Core from yoyofr's OpenSnes9X
OBJS += os9x_asm_cpu.o os9x_65c816.o
CPPFLAGS += -DCONF_BUILD_ASM_CPU=1
else
OBJS += cpuops.o
endif
ifeq ($(CONF_BUILD_ASM_SPC700), 1)
OBJS += spc700a.o
CPPFLAGS += -DCONF_BUILD_ASM_SPC700=1
endif
ifeq ($(CONF_BUILD_ASM_SA1), 1)
crash
else
OBJS += sa1cpu.o
endif
OBJS += $(CONF_BUILD_MISC_ROUTINES).o
# from open-whatever sdk
OBJS += unzip.o ioapi.o
# my extensions to snes9x (speedhacks support)
OBJS += hacks.o
# the glue code that sticks it all together in a monstruous way
OBJS += platform/path.o platform/config.o
OBJS += platform/sdl.o platform/sdlv.o platform/sdla.o platform/sdli.o
OBJS += platform/sdlvscalers.o
ifeq ($(CONF_PNG), 1)
CPPFLAGS += -DCONF_PNG=1 $(shell pkg-config --cflags libpng)
LDLIBS += $(shell pkg-config --libs libpng)
OBJS += screenshot.o
endif
ifeq ($(CONF_XSP), 1)
CPPFLAGS += -DCONF_XSP=1 $(shell pkg-config --cflags xsp)
LDLIBS += $(shell pkg-config --libs xsp)
endif
ifeq ($(CONF_HD), 1)
CPPFLAGS += -DCONF_HD=1
LDLIBS += -lSDL_haa
CONF_EXIT_BUTTON ?= 0
endif
ifeq ($(CONF_GUI), 1)
CPPFLAGS += -DCONF_GUI=1 $(shell pkg-config --cflags libosso gconf-2.0)
LDLIBS += $(shell pkg-config --libs libosso gconf-2.0)
OBJS += platform/osso.o
endif
ifeq ($(CONF_EXIT_BUTTON), 1)
CPPFLAGS += -DCONF_EXIT_BUTTON=1
LDLIBS += -lSDL_image
OBJS += platform/sdlvexit.o
endif
ifeq ($(CONF_ZEEMOTE), 1)
CPPFLAGS += -DCONF_ZEEMOTE=1
LDLIBS += -lzeemote -lzeemote-conf -lbluetooth
OBJS += platform/zeemote.o
endif
# automatic dependencies
DEPS := $(OBJS:.o=.d)
all: drnoksnes
clean:
rm -f drnoksnes *.o *.d platform/*.o platform/*.d
rm -f build-stamp configure-stamp
echo "$(OBJS)"
remake: clean deps all
-include $(DEPS)
drnoksnes: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
install: drnoksnes
install drnoksnes $(DESTDIR)/usr/games
deps: $(DEPS)
%.d: %.cpp
@$(CXX) $(CPPFLAGS) -MM $^ -MF $@ -MT $@ -MT $*.o
%.d: %.c
@$(CC) $(CPPFLAGS) -MM $^ -MF $@ -MT $@ -MT $*.o
%.d: %.s
@touch $@
# GUI
gui:
$(MAKE) -C gui all
gui_clean:
$(MAKE) -C gui clean
gui_install:
$(MAKE) -C gui install DESTDIR="$(DESTDIR)"
ifeq ($(CONF_GUI), 1)
all: gui
clean: gui_clean
install: gui_install
endif
profclean: clean
find . -name '*.gcno' -delete
find . -name '*.gcda' -delete
distclean: profclean clean
rm -f config.mk
.PHONY: all clean remake deps install gui gui_clean distclean