This repository has been archived by the owner on Oct 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.n900
161 lines (133 loc) · 4.27 KB
/
Makefile.n900
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
161
TARGET = pcsx4all
PORT = sdl
# Using 'gpulib' adapted from PCSX Rearmed is default, specify
# USE_GPULIB=0 as param to 'make' when building to disable it.
USE_GPULIB ?= 1
#GPU = gpu_dfxvideo
#GPU = gpu_drhell
#GPU = gpu_null
GPU = gpu_unai
SPU = spu_pcsxrearmed
RM = rm -f
MD = mkdir
CC = gcc
CXX = g++
LD = g++
SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LIBS := $(shell sdl-config --libs)
CFLAGS = -ggdb3 -march=native -DGCW_ZERO \
-Isrc -Isrc/spu/$(SPU) -D$(SPU) -Isrc/gpu/$(GPU) \
-Isrc/port/$(PORT) \
-Isrc/plugin_lib \
-DXA_HACK \
-DINLINE="static __inline__" -Dasm="__asm__ __volatile__" \
$(SDL_CFLAGS)
# Convert plugin names to uppercase and make them CFLAG defines
CFLAGS += -D$(shell echo $(GPU) | tr a-z A-Z)
CFLAGS += -D$(shell echo $(SPU) | tr a-z A-Z)
LDFLAGS = $(SDL_LIBS) -lSDL_mixer -lSDL_image -lpthread -lz
OBJDIRS = \
obj obj/gpu obj/gpu/$(GPU) obj/spu obj/spu/$(SPU) \
obj/port obj/port/$(PORT) \
obj/plugin_lib
all: maketree $(TARGET)
OBJS = \
obj/r3000a.o obj/misc.o obj/plugins.o obj/psxmem.o obj/psxhw.o \
obj/psxcounters.o obj/psxdma.o obj/psxbios.o obj/psxhle.o obj/psxevents.o \
obj/psxcommon.o \
obj/plugin_lib/plugin_lib.o obj/plugin_lib/pl_sshot.o \
obj/psxinterpreter.o \
obj/mdec.o obj/decode_xa.o \
obj/cdriso.o obj/cdrom.o obj/ppf.o \
obj/sio.o obj/pad.o
######################################################################
# GPULIB from PCSX Rearmed:
# Fixes many game incompatibilities and centralizes/improves many
# things that once were the responsibility of individual GPU plugins.
# NOTE: For now, only GPU Unai has been adapted.
ifeq ($(USE_GPULIB),1)
CFLAGS += -DUSE_GPULIB
OBJDIRS += obj/gpu/gpulib
OBJS += obj/gpu/$(GPU)/gpulib_if.o
OBJS += obj/gpu/gpulib/gpu.o obj/gpu/gpulib/vout_port.o
else
OBJS += obj/gpu/$(GPU)/gpu.o
endif
######################################################################
OBJS += obj/gte.o
OBJS += obj/spu/$(SPU)/spu.o
OBJS += obj/port/$(PORT)/port.o
OBJS += obj/port/$(PORT)/frontend.o
OBJS += obj/plugin_lib/perfmon.o
#******************************************
# spu_pcsxrearmed section BEGIN
#******************************************
ifeq ($(SPU),spu_pcsxrearmed)
# Specify which audio backend to use:
SOUND_DRIVERS=sdl
#SOUND_DRIVERS=alsa
#SOUND_DRIVERS=oss
#SOUND_DRIVERS=pulseaudio
# Note: obj/spu/spu_pcsxrearmed/spu.o will already have been added to OBJS
# list previously in Makefile
OBJS += obj/spu/spu_pcsxrearmed/dma.o obj/spu/spu_pcsxrearmed/freeze.o \
obj/spu/spu_pcsxrearmed/out.o obj/spu/spu_pcsxrearmed/nullsnd.o \
obj/spu/spu_pcsxrearmed/registers.o obj/spu/spu_pcsxrearmed/arm_utils.o \
obj/gpu/gpu_unai/gpu_arm.o
ifeq "$(HAVE_C64_TOOLS)" "1"
obj/spu/spu_pcsxrearmed/spu.o: CFLAGS += -DC64X_DSP
obj/spu/spu_pcsxrearmed/spu.o: obj/spu/spu_pcsxrearmed/spu_c64x.c
frontend/menu.o: CFLAGS += -DC64X_DSP
endif
ifneq ($(findstring oss,$(SOUND_DRIVERS)),)
obj/spu/spu_pcsxrearmed/out.o: CFLAGS += -DHAVE_OSS
OBJS += obj/spu/spu_pcsxrearmed/oss.o
endif
ifneq ($(findstring alsa,$(SOUND_DRIVERS)),)
obj/spu/spu_pcsxrearmed/out.o: CFLAGS += -DHAVE_ALSA
OBJS += obj/spu/spu_pcsxrearmed/alsa.o
LDFLAGS += -lasound
endif
ifneq ($(findstring sdl,$(SOUND_DRIVERS)),)
obj/spu/spu_pcsxrearmed/out.o: CFLAGS += -DHAVE_SDL
OBJS += obj/spu/spu_pcsxrearmed/sdl.o
endif
ifneq ($(findstring pulseaudio,$(SOUND_DRIVERS)),)
obj/spu/spu_pcsxrearmed/out.o: CFLAGS += -DHAVE_PULSE
OBJS += obj/spu/spu_pcsxrearmed/pulseaudio.o
endif
ifneq ($(findstring libretro,$(SOUND_DRIVERS)),)
obj/spu/spu_pcsxrearmed/out.o: CFLAGS += -DHAVE_LIBRETRO
endif
endif
#******************************************
# spu_pcsxrearmed END
#******************************************
CXXFLAGS := $(CFLAGS) -fno-rtti
#If V=1 was passed to 'make', do not hide commands:
ifdef V
HIDECMD:=
else
HIDECMD:=@
endif
$(TARGET): $(OBJS)
@echo Linking $(TARGET)...
$(HIDECMD)$(LD) $(OBJS) $(LDFLAGS) -o $@
obj/%.o: src/%.c
@echo Compiling $<...
$(HIDECMD)$(CC) $(CFLAGS) -c $< -o $@
obj/%.o: src/%.cpp
@echo Compiling $<...
$(HIDECMD)$(CXX) $(CXXFLAGS) -c $< -o $@
obj/%.o: src/%.s
@echo Compiling $<...
$(HIDECMD)$(CXX) $(CFLAGS) -c $< -o $@
obj/%.o: src/%.S
@echo Compiling $<...
$(HIDECMD)$(CXX) $(CFLAGS) -c $< -o $@
$(sort $(OBJDIRS)):
$(HIDECMD)$(MD) $@
maketree: $(sort $(OBJDIRS))
clean:
$(RM) -r obj
$(RM) $(TARGET)