2 AS = $(CROSS_COMPILE)as
3 CC = $(CROSS_COMPILE)gcc
4 LD = $(CROSS_COMPILE)ld
14 -include Makefile.local
16 ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
18 CFLAGS += -Wall -ggdb -Ifrontend -ffast-math
19 LDFLAGS += -lz -lpthread -ldl -lpng
21 CFLAGS += -O2 -DNDEBUG
23 CFLAGS += $(EXTRA_CFLAGS)
26 ifeq "$(ARM_CORTEXA8)" "1"
27 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
28 ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
31 CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
32 ASFLAGS += -mcpu=arm926ej-s
36 # detect armv7 and NEON from the specified CPU
37 HAVE_NEON = $(shell $(CC) -E -dD $(CFLAGS) frontend/config.h | grep -q '__ARM_NEON__ 1' && echo 1)
38 HAVE_ARMV7 = $(shell $(CC) -E -dD $(CFLAGS) frontend/config.h | grep -q '__ARM_ARCH_7A__ 1' && echo 1)
43 OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
44 libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/gte.o libpcsxcore/mdec.o \
45 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
46 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
47 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
48 libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
49 ifeq "$(HAVE_NEON)" "1"
50 OBJS += libpcsxcore/gte_neon.o
52 libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign
53 libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
57 libpcsxcore/new_dynarec/linkage_arm.o: ASFLAGS += --defsym HAVE_ARMV7=$(HAVE_ARMV7)
58 OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
59 OBJS += libpcsxcore/new_dynarec/pcsxmem.o
61 OBJS += libpcsxcore/new_dynarec/emu_if.o
62 libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
63 libpcsxcore/new_dynarec/pcsxmem_inline.c
64 libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -Wno-all -Wno-pointer-sign
66 libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
71 OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
72 plugins/dfsound/registers.o plugins/dfsound/spu.o
73 plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
75 ifeq "$(HAVE_NEON)" "1"
76 OBJS += plugins/dfsound/arm_utils.o
79 plugins/dfsound/%.o: CFLAGS += -DUSEOSS
80 OBJS += plugins/dfsound/oss.o
82 ifeq "$(USE_ALSA)" "1"
83 plugins/dfsound/%.o: CFLAGS += -DUSEALSA
84 OBJS += plugins/dfsound/alsa.o
89 # note: code is not safe for strict-aliasing? (Castlevania problems)
90 plugins/dfxvideo/%.o: CFLAGS += -fno-strict-aliasing
91 OBJS += plugins/dfxvideo/gpu.o
92 plugins/dfxvideo/gpu.o: plugins/dfxvideo/fps.c plugins/dfxvideo/prim.c \
93 plugins/dfxvideo/gpu.c plugins/dfxvideo/soft.c
96 OBJS += plugins/dfxvideo/draw.o
98 OBJS += plugins/dfxvideo/draw_fb.o
102 OBJS += plugins/cdrcimg/cdrcimg.o
105 OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
108 OBJS += frontend/main.o frontend/plugin.o
109 OBJS += frontend/plugin_lib.o frontend/common/readpng.o
110 OBJS += frontend/common/fonts.o frontend/linux/plat.o
111 ifeq "$(USE_GTK)" "1"
112 OBJS += maemo/hildon.o maemo/main.o
115 frontend/%.o: CFLAGS += -DVOUT_FBDEV
116 OBJS += frontend/menu.o
117 OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
118 OBJS += frontend/common/input.o frontend/linux/oshide.o
120 OBJS += frontend/plat_omap.o
121 OBJS += frontend/pandora.o
123 OBJS += frontend/plat_dummy.o
127 ifeq "$(HAVE_NEON)" "1"
128 OBJS += frontend/cspace_neon.o
130 OBJS += frontend/cspace.o
133 frontend/%.o: CFLAGS += -DX11
134 OBJS += frontend/xkb.o
140 frontend/%.o: CFLAGS += -DHAVE_TSLIB
141 OBJS += frontend/pl_gun_ts.o
143 frontend/%.o: CFLAGS += -DIN_EVDEV
144 frontend/menu.o: frontend/revision.h
146 frontend/revision.h: FORCE
147 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
148 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
154 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
156 PLUGINS ?= plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
157 plugins/gpu-gles/gpuGLES.so plugins/gpu_neon/gpu_neon.so
163 $(RM) $(TARGET) $(OBJS) $(TARGET).map
166 for dir in $(PLUGINS) ; do \
167 $(MAKE) -C $$(dirname $$dir) clean; done
169 # ----------- release -----------
171 PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
173 VER ?= $(shell git describe master)
175 rel: pcsx $(PLUGINS) \
176 pandora/pcsx.sh pandora/pcsx.pxml.templ pandora/pcsx.png \
177 pandora/picorestore pandora/readme.txt pandora/skin COPYING
181 sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml
182 rm out/pcsx.pxml.templ
183 mv out/*.so out/plugins/
184 mv out/plugins/gpu_neon.so out/plugins/gpuPEOPS2.so
185 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i pandora/pcsx.png -c