-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.350h
87 lines (68 loc) · 3.6 KB
/
Makefile.350h
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
PRGNAME = pcfx.elf
CC = /opt/gcw0-toolchain-static/usr/bin/mipsel-linux-gcc
CXX = /opt/gcw0-toolchain-static/usr/bin/mipsel-linux-g++
#### Configuration
# Possible values : retrostone, rs97, rs90
PORT = sdl
# Possible values : alsa, oss, portaudio
SOUND_ENGINE = sdl
PROFILE = YES
CHD = NO
#### End of Configuration
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
INCLUDES = -Ilibretro-common/include -Isrc
INCLUDES += -Ishell/headers -Ishell/video/$(PORT) -Ishell/audio -Ishell/scalers -Ishell/input/sdl -Ishell/fonts -Ishell/menu
INCLUDES += -Imednafen -I./mednafen/vb -I./mednafen/sound -I. -Ishell/emu -Imednafen/include -Ishell/input -Imednafen/video -Imednafen/hw_cpu
INCLUDES += -Ilibretro-common/include -Imednafen/hw_sound
DEFINES = -DLSB_FIRST -DINLINE="inline" -DINLINE="inline" -DNDEBUG -DFORCE_FRAMESKIP
DEFINES += -DWANT_16BPP -DFRONTEND_SUPPORTS_RGB565 -DENABLE_JOYSTICKCODE
DEFINES += -DSIZEOF_DOUBLE=4 -DMEDNAFEN_VERSION=\"0.9.36.5\" -DPACKAGE=\"mednafen\" -DMEDNAFEN_VERSION_NUMERIC=9365 -DMPC_FIXED_POINT -DSTDC_HEADERS -D__STDC_LIMIT_MACROS -D__LIBRETRO__ -D_LOW_ACCURACY_
DEFINES += -DPACKAGE_VERSION=\"1.3.3\" -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -DGCW0 -DGKD350_BUG_INPUT
ifeq ($(CHD), YES)
INCLUDES += -Ideps/libchdr/include -Ideps/lzma-19.00/include
DEFINES += -DHAVE_CHD -D_7ZIP_ST
endif
CFLAGS = -Wall -Wextra -mno-xgot -Ofast -fdata-sections -ffunction-sections -fsection-anchors -fno-builtin -mframe-header-opt -mno-fp-exceptions -mno-check-zero-division -fsingle-precision-constant -fno-common -march=mips32r2 -mtune=mips32r2 -flto -fno-PIC -mno-abicalls
CFLAGS += $(INCLUDES) $(DEFINES) -fno-math-errno -fgcse-las -fgcse-sm -fmerge-all-constants -fno-stack-protector -fomit-frame-pointer
# -freorder-blocks-and-partition -freorder-functions
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 -ftree-vectorize -fno-threadsafe-statics -fno-enforce-eh-specs -fstrict-enums
LDFLAGS = -lc -lgcc -lstdc++ -ldl -lm -lSDL -lasound -logg -lz -Wl,-z,norelro -Wl,--build-id=none -Wl,-O1,--sort-common,--as-needed,--gc-sections -flto -no-pie -s
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate -fprofile-dir=/usr/local/home/pc_gcda
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use -fbranch-probabilities
endif
ifeq ($(SOUND_ENGINE), alsa)
LDFLAGS += -lasound
endif
ifeq ($(SOUND_ENGINE), portaudio)
LDFLAGS += -lasound -lportaudio
endif
ifeq ($(PROFILE), YES)
LDFLAGS += -lgcov
endif
# Files to be compiled
SRCDIR = ./src ./shell ./shell/emu ./shell/menu
SRCDIR += ./shell/input/sdl/ ./shell/video/$(PORT) ./shell/audio/$(SOUND_ENGINE)
SRCDIR += ./mednafen ./mednafen/cdrom ./mednafen/hw_sound/pce_psg ./mednafen/hw_video/huc6270 ./mednafen/pcfx ./mednafen/pcfx/input ./mednafen/sound ./mednafen/hw_cpu/v810 ./mednafen/hw_cpu/v810/fpu-new ./mednafen/video
SRCDIR += ./libretro-common/compat ./libretro-common/file
SRCDIR += ./libretro-common/streams ./libretro-common/string ./libretro-common/time
SRCDIR += ./libretro-common/vfs
ifeq ($(CHD), YES)
SRCDIR += ./deps/libchdr/src ./deps/lzma-19.00/src
endif
VPATH = $(SRCDIR)
SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c))
SRC_CPP = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.cpp))
OBJ_C = $(notdir $(patsubst %.c, %.o, $(SRC_C)))
OBJ_CPP = $(notdir $(patsubst %.cpp, %.o, $(SRC_CPP)))
OBJS = $(OBJ_C) $(OBJ_CPP)
# Rules to make executable
$(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) -std=gnu99 -o $(PRGNAME) $^ $(LDFLAGS)
$(OBJ_CPP) : %.o : %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJ_C) : %.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME)$(EXESUFFIX) *.o