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