spu: use last written loop value when starting
[pcsx_rearmed.git] / Makefile
CommitLineData
b60f2812 1#CROSS_COMPILE=
f95a77f7 2AS = $(CROSS_COMPILE)as
80c2304e 3CC = $(CROSS_COMPILE)gcc
4LD = $(CROSS_COMPILE)ld
5
c5061935 6ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
7
ab948f7e 8CFLAGS += -Wall -ggdb -Ifrontend
33716956 9LDFLAGS += -lz -lpthread -ldl -lpng -lbz2
c5061935 10ifeq "$(ARCH)" "arm"
f95a77f7 11CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp -ffast-math
a327967e 12ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
f95a77f7 13endif
14ifndef DEBUG
cfbd3c6e 15CFLAGS += -O2 -DNDEBUG
b60f2812 16endif
e0c692d9 17CFLAGS += $(EXTRA_CFLAGS)
18
19USE_OSS ?= 1
de38f20e 20#USE_ALSA = 1
3eb78778 21#DRC_DBG = 1
fa9cfe0a 22#PCNT = 1
80c2304e 23TARGET = pcsx
24
de38f20e 25-include Makefile.local
26
80c2304e 27all: $(TARGET)
28
29# core
30OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
31 libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/gte.o libpcsxcore/mdec.o \
32 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
33 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
34 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
35 libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
8cfbda97 36ifeq "$(ARCH)" "arm"
37OBJS += libpcsxcore/gte_neon.o
38endif
ab948f7e 39libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign
40libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
41
f95a77f7 42# dynarec
7139f3c8 43ifndef NO_NEW_DRC
44OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
7e605697 45OBJS += libpcsxcore/new_dynarec/pcsxmem.o
7139f3c8 46endif
47OBJS += libpcsxcore/new_dynarec/emu_if.o
cbbab9cd 48libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
49 libpcsxcore/new_dynarec/pcsxmem_inline.c
ab948f7e 50libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -Wno-all -Wno-pointer-sign
3eb78778 51ifdef DRC_DBG
52libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
53CFLAGS += -DDRC_DBG
54endif
f95a77f7 55
e906c010 56# spu
ee849648 57OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
58 plugins/dfsound/registers.o plugins/dfsound/spu.o
6d866bb7 59plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
60 plugins/dfsound/xa.c
b17618c0 61ifeq "$(ARCH)" "arm"
62OBJS += plugins/dfsound/arm_utils.o
63endif
de38f20e 64ifeq "$(USE_OSS)" "1"
65plugins/dfsound/%.o: CFLAGS += -DUSEOSS
66OBJS += plugins/dfsound/oss.o
67endif
68ifeq "$(USE_ALSA)" "1"
69plugins/dfsound/%.o: CFLAGS += -DUSEALSA
70OBJS += plugins/dfsound/alsa.o
71LDFLAGS += -lasound
72endif
73
e906c010 74# gpu
2ef486ee 75# note: code is not safe for strict-aliasing? (Castlevania problems)
ab948f7e 76plugins/dfxvideo/%.o: CFLAGS += -fno-strict-aliasing
a96a5eb2 77OBJS += plugins/dfxvideo/gpu.o
6d866bb7 78plugins/dfxvideo/gpu.o: plugins/dfxvideo/fps.c plugins/dfxvideo/prim.c \
79 plugins/dfxvideo/gpu.c plugins/dfxvideo/soft.c
b60f2812 80ifdef X11
81LDFLAGS += -lX11 -lXv
82OBJS += plugins/dfxvideo/draw.o
83else
b60f2812 84OBJS += plugins/dfxvideo/draw_fb.o
85endif
e0c692d9 86
47bf65ab 87# cdrcimg
47bf65ab 88OBJS += plugins/cdrcimg/cdrcimg.o
e906c010 89
384f5f43 90# dfinput
4c08b9e7 91OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
384f5f43 92
80c2304e 93# gui
29a8c4f3 94OBJS += frontend/main.o frontend/plugin.o
76f7048e 95OBJS += frontend/plugin_lib.o frontend/common/readpng.o
96OBJS += frontend/common/fonts.o frontend/linux/plat.o
e0c692d9 97ifeq "$(USE_GTK)" "1"
98OBJS += maemo/hildon.o maemo/main.o
99maemo/%.o: maemo/%.c
100else
76f7048e 101frontend/%.o: CFLAGS += -DVOUT_FBDEV
102OBJS += frontend/menu.o
69af03a2 103OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
76f7048e 104OBJS += frontend/common/input.o frontend/linux/oshide.o
c5061935 105ifeq "$(ARCH)" "arm"
ccf51908 106OBJS += frontend/plat_omap.o
799b0b87 107OBJS += frontend/pandora.o
ccf51908 108else
109OBJS += frontend/plat_dummy.o
a327967e 110endif
e0c692d9 111endif # !USE_GTK
112ifeq "$(ARCH)" "arm"
113OBJS += frontend/arm_utils.o
114endif
447783f8 115ifdef X11
116frontend/%.o: CFLAGS += -DX11
117OBJS += frontend/xkb.o
118endif
72228559 119ifdef PCNT
120CFLAGS += -DPCNT
121endif
4c08b9e7 122ifndef NO_TSLIB
123frontend/%.o: CFLAGS += -DHAVE_TSLIB
124OBJS += frontend/pl_gun_ts.o
125endif
ab948f7e 126frontend/%.o: CFLAGS += -DIN_EVDEV
3c70c47b 127frontend/menu.o: frontend/revision.h
128
129frontend/revision.h: FORCE
130 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
131 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
132 @rm $@_
133.PHONY: FORCE
134
80c2304e 135
136$(TARGET): $(OBJS)
f95a77f7 137 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
80c2304e 138
ee78346e 139PLUGINS = plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
7ca0ce80 140 plugins/gpu-gles/gpuGLES.so plugins/gpu_neon/gpu_neon.so
0d464c77 141
ee78346e 142$(PLUGINS):
143 make -C $(dir $@)
f932e54b 144
80c2304e 145clean:
ee78346e 146 $(RM) $(TARGET) $(OBJS) $(TARGET).map
147
148clean_plugins:
149 for dir in $(PLUGINS) ; do \
150 $(MAKE) -C $$(dirname $$dir) clean; done
80c2304e 151
303ee308 152# ----------- release -----------
153
154PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
155
45d45c1e 156VER ?= $(shell git describe master)
303ee308 157
ee78346e 158rel: pcsx $(PLUGINS) \
3938f69a 159 pandora/pcsx.sh pandora/pcsx.pxml.templ pandora/pcsx.png \
e3d0da26 160 pandora/picorestore pandora/readme.txt pandora/skin COPYING
303ee308 161 rm -rf out
bbd837c6 162 mkdir -p out/plugins
303ee308 163 cp -r $^ out/
3938f69a 164 sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml
165 rm out/pcsx.pxml.templ
bbd837c6 166 mv out/*.so out/plugins/
7ca0ce80 167 mv out/plugins/gpu_neon.so out/plugins/gpuPEOPS2.so
3938f69a 168 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i pandora/pcsx.png -c