-CC = $(CROSS_COMPILE)gcc
-CFLAGS += -ggdb -Wall -fPIC
-CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
+CFLAGS += -ggdb -Wall -O2 -DNDEBUG
-TARGET = gpu_neon.so
-LDFLAGS += -shared -Wl,-soname,$(TARGET)
-SRC += gpu.c ../../frontend/arm_utils.s
+include ../../config.mak
-all: $(TARGET)
+SRC += psx_gpu_if.c
-$(TARGET): $(SRC)
- $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
+CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
+CFLAGS += -DNEON_BUILD
+ifeq "$(HAVE_NEON)" "1"
+ ifeq "$(HAVE_NEON_ASM)" "1"
+ SRC += psx_gpu/psx_gpu_arm_neon.S
+ else
+ OBJS += psx_gpu/psx_gpu_simd.c
+ CFLAGS += -DSIMD_BUILD
+ endif
+else
+CFLAGS += -fno-strict-aliasing
+endif
-clean:
- $(RM) $(TARGET)
+BIN_GPULIB = gpu_neon.so
+include ../gpulib/gpulib.mak