frontend: redo frame skip/limiter yet again
[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
36# dynarec
37ifndef NO_NEW_DRC
38OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
39OBJS += libpcsxcore/new_dynarec/pcsxmem.o
40endif
41OBJS += libpcsxcore/new_dynarec/emu_if.o
42libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c
43ifdef DRC_DBG
44libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
45CFLAGS += -DDRC_DBG
46endif
47
48# spu
49OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
50 plugins/dfsound/registers.o plugins/dfsound/spu.o
51ifeq "$(USE_OSS)" "1"
52plugins/dfsound/%.o: CFLAGS += -DUSEOSS
53OBJS += plugins/dfsound/oss.o
54endif
55ifeq "$(USE_ALSA)" "1"
56plugins/dfsound/%.o: CFLAGS += -DUSEALSA
57OBJS += plugins/dfsound/alsa.o
58LDFLAGS += -lasound
59endif
60
61# gpu
62plugins/dfxvideo/%.o: CFLAGS += -Wall
63OBJS += plugins/dfxvideo/gpu.o
64ifdef X11
65LDFLAGS += -lX11 -lXv
66OBJS += plugins/dfxvideo/draw.o
67else
68OBJS += plugins/dfxvideo/draw_fb.o
69endif
70
71# cdrcimg
72plugins/cdrcimg/%.o: CFLAGS += -Wall
73OBJS += plugins/cdrcimg/cdrcimg.o
74
75# gui
76OBJS += frontend/main.o frontend/plugin.o
77ifeq "$(USE_GTK)" "1"
78OBJS += maemo/hildon.o maemo/main.o
79maemo/%.o: maemo/%.c
80else
81OBJS += frontend/plugin_lib.o frontend/menu.o
82OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
83OBJS += frontend/linux/plat.o frontend/linux/oshide.o
84OBJS += frontend/common/fonts.o frontend/common/input.o frontend/common/readpng.o
85ifeq "$(ARCH)" "arm"
86OBJS += frontend/plat_omap.o
87else
88OBJS += frontend/plat_dummy.o
89endif
90endif # !USE_GTK
91ifeq "$(ARCH)" "arm"
92OBJS += frontend/arm_utils.o
93endif
94ifdef X11
95frontend/%.o: CFLAGS += -DX11
96OBJS += frontend/xkb.o
97endif
98ifdef PCNT
99CFLAGS += -DPCNT
100endif
101frontend/%.o: CFLAGS += -Wall -DIN_EVDEV
102frontend/menu.o: frontend/revision.h
103
104frontend/revision.h: FORCE
105 @(git describe || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
106 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
107 @rm $@_
108.PHONY: FORCE
109
110
111$(TARGET): $(OBJS)
112 $(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
113
114PLUGINS = plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
115 plugins/gpu-gles/gpuGLES.so
116
117$(PLUGINS):
118 make -C $(dir $@)
119
120clean:
121 $(RM) $(TARGET) $(OBJS) $(TARGET).map
122
123clean_plugins:
124 for dir in $(PLUGINS) ; do \
125 $(MAKE) -C $$(dirname $$dir) clean; done
126
127# ----------- release -----------
128
129PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
130
131VER ?= $(shell git describe --abbrev=0 master)
132
133rel: pcsx $(PLUGINS) \
134 pandora/pcsx.sh pandora/pcsx.pxml pandora/pcsx.png \
135 pandora/picorestore pandora/readme.txt skin COPYING
136 rm -rf out
137 mkdir -p out/plugins
138 cp -r $^ out/
139 mv out/*.so out/plugins/
140 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x pandora/pcsx.pxml -i pandora/pcsx.png -c