1 CC = $(CROSS_COMPILE)gcc
2 CXX = $(CROSS_COMPILE)g++
5 ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
7 CFLAGS += -ggdb -Wall -fPIC -O2
8 CFLAGS += -fno-strict-aliasing
16 ifeq "$(ARM_CORTEXA8)" "1"
17 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
18 SRC += ../../frontend/cspace_neon.s
20 CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
21 SRC += ../../frontend/cspace.c
26 ifeq "$(ARCH)" "x86_64"
27 CFLAGS += `sdl-config --cflags` -m32
28 LDFLAGS += `sdl-config --libs`
33 HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
35 TARGETS = gpu_peops.$(EXT) gpu_unai.$(EXT)
36 ifeq "$(HAVE_NEON)" "1"
37 TARGETS += gpu_neon.$(EXT)
40 gpu_neon.$(EXT): SRC += psx_gpu_if.c psx_gpu/psx_gpu_arm_neon.S
41 gpu_neon.$(EXT): CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
42 gpu_peops.$(EXT): SRC += peops_if.c
43 gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing
44 gpu_unai.$(EXT): SRC += unai_if.cpp ../gpu_unai/gpu_arm.s
45 gpu_unai.$(EXT): CC_ = $(CXX)
50 $(CC_) -o $@ $(SRC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@