fix some build issues and warnings
[pcsx_rearmed.git] / plugins / gpulib / Makefile.test
... / ...
CommitLineData
1CC = $(CROSS_COMPILE)gcc
2CXX = $(CROSS_COMPILE)g++
3CC_ = $(CROSS_COMPILE)gcc
4
5ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
6HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
7
8CFLAGS += -ggdb -Wall -DTEST
9ifndef DEBUG
10CFLAGS += -O2
11endif
12ifeq "$(ARCH)" "arm"
13CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
14endif
15ifeq "$(ARCH)" "x86_64"
16CFLAGS += -m32
17endif
18
19TARGETS = test_neon test_peops test_unai
20
21SRC += test.c
22
23all: $(TARGETS)
24
25test_neon: SRC += ../gpu_neon/psx_gpu_if.c
26test_neon: CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
27ifeq "$(HAVE_NEON)" "1"
28test_neon: SRC += ../gpu_neon/psx_gpu/psx_gpu_arm_neon.S
29test_neon: CFLAGS += -DNEON_BUILD
30else
31test_neon: CFLAGS += -fno-strict-aliasing
32endif
33test_peops: SRC += ../dfxvideo/gpulib_if.c
34test_peops: CFLAGS += -fno-strict-aliasing
35test_unai: SRC += ../gpu_unai/gpulib_if.cpp
36test_unai: CC_ = $(CXX)
37ifeq "$(ARCH)" "arm"
38test_unai: SRC += ../gpu_unai/gpu_arm.s
39endif
40
41$(TARGETS): $(SRC)
42 $(CC_) -o $@ $(SRC) $(CFLAGS) $(LDFLAGS)
43
44clean:
45 $(RM) $(TARGETS)