frontend: use pld in blitters
[pcsx_rearmed.git] / Makefile
... / ...
CommitLineData
1#CROSS_COMPILE=
2AS = $(CROSS_COMPILE)as
3GCC = $(CROSS_COMPILE)gcc
4CC = $(CROSS_COMPILE)gcc
5LD = $(CROSS_COMPILE)ld
6ifdef CC_OVERRIDE
7CC = $(CC_OVERRIDE)
8endif
9
10ARM926 ?= 0
11ARM_CORTEXA8 ?= 1
12PLATFORM ?= pandora
13USE_OSS ?= 1
14#USE_ALSA = 1
15#DRC_DBG = 1
16#PCNT = 1
17TARGET = pcsx
18
19-include Makefile.local
20
21ARCH = $(shell $(GCC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
22
23CFLAGS += -Wall -ggdb -Ifrontend -ffast-math
24LDFLAGS += -lpthread -ldl -lpng -lz -lm
25ifndef DEBUG
26CFLAGS += -O2 -DNDEBUG
27endif
28CFLAGS += $(EXTRA_CFLAGS)
29
30ifeq "$(ARCH)" "arm"
31ifeq "$(ARM_CORTEXA8)" "1"
32GCC_CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
33ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
34endif
35ifeq "$(ARM926)" "1"
36GCC_CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
37ASFLAGS += -mcpu=arm926ej-s -mfloat-abi=softfp
38endif
39endif
40CFLAGS += $(GCC_CFLAGS)
41
42# detect armv7 and NEON from the specified CPU
43HAVE_NEON = $(shell $(GCC) -E -dD $(GCC_CFLAGS) frontend/config.h | grep -q '__ARM_NEON__ 1' && echo 1)
44HAVE_ARMV7 = $(shell $(GCC) -E -dD $(GCC_CFLAGS) frontend/config.h | grep -q '__ARM_ARCH_7A__ 1' && echo 1)
45
46all: $(TARGET)
47
48# core
49OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
50 libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/mdec.o \
51 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
52 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
53 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
54 libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
55OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o
56ifeq "$(ARCH)" "arm"
57OBJS += libpcsxcore/gte_arm.o
58endif
59ifeq "$(HAVE_NEON)" "1"
60OBJS += libpcsxcore/gte_neon.o
61endif
62libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign
63libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
64
65# dynarec
66ifndef NO_NEW_DRC
67OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
68OBJS += libpcsxcore/new_dynarec/pcsxmem.o
69endif
70OBJS += libpcsxcore/new_dynarec/emu_if.o
71libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
72 libpcsxcore/new_dynarec/pcsxmem_inline.c
73libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -Wno-all -Wno-pointer-sign
74ifdef DRC_DBG
75libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
76CFLAGS += -DDRC_DBG
77endif
78
79# spu
80OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
81 plugins/dfsound/registers.o plugins/dfsound/spu.o
82plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
83 plugins/dfsound/xa.c
84ifeq "$(ARCH)" "arm"
85OBJS += plugins/dfsound/arm_utils.o
86endif
87ifeq "$(USE_OSS)" "1"
88plugins/dfsound/%.o: CFLAGS += -DUSEOSS
89OBJS += plugins/dfsound/oss.o
90endif
91ifeq "$(USE_ALSA)" "1"
92plugins/dfsound/%.o: CFLAGS += -DUSEALSA
93OBJS += plugins/dfsound/alsa.o
94LDFLAGS += -lasound
95endif
96
97# gpu
98# note: code is not safe for strict-aliasing? (Castlevania problems)
99plugins/dfxvideo/%.o: CFLAGS += -fno-strict-aliasing
100OBJS += plugins/dfxvideo/gpu.o
101plugins/dfxvideo/gpu.o: plugins/dfxvideo/fps.c plugins/dfxvideo/prim.c \
102 plugins/dfxvideo/gpu.c plugins/dfxvideo/soft.c
103ifdef X11
104LDFLAGS += -lX11 -lXv
105OBJS += plugins/dfxvideo/draw.o
106else
107OBJS += plugins/dfxvideo/draw_fb.o
108endif
109
110# cdrcimg
111OBJS += plugins/cdrcimg/cdrcimg.o
112
113# dfinput
114OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
115
116# gui
117OBJS += frontend/main.o frontend/plugin.o
118OBJS += frontend/plugin_lib.o frontend/common/readpng.o
119OBJS += frontend/common/fonts.o frontend/linux/plat.o
120ifeq "$(USE_GTK)" "1"
121OBJS += maemo/hildon.o maemo/main.o
122maemo/%.o: maemo/%.c
123else
124OBJS += frontend/menu.o frontend/linux/in_evdev.o
125OBJS += frontend/common/input.o frontend/linux/oshide.o
126
127ifeq "$(PLATFORM)" "pandora"
128frontend/%.o: CFLAGS += -DVOUT_FBDEV
129OBJS += frontend/linux/fbdev.o
130OBJS += frontend/plat_omap.o
131OBJS += frontend/plat_pandora.o
132else
133ifeq "$(PLATFORM)" "caanoo"
134OBJS += frontend/plat_pollux.o frontend/in_tsbutton.o frontend/blit320.o
135OBJS += frontend/gp2x/in_gp2x.o frontend/warm/warm.o
136else
137OBJS += frontend/plat_dummy.o
138endif
139endif
140
141endif # !USE_GTK
142
143ifeq "$(HAVE_NEON)" "1"
144OBJS += frontend/cspace_neon.o
145else
146OBJS += frontend/cspace.o
147endif
148ifdef X11
149frontend/%.o: CFLAGS += -DX11
150OBJS += frontend/xkb.o
151endif
152ifdef PCNT
153CFLAGS += -DPCNT
154endif
155ifndef NO_TSLIB
156frontend/%.o: CFLAGS += -DHAVE_TSLIB
157OBJS += frontend/pl_gun_ts.o
158endif
159%.o: ASFLAGS += --defsym HAVE_ARMV7=$(HAVE_ARMV7)
160frontend/%.o: CFLAGS += -DIN_EVDEV
161frontend/menu.o: frontend/revision.h
162
163libpcsxcore/gte_nf.o: libpcsxcore/gte.c
164 $(CC) -c -o $@ $^ $(CFLAGS) -DFLAGLESS
165
166frontend/revision.h: FORCE
167 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
168 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
169 @rm $@_
170.PHONY: FORCE
171
172
173$(TARGET): $(OBJS)
174 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
175
176PLUGINS ?= plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
177 plugins/gpu-gles/gpuGLES.so plugins/gpu_neon/gpu_neon.so
178
179$(PLUGINS):
180 make -C $(dir $@)
181
182clean:
183 $(RM) $(TARGET) $(OBJS) $(TARGET).map
184
185clean_plugins:
186 for dir in $(PLUGINS) ; do \
187 $(MAKE) -C $$(dirname $$dir) clean; done
188
189# ----------- release -----------
190
191PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
192
193VER ?= $(shell git describe master)
194
195rel: pcsx $(PLUGINS) \
196 frontend/pandora/pcsx.sh frontend/pandora/pcsx.pxml.templ frontend/pandora/pcsx.png \
197 frontend/pandora/picorestore frontend/pandora/skin readme.txt COPYING
198 rm -rf out
199 mkdir -p out/plugins
200 cp -r $^ out/
201 sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml
202 rm out/pcsx.pxml.templ
203 mv out/*.so out/plugins/
204 mv out/plugins/gpu_neon.so out/plugins/gpuPEOPS2.so
205 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i frontend/pandora/pcsx.png -c