1 # Makefile for PCSX ReARMed
3 # default stuff goes here, so that config can override
5 CFLAGS += -Wall -ggdb -Ifrontend -ffast-math
6 LDLIBS += -lpthread -ldl -lpng -lz -lm
14 all: config.mak target_ plugins_
16 ifneq ($(wildcard config.mak),)
17 config.mak: ./configure
18 @echo $@ is out-of-date, running configure
19 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
23 @echo "Please run ./configure before running make!"
26 -include Makefile.local
31 OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
32 libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/mdec.o \
33 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
34 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
35 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
36 libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
37 OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o
39 OBJS += libpcsxcore/gte_arm.o
41 ifeq "$(HAVE_NEON)" "1"
42 OBJS += libpcsxcore/gte_neon.o
44 libpcsxcore/gte.o libpcsxcore/gte_nf.o: CFLAGS += -fno-strict-aliasing
45 libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign
46 libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
49 ifeq "$(USE_DYNAREC)" "1"
50 OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
51 OBJS += libpcsxcore/new_dynarec/pcsxmem.o
53 OBJS += libpcsxcore/new_dynarec/emu_if.o
54 libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
55 libpcsxcore/new_dynarec/pcsxmem_inline.c
56 libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -Wno-all -Wno-pointer-sign
58 libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
61 ifeq "$(DRC_CACHE_BASE)" "1"
62 libpcsxcore/new_dynarec/%.o: CFLAGS += -DBASE_ADDR_FIXED=1
66 OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
67 plugins/dfsound/registers.o plugins/dfsound/spu.o
68 plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
71 OBJS += plugins/dfsound/arm_utils.o
73 ifeq "$(SOUND_DRIVER)" "oss"
74 plugins/dfsound/%.o: CFLAGS += -DUSEOSS
75 OBJS += plugins/dfsound/oss.o
77 ifeq "$(SOUND_DRIVER)" "alsa"
78 plugins/dfsound/%.o: CFLAGS += -DUSEALSA
79 OBJS += plugins/dfsound/alsa.o
82 ifeq "$(SOUND_DRIVER)" "sdl"
83 OBJS += plugins/dfsound/sdl.o
85 ifeq "$(SOUND_DRIVER)" "none"
86 OBJS += plugins/dfsound/nullsnd.o
90 OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o
91 ifeq "$(HAVE_NEON)" "1"
92 OBJS += plugins/gpulib/cspace_neon.o
94 OBJS += plugins/gpulib/cspace.o
96 ifeq "$(BUILTIN_GPU)" "neon"
97 OBJS += plugins/gpu_neon/psx_gpu_if.o plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o
98 plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
99 plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c
101 ifeq "$(BUILTIN_GPU)" "peops"
102 # note: code is not safe for strict-aliasing? (Castlevania problems)
103 plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing
104 plugins/dfxvideo/gpulib_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c
105 OBJS += plugins/dfxvideo/gpulib_if.o
107 ifeq "$(BUILTIN_GPU)" "unai"
108 OBJS += plugins/gpulib/cspace.o
109 OBJS += plugins/gpu_unai/gpulib_if.o
111 OBJS += plugins/gpu_unai/gpu_arm.o
113 plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED
118 OBJS += plugins/cdrcimg/cdrcimg.o
121 OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
124 OBJS += frontend/main.o frontend/plugin.o
125 OBJS += frontend/common/readpng.o frontend/common/fonts.o
126 OBJS += frontend/linux/plat.o
128 ifeq "$(PLATFORM)" "generic"
129 OBJS += frontend/plat_sdl.o frontend/common/in_sdl.o
132 ifeq "$(PLATFORM)" "pandora"
133 OBJS += frontend/linux/fbdev.o
134 OBJS += frontend/plat_omap.o frontend/linux/xenv.o
135 OBJS += frontend/plat_pandora.o
138 ifeq "$(PLATFORM)" "caanoo"
139 OBJS += frontend/plat_pollux.o frontend/in_tsbutton.o frontend/blit320.o
140 OBJS += frontend/gp2x/in_gp2x.o frontend/warm/warm.o
143 ifeq "$(PLATFORM)" "maemo"
144 OBJS += maemo/hildon.o maemo/main.o
146 OBJS += frontend/plugin_lib.o
148 ifeq "$(PLATFORM)" "libretro"
149 OBJS += frontend/libretro.o
151 ifeq "$(USE_FRONTEND)" "1"
152 OBJS += frontend/menu.o frontend/linux/in_evdev.o
153 OBJS += frontend/common/input.o
154 OBJS += frontend/plugin_lib.o
155 ifeq "$(HAVE_TSLIB)" "1"
156 frontend/%.o: CFLAGS += -DHAVE_TSLIB
157 OBJS += frontend/pl_gun_ts.o
160 CFLAGS += -DNO_FRONTEND
164 frontend/%.o: CFLAGS += -DX11
165 OBJS += frontend/xkb.o
170 frontend/%.o: CFLAGS += -DIN_EVDEV
171 frontend/menu.o frontend/main.o frontend/plat_sdl.o: frontend/revision.h
173 libpcsxcore/gte_nf.o: libpcsxcore/gte.c
174 $(CC) -c -o $@ $^ $(CFLAGS) -DFLAGLESS
176 frontend/revision.h: FORCE
177 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
178 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
183 $(CC) $(CFLAGS) -c $^ -o $@
188 $(CC_LINK) -o $@ $^ $(LDFLAGS) $(LDLIBS) -Wl,-Map=$@.map
190 clean: $(PLAT_CLEAN) clean_plugins
191 $(RM) $(TARGET) $(OBJS) $(TARGET).map
200 make -C plugins/gpulib/ clean
201 for dir in $(PLUGINS) ; do \
202 $(MAKE) -C $$(dirname $$dir) clean; done
208 # ----------- release -----------
210 VER ?= $(shell git describe master)
212 ifeq "$(PLATFORM)" "generic"
213 OUT = pcsx_rearmed_$(VER)
215 rel: pcsx $(PLUGINS) \
216 frontend/pandora/skin readme.txt COPYING
218 mkdir -p $(OUT)/plugins
221 mv $(OUT)/*.so* $(OUT)/plugins/
222 zip -9 -r $(OUT).zip $(OUT)
225 ifeq "$(PLATFORM)" "pandora"
226 PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
228 rel: pcsx $(PLUGINS) \
229 frontend/pandora/pcsx.sh frontend/pandora/pcsx.pxml.templ frontend/pandora/pcsx.png \
230 frontend/pandora/picorestore frontend/pandora/skin readme.txt COPYING
234 sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml
235 rm out/pcsx.pxml.templ
236 mv out/*.so out/plugins/
237 mv out/plugins/gpu_unai.so out/plugins/gpuPCSX4ALL.so
238 mv out/plugins/gpu_gles.so out/plugins/gpuGLES.so
239 mv out/plugins/gpu_peops.so out/plugins/gpuPEOPS.so
240 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i frontend/pandora/pcsx.png -c
243 ifeq "$(PLATFORM)" "caanoo"
244 PLAT_CLEAN = caanoo_clean
247 $(RM) frontend/320240/pollux_set
249 rel: pcsx $(PLUGINS) \
250 frontend/320240/caanoo.gpe frontend/320240/pcsx26.png \
251 frontend/320240/pcsxb.png frontend/320240/skin \
252 frontend/warm/bin/warm_2.6.24.ko frontend/320240/pollux_set \
253 frontend/320240/pcsx_rearmed.ini frontend/320240/haptic_w.cfg \
254 frontend/320240/haptic_s.cfg \
257 mkdir -p out/pcsx_rearmed/plugins
258 cp -r $^ out/pcsx_rearmed/
259 mv out/pcsx_rearmed/gpu_unai.so out/pcsx_rearmed/gpuPCSX4ALL.so
260 mv out/pcsx_rearmed/gpu_gles.so out/pcsx_rearmed/gpuGLES.so
261 mv out/pcsx_rearmed/*.so out/pcsx_rearmed/plugins/
262 mv out/pcsx_rearmed/caanoo.gpe out/pcsx_rearmed/pcsx.gpe
263 mv out/pcsx_rearmed/pcsx_rearmed.ini out/
264 mkdir out/pcsx_rearmed/lib/
265 cp ./lib/libbz2.so.1 out/pcsx_rearmed/lib/
266 mkdir out/pcsx_rearmed/bios/
267 cd out && zip -9 -r ../pcsx_rearmed_$(VER)_caanoo.zip *