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