release r5
[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
f95a77f7 8CFLAGS += -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
de38f20e 17USE_OSS = 1
18#USE_ALSA = 1
3eb78778 19#DRC_DBG = 1
fa9cfe0a 20#PCNT = 1
80c2304e 21TARGET = pcsx
22
de38f20e 23-include Makefile.local
24
80c2304e 25all: $(TARGET)
26
27# core
28OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
29 libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/gte.o libpcsxcore/mdec.o \
30 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
31 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
32 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
33 libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
f95a77f7 34# dynarec
7139f3c8 35ifndef NO_NEW_DRC
36OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
7e605697 37OBJS += libpcsxcore/new_dynarec/pcsxmem.o
7139f3c8 38endif
39OBJS += libpcsxcore/new_dynarec/emu_if.o
f95a77f7 40libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c
3eb78778 41ifdef DRC_DBG
42libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
43CFLAGS += -DDRC_DBG
44endif
f95a77f7 45
e906c010 46# spu
ee849648 47OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
48 plugins/dfsound/registers.o plugins/dfsound/spu.o
de38f20e 49ifeq "$(USE_OSS)" "1"
50plugins/dfsound/%.o: CFLAGS += -DUSEOSS
51OBJS += plugins/dfsound/oss.o
52endif
53ifeq "$(USE_ALSA)" "1"
54plugins/dfsound/%.o: CFLAGS += -DUSEALSA
55OBJS += plugins/dfsound/alsa.o
56LDFLAGS += -lasound
57endif
58
e906c010 59# gpu
a96a5eb2 60plugins/dfxvideo/%.o: CFLAGS += -Wall
61OBJS += plugins/dfxvideo/gpu.o
b60f2812 62ifdef X11
63LDFLAGS += -lX11 -lXv
64OBJS += plugins/dfxvideo/draw.o
65else
b60f2812 66OBJS += plugins/dfxvideo/draw_fb.o
67endif
47bf65ab 68# cdrcimg
69plugins/cdrcimg/%.o: CFLAGS += -Wall
70OBJS += plugins/cdrcimg/cdrcimg.o
e906c010 71
80c2304e 72# gui
b60f2812 73OBJS += frontend/main.o frontend/plugin.o frontend/plugin_lib.o
ccf51908 74OBJS += frontend/menu.o
69af03a2 75OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
76OBJS += frontend/linux/plat.o frontend/linux/oshide.o
77OBJS += frontend/common/fonts.o frontend/common/input.o frontend/common/readpng.o
c5061935 78ifeq "$(ARCH)" "arm"
a327967e 79OBJS += frontend/arm_utils.o
ccf51908 80OBJS += frontend/plat_omap.o
81else
82OBJS += frontend/plat_dummy.o
a327967e 83endif
447783f8 84ifdef X11
85frontend/%.o: CFLAGS += -DX11
86OBJS += frontend/xkb.o
87endif
72228559 88ifdef PCNT
89CFLAGS += -DPCNT
90endif
69af03a2 91frontend/%.o: CFLAGS += -Wall -DIN_EVDEV
3c70c47b 92frontend/menu.o: frontend/revision.h
93
94frontend/revision.h: FORCE
95 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
96 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
97 @rm $@_
98.PHONY: FORCE
99
80c2304e 100
101$(TARGET): $(OBJS)
f95a77f7 102 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
80c2304e 103
ee78346e 104PLUGINS = plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
105 plugins/gpu-gles/gpuGLES.so
0d464c77 106
ee78346e 107$(PLUGINS):
108 make -C $(dir $@)
f932e54b 109
80c2304e 110clean:
ee78346e 111 $(RM) $(TARGET) $(OBJS) $(TARGET).map
112
113clean_plugins:
114 for dir in $(PLUGINS) ; do \
115 $(MAKE) -C $$(dirname $$dir) clean; done
80c2304e 116
303ee308 117# ----------- release -----------
118
119PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
120
121VER ?= $(shell git describe --abbrev=0 master)
122
ee78346e 123rel: pcsx $(PLUGINS) \
f932e54b 124 pandora/pcsx.sh pandora/pcsx.pxml pandora/pcsx.png \
303ee308 125 pandora/picorestore pandora/readme.txt skin COPYING
126 rm -rf out
bbd837c6 127 mkdir -p out/plugins
303ee308 128 cp -r $^ out/
bbd837c6 129 mv out/*.so out/plugins/
303ee308 130 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x pandora/pcsx.pxml -i pandora/pcsx.png -c