-TARGETS = gpu_neon.$(EXT) gpu_peops.$(EXT) gpu_unai.$(EXT)
+HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
+
+TARGETS = gpu_peops.$(EXT) gpu_unai.$(EXT)
+ifeq "$(HAVE_NEON)" "1"
+TARGETS += gpu_neon.$(EXT)
+endif
gpu_neon.$(EXT): SRC += psx_gpu_if.c
gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
gpu_peops.$(EXT): SRC += peops_if.c
gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing
gpu_neon.$(EXT): SRC += psx_gpu_if.c
gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
gpu_peops.$(EXT): SRC += peops_if.c
gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing