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