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