endif
# gpu
-OBJS += plugins/gpu_neon/gpu.o
+OBJS += plugins/gpulib/gpu.o
ifeq "$(HAVE_NEON)" "1"
+OBJS += plugins/gpulib/cspace_neon.o
OBJS += plugins/gpu_neon/psx_gpu_if.o plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o
plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c
else
+OBJS += plugins/gpulib/cspace.o
# note: code is not safe for strict-aliasing? (Castlevania problems)
-plugins/gpu_neon/peops_if.o: CFLAGS += -fno-strict-aliasing
-plugins/gpu_neon/peops_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c
-OBJS += plugins/gpu_neon/peops_if.o
+plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing
+plugins/dfxvideo/gpulib_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c
+OBJS += plugins/dfxvideo/gpulib_if.o
endif
ifdef X11
LDFLAGS += -lX11 `sdl-config --libs`
-OBJS += plugins/gpu_neon/vout_sdl.o
-plugins/gpu_neon/vout_sdl.o: CFLAGS += `sdl-config --cflags`
+OBJS += plugins/gpulib/vout_sdl.o
+plugins/gpulib/vout_sdl.o: CFLAGS += `sdl-config --cflags`
else
-OBJS += plugins/gpu_neon/vout_fb.o
+OBJS += plugins/gpulib/vout_fb.o
endif
# cdrcimg
endif # !USE_GTK
-ifeq "$(HAVE_NEON)" "1"
-OBJS += frontend/cspace_neon.o
-else
-OBJS += frontend/cspace.o
-endif
ifdef X11
frontend/%.o: CFLAGS += -DX11
OBJS += frontend/xkb.o
$(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
PLUGINS ?= plugins/spunull/spunull.so plugins/gpu-gles/gpuGLES.so \
- plugins/gpu_neon/gpu_unai.so plugins/gpu_neon/gpu_peops.so
+ plugins/gpu_unai/gpu_unai.so plugins/dfxvideo/gpu_peops.so
$(PLUGINS):
make -C $(dir $@)
#include "omap.h"
#include "plat.h"
#include "pcnt.h"
-#include "cspace.h"
#include "common/plat.h"
#include "common/input.h"
#include "linux/in_evdev.h"
#include "../libpcsxcore/psemu_plugin_defs.h"
#include "../libpcsxcore/new_dynarec/new_dynarec.h"
#include "../plugins/dfinput/main.h"
+#include "../plugins/gpulib/cspace.h"
#include "revision.h"
#define REARMED_BIRTHDAY_TIME 1293306830 /* 25 Dec 2010 */
#include "warm/warm.h"
#include "plugin_lib.h"
#include "pl_gun_ts.h"
-#include "cspace.h"
#include "blit320.h"
#include "in_tsbutton.h"
#include "main.h"
#include "menu.h"
#include "plat.h"
#include "pcnt.h"
+#include "../plugins/gpulib/cspace.h"
int gp2x_dev_id;
#include "gpu.h"
+#include "../gpulib/cspace.h"
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/cspace.h"
#include "../../frontend/pcnt.h"
// misc globals
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "gpu.h"
+#include "../gpulib/gpu.h"
#define u32 uint32_t
unsigned long lSetMask = 0;
long lLowerpart;
-#include "../dfxvideo/soft.c"
-#include "../dfxvideo/prim.c"
+#include "soft.c"
+#include "prim.c"
/////////////////////////////////////////////////////////////////////////////
CC = $(CROSS_COMPILE)gcc
-CXX = $(CROSS_COMPILE)g++
-CC_ = $(CC)
ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
-CFLAGS += -ggdb -Wall -fPIC -O2
-CFLAGS += -fno-strict-aliasing
-ifdef MAEMO
-CFLAGS += -DMAEMO
-endif
+HAVE_NEON = $(shell $(CC) -E -dD $(CFLAGS_) ../gpulib/gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
-SRC += gpu.c
+# FIXME: rework NEON detection to get rid of this
ifeq "$(ARCH)" "arm"
-ARM_CORTEXA8 ?= 1
-ifeq "$(ARM_CORTEXA8)" "1"
-CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
-SRC += ../../frontend/cspace_neon.s
-else
-CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
-SRC += ../../frontend/cspace.c
-endif
-SRC += vout_fb.c
-EXT = so
-endif
-ifeq "$(ARCH)" "x86_64"
-CFLAGS += `sdl-config --cflags` -m32
-LDFLAGS += `sdl-config --libs`
-SRC += vout_sdl.c
-EXT = so.x86
+ ARM_CORTEXA8 ?= 1
+ ifeq "$(ARM_CORTEXA8)" "1"
+ CFLAGS_ += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
+ endif
endif
-HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
+CFLAGS += -ggdb -Wall -fPIC -O2
-TARGETS = gpu_neon.$(EXT) gpu_peops.$(EXT) gpu_unai.$(EXT)
+SRC += psx_gpu_if.c
-gpu_neon.$(EXT): SRC += psx_gpu_if.c
-gpu_neon.$(EXT): CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
+CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
ifeq "$(HAVE_NEON)" "1"
-gpu_neon.$(EXT): SRC += psx_gpu/psx_gpu_arm_neon.S
-gpu_neon.$(EXT): CFLAGS += -DNEON_BUILD
+SRC += psx_gpu/psx_gpu_arm_neon.S
+CFLAGS += -DNEON_BUILD
else
-gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
-endif
-gpu_peops.$(EXT): SRC += peops_if.c
-gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing
-gpu_unai.$(EXT): SRC += unai_if.cpp
-gpu_unai.$(EXT): CC_ = $(CXX)
-ifeq "$(ARCH)" "arm"
-gpu_unai.$(EXT): SRC += ../gpu_unai/gpu_arm.s
+CFLAGS += -fno-strict-aliasing
endif
-all: $(TARGETS)
-
-$(TARGETS): $(SRC)
- $(CC_) -o $@ $(SRC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@
-
-clean:
- $(RM) $(TARGETS)
+BIN_GPULIB = gpu_neon.so
+include ../gpulib/gpulib.mak
#include "psx_gpu/psx_gpu.c"
#include "psx_gpu/psx_gpu_parse.c"
-#include "gpu.h"
+#include "../gpulib/gpu.h"
static psx_gpu_struct egpu __attribute__((aligned(256)));
-CC = $(CROSS_COMPILE)gcc
+CC = $(CROSS_COMPILE)g++
-CFLAGS += -ggdb -fPIC -Wall -DREARMED
-ifndef DEBUG
-CFLAGS += -O2 -ffast-math -fomit-frame-pointer
-endif
-ifdef MAEMO
-CFLAGS += -DMAEMO
-endif
-ARM_CORTEXA8 ?= 1
-ifeq "$(ARM_CORTEXA8)" "1"
-CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
-SRC += ../../frontend/cspace_neon.s
-else
-CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
-SRC += ../../frontend/cspace.c
-endif
-
-SRC += gpu.cpp gpu_arm.s
+ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
-TARGET = gpuPCSX4ALL.so
-LDFLAGS += -shared -Wl,-soname,$(TARGET)
+CFLAGS += -DREARMED
+CFLAGS += -ggdb -Wall -fPIC -O2 -ffast-math
--include Makefile.local
+SRC_STANDALONE += gpu.cpp
+SRC_GPULIB += gpulib_if.cpp
-all: $(TARGET)
-
-$(TARGET): $(SRC)
- $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
-
-# $(TARGET): *.h
+ifeq "$(ARCH)" "arm"
+SRC += gpu_arm.s
+endif
-clean:
- $(RM) $(TARGET) $(OBJ)
+BIN_STANDLALONE = gpuPCSX4ALL.so
+BIN_GPULIB = gpu_unai.so
+include ../gpulib/gpulib.mak
#else
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/cspace.h"
+#include "../gpulib/cspace.h"
extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "gpu.h"
+#include "../gpulib/gpu.h"
#define u8 uint8_t
#define s8 int8_t
--- /dev/null
+CC = $(CROSS_COMPILE)gcc
+AS = $(CROSS_COMPILE)as
+AR = $(CROSS_COMPILE)ar
+
+ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
+
+CFLAGS += -ggdb -Wall -fPIC -O2
+
+OBJS += gpu.o
+
+ifeq "$(ARCH)" "arm"
+ARM_CORTEXA8 ?= 1
+ifeq "$(ARM_CORTEXA8)" "1"
+CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
+ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
+OBJS += cspace_neon.o
+else
+CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
+ASFLAGS += -mcpu=arm926ej-s -mfloat-abi=softfp
+OBJS += cspace.o
+endif
+OBJS += vout_fb.o
+EXT = a
+else
+CFLAGS += `sdl-config --cflags` -m32
+OBJS += vout_sdl.o
+EXT = x86.a
+endif
+
+TARGET = gpulib.$(EXT)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(AR) crs $@ $^
+
+clean:
+ $(RM) $(TARGET) $(OBJS)
all: $(TARGETS)
-test_neon: SRC += psx_gpu_if.c
-test_neon: psx_gpu_if.c psx_gpu/*.c
+test_neon: SRC += ../gpu_neon/psx_gpu_if.c
test_neon: CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
ifeq "$(HAVE_NEON)" "1"
-test_neon: SRC += psx_gpu/psx_gpu_arm_neon.S
+test_neon: SRC += ../gpu_neon/psx_gpu/psx_gpu_arm_neon.S
test_neon: CFLAGS += -DNEON_BUILD
else
test_neon: CFLAGS += -fno-strict-aliasing
endif
-test_peops: SRC += peops_if.c
+test_peops: SRC += ../dfxvideo/gpulib_if.c
test_peops: CFLAGS += -fno-strict-aliasing
-test_unai: SRC += unai_if.cpp
+test_unai: SRC += ../gpu_unai/gpulib_if.cpp
test_unai: CC_ = $(CXX)
ifeq "$(ARCH)" "arm"
test_unai: SRC += ../gpu_unai/gpu_arm.s
--- /dev/null
+# depends on ARCH definition
+# always adding gpulib to LDLIBS in case cspace is needed
+
+LDFLAGS += -shared
+ifeq "$(ARCH)" "arm"
+ ARM_CORTEXA8 ?= 1
+ ifeq "$(ARM_CORTEXA8)" "1"
+ CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
+ ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
+ else
+ CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
+ ASFLAGS += -mcpu=arm926ej-s -mfloat-abi=softfp
+ endif
+ EXT =
+else
+ CFLAGS += -m32
+ LDFLAGS += -m32
+ LDLIBS_GPULIB += `sdl-config --libs`
+ EXT = .x86
+endif
+ifdef MAEMO
+ CFLAGS += -DMAEMO
+endif
+ifdef DEBUG
+ CFLAGS += -O0
+endif
+
+GPULIB_A = ../gpulib/gpulib$(EXT).a
+LDLIBS += $(GPULIB_A)
+
+ifdef BIN_STANDLALONE
+TARGETS += $(BIN_STANDLALONE)$(EXT)
+endif
+ifdef BIN_GPULIB
+TARGETS += $(BIN_GPULIB)$(EXT)
+endif
+
+all: $(GPULIB_A) $(TARGETS)
+
+ifdef BIN_STANDLALONE
+$(BIN_STANDLALONE)$(EXT): $(SRC) $(SRC_STANDALONE)
+ $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(LDLIBS_STANDALONE)
+endif
+
+ifdef BIN_GPULIB
+$(BIN_GPULIB)$(EXT): $(SRC) $(SRC_GPULIB)
+ $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(LDLIBS_GPULIB)
+endif
+
+$(GPULIB_A):
+ make -C ../gpulib/ all
+
+clean:
+ $(RM) $(TARGETS)
*/
#include "gpu.h"
+#include "cspace.h"
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/cspace.h"
static const struct rearmed_cbs *cbs;
static void *screen_buf;