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