frontend: debug menu adjustment
[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
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
f95a77f7 39# dynarec
7139f3c8 40ifndef NO_NEW_DRC
41OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
7e605697 42OBJS += libpcsxcore/new_dynarec/pcsxmem.o
7139f3c8 43endif
44OBJS += libpcsxcore/new_dynarec/emu_if.o
cbbab9cd 45libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
46 libpcsxcore/new_dynarec/pcsxmem_inline.c
3eb78778 47ifdef DRC_DBG
48libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
49CFLAGS += -DDRC_DBG
50endif
f95a77f7 51
e906c010 52# spu
ee849648 53OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
54 plugins/dfsound/registers.o plugins/dfsound/spu.o
6d866bb7 55plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
56 plugins/dfsound/xa.c
57plugins/dfsound/%.o: CFLAGS += -Wall
de38f20e 58ifeq "$(USE_OSS)" "1"
59plugins/dfsound/%.o: CFLAGS += -DUSEOSS
60OBJS += plugins/dfsound/oss.o
61endif
62ifeq "$(USE_ALSA)" "1"
63plugins/dfsound/%.o: CFLAGS += -DUSEALSA
64OBJS += plugins/dfsound/alsa.o
65LDFLAGS += -lasound
66endif
67
e906c010 68# gpu
2ef486ee 69# note: code is not safe for strict-aliasing? (Castlevania problems)
70plugins/dfxvideo/%.o: CFLAGS += -Wall -fno-strict-aliasing
a96a5eb2 71OBJS += plugins/dfxvideo/gpu.o
6d866bb7 72plugins/dfxvideo/gpu.o: plugins/dfxvideo/fps.c plugins/dfxvideo/prim.c \
73 plugins/dfxvideo/gpu.c plugins/dfxvideo/soft.c
b60f2812 74ifdef X11
75LDFLAGS += -lX11 -lXv
76OBJS += plugins/dfxvideo/draw.o
77else
b60f2812 78OBJS += plugins/dfxvideo/draw_fb.o
79endif
e0c692d9 80
47bf65ab 81# cdrcimg
82plugins/cdrcimg/%.o: CFLAGS += -Wall
83OBJS += plugins/cdrcimg/cdrcimg.o
e906c010 84
384f5f43 85# dfinput
86plugins/dfinput/%.o: CFLAGS += -Wall
87OBJS += plugins/dfinput/pad.o
88
80c2304e 89# gui
e0c692d9 90OBJS += frontend/main.o frontend/plugin.o
91ifeq "$(USE_GTK)" "1"
92OBJS += maemo/hildon.o maemo/main.o
93maemo/%.o: maemo/%.c
799b0b87 94maemo/%.o: CFLAGS += -Wall
e0c692d9 95else
96OBJS += frontend/plugin_lib.o frontend/menu.o
69af03a2 97OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
98OBJS += frontend/linux/plat.o frontend/linux/oshide.o
99OBJS += frontend/common/fonts.o frontend/common/input.o frontend/common/readpng.o
c5061935 100ifeq "$(ARCH)" "arm"
ccf51908 101OBJS += frontend/plat_omap.o
799b0b87 102OBJS += frontend/pandora.o
ccf51908 103else
104OBJS += frontend/plat_dummy.o
a327967e 105endif
e0c692d9 106endif # !USE_GTK
107ifeq "$(ARCH)" "arm"
108OBJS += frontend/arm_utils.o
109endif
447783f8 110ifdef X11
111frontend/%.o: CFLAGS += -DX11
112OBJS += frontend/xkb.o
113endif
72228559 114ifdef PCNT
115CFLAGS += -DPCNT
116endif
69af03a2 117frontend/%.o: CFLAGS += -Wall -DIN_EVDEV
3c70c47b 118frontend/menu.o: frontend/revision.h
119
120frontend/revision.h: FORCE
121 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
122 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
123 @rm $@_
124.PHONY: FORCE
125
80c2304e 126
127$(TARGET): $(OBJS)
f95a77f7 128 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
80c2304e 129
ee78346e 130PLUGINS = plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
131 plugins/gpu-gles/gpuGLES.so
0d464c77 132
ee78346e 133$(PLUGINS):
134 make -C $(dir $@)
f932e54b 135
80c2304e 136clean:
ee78346e 137 $(RM) $(TARGET) $(OBJS) $(TARGET).map
138
139clean_plugins:
140 for dir in $(PLUGINS) ; do \
141 $(MAKE) -C $$(dirname $$dir) clean; done
80c2304e 142
303ee308 143# ----------- release -----------
144
145PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
146
45d45c1e 147VER ?= $(shell git describe master)
303ee308 148
ee78346e 149rel: pcsx $(PLUGINS) \
f932e54b 150 pandora/pcsx.sh pandora/pcsx.pxml pandora/pcsx.png \
e3d0da26 151 pandora/picorestore pandora/readme.txt pandora/skin COPYING
303ee308 152 rm -rf out
bbd837c6 153 mkdir -p out/plugins
303ee308 154 cp -r $^ out/
bbd837c6 155 mv out/*.so out/plugins/
303ee308 156 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x pandora/pcsx.pxml -i pandora/pcsx.png -c