frontend cleanup
[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
69af03a2 9LDFLAGS += -lz -lpthread -ldl -lpng
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
69af03a2 15CFLAGS += -O2 # -DNDEBUG
b60f2812 16endif
3eb78778 17#DRC_DBG = 1
fa9cfe0a 18#PCNT = 1
80c2304e 19TARGET = pcsx
20
21all: $(TARGET)
22
23# core
24OBJS += 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 31ifndef NO_NEW_DRC
32OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
7e605697 33OBJS += libpcsxcore/new_dynarec/pcsxmem.o
7139f3c8 34endif
35OBJS += libpcsxcore/new_dynarec/emu_if.o
f95a77f7 36libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c
3eb78778 37ifdef DRC_DBG
38libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
39CFLAGS += -DDRC_DBG
40endif
f95a77f7 41
e906c010 42# spu
43OBJS += 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 47plugins/dfxvideo/%.o: CFLAGS += -Wall
48OBJS += plugins/dfxvideo/gpu.o
b60f2812 49ifdef X11
50LDFLAGS += -lX11 -lXv
51OBJS += plugins/dfxvideo/draw.o
52else
b60f2812 53OBJS += plugins/dfxvideo/draw_fb.o
54endif
47bf65ab 55# cdrcimg
56plugins/cdrcimg/%.o: CFLAGS += -Wall
57OBJS += plugins/cdrcimg/cdrcimg.o
e906c010 58
80c2304e 59# gui
b60f2812 60OBJS += frontend/main.o frontend/plugin.o frontend/plugin_lib.o
ccf51908 61OBJS += frontend/menu.o
69af03a2 62OBJS += frontend/linux/fbdev.o frontend/linux/in_evdev.o
63OBJS += frontend/linux/plat.o frontend/linux/oshide.o
64OBJS += frontend/common/fonts.o frontend/common/input.o frontend/common/readpng.o
c5061935 65ifeq "$(ARCH)" "arm"
a327967e 66OBJS += frontend/arm_utils.o
ccf51908 67OBJS += frontend/plat_omap.o
68else
69OBJS += frontend/plat_dummy.o
a327967e 70endif
72228559 71ifdef PCNT
72CFLAGS += -DPCNT
73endif
69af03a2 74frontend/%.o: CFLAGS += -Wall -DIN_EVDEV
3c70c47b 75frontend/menu.o: frontend/revision.h
76
77frontend/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 87spunull.so: plugins/spunull/spunull.c
bbd837c6 88 $(CC) $(CFLAGS) -shared -fPIC -ggdb -O2 -o $@ $^
0d464c77 89
f932e54b 90plugins/gpu-gles/gpuGLES.so:
91 make -C plugins/gpu-gles/
92
80c2304e 93clean:
94 $(RM) $(TARGET) $(OBJS)
95
303ee308 96# ----------- release -----------
97
98PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
99
100VER ?= $(shell git describe --abbrev=0 master)
101
f932e54b 102rel: 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