gpu_neon: update for armv5pollux build
[pcsx_rearmed.git] / plugins / gpu_neon / Makefile
1 CC = $(CROSS_COMPILE)gcc
2 CXX = $(CROSS_COMPILE)g++
3 CC_ = $(CC)
4
5 ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
6
7 CFLAGS += -ggdb -Wall -fPIC -O2
8 CFLAGS += -fno-strict-aliasing
9
10 SRC += gpu.c
11 ifeq "$(ARCH)" "arm"
12 ARM_CORTEXA8 ?= 1
13 ifeq "$(ARM_CORTEXA8)" "1"
14 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
15 SRC += ../../frontend/cspace_neon.s
16 else
17 CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
18 SRC += ../../frontend/cspace.c
19 endif
20 SRC += vout_fb.c
21 EXT = so
22 endif
23 ifeq "$(ARCH)" "x86_64"
24 CFLAGS += `sdl-config --cflags` -m32
25 LDFLAGS += `sdl-config --libs`
26 SRC += vout_sdl.c
27 EXT = so.x86
28 endif
29
30 HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
31
32 TARGETS = gpu_peops.$(EXT) gpu_unai.$(EXT)
33 ifeq "$(HAVE_NEON)" "1"
34 TARGETS += gpu_neon.$(EXT)
35 endif
36
37 gpu_neon.$(EXT): SRC += psx_gpu_if.c
38 gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
39 gpu_peops.$(EXT): SRC += peops_if.c
40 gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing
41 gpu_unai.$(EXT): SRC += unai_if.cpp
42 gpu_unai.$(EXT): CC_ = $(CXX)
43
44 all: $(TARGETS)
45
46 $(TARGETS): $(SRC)
47         $(CC_) -o $@ $(SRC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@
48
49 clean:
50         $(RM) $(TARGETS)