frontend: add BIOS warning
[pcsx_rearmed.git] / Makefile
... / ...
CommitLineData
1#CROSS_COMPILE=
2AS = $(CROSS_COMPILE)as
3CC = $(CROSS_COMPILE)gcc
4LD = $(CROSS_COMPILE)ld
5
6ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
7
8CFLAGS += -ggdb -Ifrontend
9LDFLAGS += -lz -lpthread -ldl -lpng -lbz2
10ifeq "$(ARCH)" "arm"
11CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp -ffast-math
12ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
13endif
14ifndef DEBUG
15CFLAGS += -O2 -DNDEBUG
16endif
17CFLAGS += $(EXTRA_CFLAGS)
18
19USE_OSS ?= 1
20#USE_ALSA = 1
21#DRC_DBG = 1
22#PCNT = 1
23TARGET = pcsx
24
25-include Makefile.local
26
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
36ifeq "$(ARCH)" "arm"
37OBJS += libpcsxcore/gte_neon.o
38endif
39# dynarec
40ifndef NO_NEW_DRC
41OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
42OBJS += libpcsxcore/new_dynarec/pcsxmem.o
43endif
44OBJS += libpcsxcore/new_dynarec/emu_if.o
45libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
46 libpcsxcore/new_dynarec/pcsxmem_inline.c
47ifdef DRC_DBG
48libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
49CFLAGS += -DDRC_DBG
50endif
51
52# spu
53OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
54 plugins/dfsound/registers.o plugins/dfsound/spu.o
55plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
56 plugins/dfsound/xa.c
57plugins/dfsound/%.o: CFLAGS += -Wall
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
68# gpu
69plugins/dfxvideo/%.o: CFLAGS += -Wall
70OBJS += plugins/dfxvideo/gpu.o
71plugins/dfxvideo/gpu.o: plugins/dfxvideo/fps.c plugins/dfxvideo/prim.c \
72 plugins/dfxvideo/gpu.c plugins/dfxvideo/soft.c
73ifdef X11
74LDFLAGS += -lX11 -lXv
75OBJS += plugins/dfxvideo/draw.o
76else
77OBJS += plugins/dfxvideo/draw_fb.o
78endif
79
80# cdrcimg
81plugins/cdrcimg/%.o: CFLAGS += -Wall
82OBJS += plugins/cdrcimg/cdrcimg.o
83
84# dfinput
85plugins/dfinput/%.o: CFLAGS += -Wall
86OBJS += plugins/dfinput/pad.o
87
88# gui
89OBJS += frontend/main.o frontend/plugin.o
90ifeq "$(USE_GTK)" "1"
91OBJS += maemo/hildon.o maemo/main.o
92maemo/%.o: maemo/%.c
93maemo/%.o: CFLAGS += -Wall
94else
95OBJS += frontend/plugin_lib.o frontend/menu.o
96OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
97OBJS += frontend/linux/plat.o frontend/linux/oshide.o
98OBJS += frontend/common/fonts.o frontend/common/input.o frontend/common/readpng.o
99ifeq "$(ARCH)" "arm"
100OBJS += frontend/plat_omap.o
101OBJS += frontend/pandora.o
102else
103OBJS += frontend/plat_dummy.o
104endif
105endif # !USE_GTK
106ifeq "$(ARCH)" "arm"
107OBJS += frontend/arm_utils.o
108endif
109ifdef X11
110frontend/%.o: CFLAGS += -DX11
111OBJS += frontend/xkb.o
112endif
113ifdef PCNT
114CFLAGS += -DPCNT
115endif
116frontend/%.o: CFLAGS += -Wall -DIN_EVDEV
117frontend/menu.o: frontend/revision.h
118
119frontend/revision.h: FORCE
120 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
121 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
122 @rm $@_
123.PHONY: FORCE
124
125
126$(TARGET): $(OBJS)
127 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
128
129PLUGINS = plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
130 plugins/gpu-gles/gpuGLES.so
131
132$(PLUGINS):
133 make -C $(dir $@)
134
135clean:
136 $(RM) $(TARGET) $(OBJS) $(TARGET).map
137
138clean_plugins:
139 for dir in $(PLUGINS) ; do \
140 $(MAKE) -C $$(dirname $$dir) clean; done
141
142# ----------- release -----------
143
144PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
145
146VER ?= $(shell git describe master)
147
148rel: pcsx $(PLUGINS) \
149 pandora/pcsx.sh pandora/pcsx.pxml pandora/pcsx.png \
150 pandora/picorestore pandora/readme.txt pandora/skin COPYING
151 rm -rf out
152 mkdir -p out/plugins
153 cp -r $^ out/
154 mv out/*.so out/plugins/
155 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x pandora/pcsx.pxml -i pandora/pcsx.png -c