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