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.gcw0
69 lines (54 loc) · 2.57 KB
/
Makefile.gcw0
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
PRGNAME = ngpcemu
CC = /opt/gcw0-toolchain-static/bin/mipsel-linux-gcc
CXX = /opt/gcw0-toolchain-static/bin/mipsel-linux-g++
#### Configuration
# Possible values : retrostone, rs97, rs90
PORT = gcw0
# Possible values : alsa, oss, portaudio
SOUND_ENGINE = sdl
# 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 -DGCW0 -DIPU_SCALE
#-fdata-sections -ffunction-sections
CFLAGS = -Ofast -funroll-loops -mno-fp-exceptions -mno-check-zero-division -mframe-header-opt -fsingle-precision-constant -fno-common -mips32r2 -fno-PIC -mno-abicalls -flto
CFLAGS += $(INCLUDES) $(DEFINES)
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate=/media/data/local/home/
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use
endif
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++03
LDFLAGS =-nodefaultlibs -lc -lgcc -lSDL -lasound -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