2 AS = $(CROSS_COMPILE)as
3 CC = $(CROSS_COMPILE)gcc
4 LD = $(CROSS_COMPILE)ld
15 -include Makefile.local
17 ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
19 CFLAGS += -Wall -ggdb -Ifrontend -ffast-math
20 LDFLAGS += -lz -lpthread -ldl -lpng
22 CFLAGS += -O2 -DNDEBUG
24 CFLAGS += $(EXTRA_CFLAGS)
27 ifeq "$(ARM_CORTEXA8)" "1"
28 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
29 ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
32 CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
33 ASFLAGS += -mcpu=arm926ej-s
37 # detect armv7 and NEON from the specified CPU
38 HAVE_NEON = $(shell $(CC) -E -dD $(CFLAGS) frontend/config.h | grep -q '__ARM_NEON__ 1' && echo 1)
39 HAVE_ARMV7 = $(shell $(CC) -E -dD $(CFLAGS) frontend/config.h | grep -q '__ARM_ARCH_7A__ 1' && echo 1)
44 OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
45 libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/mdec.o \
46 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
47 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
48 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
49 libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
50 OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o
52 OBJS += libpcsxcore/gte_arm.o
54 ifeq "$(HAVE_NEON)" "1"
55 OBJS += libpcsxcore/gte_neon.o
57 libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign
58 libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
62 OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
63 OBJS += libpcsxcore/new_dynarec/pcsxmem.o
65 OBJS += libpcsxcore/new_dynarec/emu_if.o
66 libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
67 libpcsxcore/new_dynarec/pcsxmem_inline.c
68 libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -Wno-all -Wno-pointer-sign
70 libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
75 OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
76 plugins/dfsound/registers.o plugins/dfsound/spu.o
77 plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
79 ifeq "$(HAVE_NEON)" "1"
80 OBJS += plugins/dfsound/arm_utils.o
83 plugins/dfsound/%.o: CFLAGS += -DUSEOSS
84 OBJS += plugins/dfsound/oss.o
86 ifeq "$(USE_ALSA)" "1"
87 plugins/dfsound/%.o: CFLAGS += -DUSEALSA
88 OBJS += plugins/dfsound/alsa.o
93 # note: code is not safe for strict-aliasing? (Castlevania problems)
94 plugins/dfxvideo/%.o: CFLAGS += -fno-strict-aliasing
95 OBJS += plugins/dfxvideo/gpu.o
96 plugins/dfxvideo/gpu.o: plugins/dfxvideo/fps.c plugins/dfxvideo/prim.c \
97 plugins/dfxvideo/gpu.c plugins/dfxvideo/soft.c
100 OBJS += plugins/dfxvideo/draw.o
102 OBJS += plugins/dfxvideo/draw_fb.o
106 OBJS += plugins/cdrcimg/cdrcimg.o
109 OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
112 OBJS += frontend/main.o frontend/plugin.o
113 OBJS += frontend/plugin_lib.o frontend/common/readpng.o
114 OBJS += frontend/common/fonts.o frontend/linux/plat.o
115 ifeq "$(USE_GTK)" "1"
116 OBJS += maemo/hildon.o maemo/main.o
119 OBJS += frontend/menu.o frontend/linux/in_evdev.o
120 OBJS += frontend/common/input.o frontend/linux/oshide.o
122 ifeq "$(PLATFORM)" "pandora"
123 frontend/%.o: CFLAGS += -DVOUT_FBDEV
124 OBJS += frontend/linux/fbdev.o
125 OBJS += frontend/plat_omap.o
126 OBJS += frontend/plat_pandora.o
128 ifeq "$(PLATFORM)" "caanoo"
129 OBJS += frontend/plat_pollux.o
130 OBJS += frontend/warm/warm.o
132 OBJS += frontend/plat_dummy.o
138 ifeq "$(HAVE_NEON)" "1"
139 OBJS += frontend/cspace_neon.o
141 OBJS += frontend/cspace.o
144 frontend/%.o: CFLAGS += -DX11
145 OBJS += frontend/xkb.o
151 frontend/%.o: CFLAGS += -DHAVE_TSLIB
152 OBJS += frontend/pl_gun_ts.o
154 %.o: ASFLAGS += --defsym HAVE_ARMV7=$(HAVE_ARMV7)
155 frontend/%.o: CFLAGS += -DIN_EVDEV
156 frontend/menu.o: frontend/revision.h
158 libpcsxcore/gte_nf.o: libpcsxcore/gte.c
159 $(CC) -c -o $@ $^ $(CFLAGS) -DFLAGLESS
161 frontend/revision.h: FORCE
162 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
163 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
169 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
171 PLUGINS ?= plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
172 plugins/gpu-gles/gpuGLES.so plugins/gpu_neon/gpu_neon.so
178 $(RM) $(TARGET) $(OBJS) $(TARGET).map
181 for dir in $(PLUGINS) ; do \
182 $(MAKE) -C $$(dirname $$dir) clean; done
184 # ----------- release -----------
186 PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
188 VER ?= $(shell git describe master)
190 rel: pcsx $(PLUGINS) \
191 pandora/pcsx.sh pandora/pcsx.pxml.templ pandora/pcsx.png \
192 pandora/picorestore pandora/readme.txt pandora/skin COPYING
196 sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml
197 rm out/pcsx.pxml.templ
198 mv out/*.so out/plugins/
199 mv out/plugins/gpu_neon.so out/plugins/gpuPEOPS2.so
200 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i pandora/pcsx.png -c