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 | |
adb4b2c6 |
19 | TARGETS = test_peops test_unai |
90ca4913 |
20 | ifeq "$(HAVE_NEON)" "1" |
21 | TARGETS += test_neon |
22 | endif |
23 | |
adb4b2c6 |
24 | SRC += test.c |
25 | |
26 | all: $(TARGETS) |
27 | |
90ca4913 |
28 | test_neon: SRC += psx_gpu_if.c psx_gpu/psx_gpu_arm_neon.S |
29 | test_neon: psx_gpu_if.c psx_gpu/*.c |
30 | test_neon: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP |
adb4b2c6 |
31 | test_peops: SRC += peops_if.c |
32 | test_peops: CFLAGS += -fno-strict-aliasing |
90ca4913 |
33 | test_unai: SRC += unai_if.cpp ../gpu_unai/gpu_arm.s |
adb4b2c6 |
34 | test_unai: CC_ = $(CXX) |
35 | |
36 | $(TARGETS): $(SRC) |
37 | $(CC_) -o $@ $(SRC) $(CFLAGS) $(LDFLAGS) |
38 | |
39 | clean: |
40 | $(RM) $(TARGETS) |