-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (47 loc) · 1.93 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
PRGNAME = vb.elf
CC = gcc
CXX = g++
#### Configuration
# Possible values : retrostone, rs97, rs90
PORT = sdl
# Possible values : alsa, oss, portaudio
SOUND_ENGINE = sdl
#### 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
DEFINES = -DLSB_FIRST -DINLINE="inline" -DINLINE="inline" -DNDEBUG -DWANT_STEREO_SOUND
DEFINES += -DMEDNAFEN_VERSION_NUMERIC=931
DEFINES += -DWANT_8BPP -DFRONTEND_SUPPORTS_RGB565
CFLAGS = -O0 -g3 -fno-common -Wall -Wextra -Wunused-value $(INCLUDES) $(DEFINES)
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
LDFLAGS = -nodefaultlibs -lc -lgcc -lm -lSDL -lz
ifeq ($(SOUND_ENGINE), alsa)
LDFLAGS += -lasound
endif
ifeq ($(SOUND_ENGINE), portaudio)
LDFLAGS += -lasound -lportaudio
endif
ifeq ($(SOUND_ENGINE), pulse)
LDFLAGS += -lpulse-simple -lportaudio
endif
# Files to be compiled
SRCDIR = ./src ./shell ./shell/scalers ./shell/emu ./shell/menu
SRCDIR += ./shell/input/sdl/ ./shell/video/$(PORT) ./shell/audio/$(SOUND_ENGINE)
SRCDIR += ./mednafen ./mednafen/vb ./mednafen/sound ./mednafen/hw_cpu/v810 ./mednafen/hw_cpu/v810/fpu-new
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 $@ $<
$(OBJ_C) : %.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME)$(EXESUFFIX) *.o