This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
forked from gameblabla/NGPCemu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.retrostone
68 lines (53 loc) · 2.51 KB
/
Makefile.retrostone
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
PRGNAME = ngp.elf
CC = /opt/retrostone-toolchain/bin/arm-buildroot-linux-musleabihf-gcc
CXX = /opt/retrostone-toolchain/bin/arm-buildroot-linux-musleabihf-g++
#### Configuration
# Possible values : retrostone, rs97, rs90
PORT = retrostone
# Possible values : alsa, oss, portaudio
SOUND_ENGINE = alsa
# Possible values : generic, rs90
MENU = generic
# Possible values : 0, YES, APPLY
PROFILE = 0
#### End of Configuration
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
INCLUDES = -Imednafen/include -I./ -I./mednafen -I./mednafen/hw_cpu/z80-fuse -I./mednafen/ngp -I./mednafen/ngp/TLCS-900h -I./mednafen/sound
INCLUDES += -Ishell/headers -Ishell/video/$(PORT) -Ishell/audio -Ishell/scalers -Ishell/input/sdl -Ishell/fonts -Ishell/menu/$(MENU)
DEFINES = -DLSB_FIRST -DWANT_16BPP -DFRONTEND_SUPPORTS_RGB565 -DINLINE="inline" -DWANT_STEREO_SOUND
DEFINES += -DSIZEOF_DOUBLE=8 $(WARNINGS) -DMEDNAFEN_VERSION=\"0.9.31\" -DPACKAGE=\"mednafen\" -DMEDNAFEN_VERSION_NUMERIC=931 -DPSS_STYLE=1 -DMPC_FIXED_POINT -DSTDC_HEADERS -D__STDC_LIMIT_MACROS -D_LOW_ACCURACY_
DEFINES += -DGIT_VERSION=\"$(GIT_VERSION)\" -DNOAVERAGING -DNDEBUG -DRETROSTONE
CFLAGS = -Ofast -fdata-sections -ffunction-sections -ftree-vectorize -funroll-loops -fsingle-precision-constant -fno-common -fno-PIC -flto
CFLAGS += $(INCLUDES) $(DEFINES)
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate=/home/useless/profile
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use
endif
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
LDFLAGS = -lc -lgcc -lSDL -no-pie -Wl,--as-needed -Wl,--gc-sections -flto -s
ifeq ($(PROFILE), YES)
LDFLAGS += -lgcov
endif
ifeq ($(SOUND_ENGINE), alsa)
LDFLAGS += -lasound
endif
ifeq ($(SOUND_ENGINE), portaudio)
LDFLAGS += -lportaudio
endif
# Files to be compiled
SRCDIR = ./mednafen ./mednafen/hw_cpu/z80-fuse ./mednafen/ngp ./mednafen/ngp/TLCS-900h ./mednafen/sound
SRCDIR += ./shell/input/sdl ./shell/audio/$(SOUND_ENGINE) ./shell/emu ./shell/scalers ./shell/video/$(PORT) ./shell/menu/$(MENU) ./shell/fonts
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)
$(CC) $(CFLAGS) -std=gnu99 -o $(PRGNAME) $^ $(LDFLAGS)
$(OBJ_CPP) : %.o : %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME)$(EXESUFFIX) *.o *.gcda