#DRC_DBG = 1
#PCNT = 1
-all: config.mak $(TARGET)
+all: config.mak $(TARGET) plugins_
ifneq ($(wildcard config.mak),)
config.mak: ./configure
maemo/%.o: maemo/%.c
else
OBJS += frontend/menu.o frontend/linux/in_evdev.o
-OBJS += frontend/common/input.o frontend/linux/xenv.o
+OBJS += frontend/common/input.o
ifeq "$(PLATFORM)" "generic"
OBJS += frontend/plat_sdl.o frontend/common/in_sdl.o
endif
ifeq "$(PLATFORM)" "pandora"
OBJS += frontend/linux/fbdev.o
-OBJS += frontend/plat_omap.o
+OBJS += frontend/plat_omap.o frontend/linux/xenv.o
OBJS += frontend/plat_pandora.o
endif
ifeq "$(PLATFORM)" "caanoo"
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS) -Wl,-Map=$@.map
-clean: $(PLAT_CLEAN)
+clean: $(PLAT_CLEAN) clean_plugins
$(RM) $(TARGET) $(OBJS) $(TARGET).map
ifneq ($(PLUGINS),)
+plugins_: $(PLUGINS)
+
$(PLUGINS):
- make -C plugins/gpulib/ clean
make -C $(dir $@)
clean_plugins:
make -C plugins/gpulib/ clean
for dir in $(PLUGINS) ; do \
$(MAKE) -C $$(dirname $$dir) clean; done
+else
+plugins_:
+clean_plugins:
endif
# ----------- release -----------
VER ?= $(shell git describe master)
+ifeq "$(PLATFORM)" "generic"
+OUT = pcsx_rearmed_$(VER)
+
+rel: pcsx $(PLUGINS) \
+ frontend/pandora/skin readme.txt COPYING
+ rm -rf $(OUT)
+ mkdir -p $(OUT)/plugins
+ mkdir -p $(OUT)/bios
+ cp -r $^ $(OUT)/
+ mv $(OUT)/*.so* $(OUT)/plugins/
+ zip -9 -r $(OUT).zip $(OUT)
+endif
+
ifeq "$(PLATFORM)" "pandora"
PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
-PLUGINS ?= plugins/spunull/spunull.so plugins/gpu-gles/gpu_gles.so \
- plugins/gpu_unai/gpu_unai.so plugins/dfxvideo/gpu_peops.so
-
rel: pcsx $(PLUGINS) \
frontend/pandora/pcsx.sh frontend/pandora/pcsx.pxml.templ frontend/pandora/pcsx.png \
frontend/pandora/picorestore frontend/pandora/skin readme.txt COPYING
caanoo_clean:
$(RM) frontend/320240/pollux_set
-PLUGINS ?= plugins/spunull/spunull.so plugins/gpu_unai/gpu_unai.so \
- plugins/gpu-gles/gpu_gles.so
-
rel: pcsx $(PLUGINS) \
frontend/320240/caanoo.gpe frontend/320240/pcsx26.png \
frontend/320240/pcsxb.png frontend/320240/skin \
platform="generic"
sound_driver_list="oss alsa none"
sound_driver="alsa"
+plugins="plugins/spunull/spunull.so \
+plugins/dfxvideo/gpu_peops.so plugins/gpu_unai/gpu_unai.so"
ram_fixed="no"
drc_cache_base="no"
have_armv6=""
fi
fi
+# check for GLES headers
+cat > $TMPC <<EOF
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+void *test(void) {
+ return eglGetDisplay( (EGLNativeDisplayType)0 );
+}
+EOF
+if compile_object; then
+ plugins="$plugins plugins/gpu-gles/gpu_gles.so"
+fi
+
+# short plugin list for display
+for p in $plugins; do
+ p1=`basename $p`
+ plugins_short="$p1 $plugins_short"
+done
+
# set things that failed to autodetect to "no"
test "x$have_armv6" != "x" || have_armv6="no"
test "x$have_armv7" != "x" || have_armv7="no"
echo "architecture $ARCH"
echo "platform $platform"
echo "sound driver $sound_driver"
+echo "plugins $plugins_short"
echo "C compiler $CC"
echo "C compiler flags $CFLAGS"
echo "linker flags $LDFLAGS"
echo "USE_NO_SOUND = 1" >> $config_mak
;;
esac
+if [ "$ARCH" = "arm" ]; then
+ echo "PLUGINS = $plugins" >> $config_mak
+else
+ echo -n "PLUGINS =" >> $config_mak
+ for p in $plugins; do
+ echo -n " ${p}.${ARCH}" >> $config_mak
+ done
+ echo >> $config_mak
+fi
if [ "$have_armv6" = "yes" ]; then
echo "HAVE_ARMV6 = 1" >> $config_mak
fi
strcpy(Config.Pad2, "builtin_pad");
strcpy(Config.Net, "Disabled");
#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX */
- strcpy(Config.Gpu, "gpuPCSX4ALL.so");
+ strcpy(Config.Gpu, "gpu_unai.so");
#endif
snprintf(Config.PatchesDir, sizeof(Config.PatchesDir), "." PATCHES_DIR);
// convenience hack
if (strstr(lib, ".x86") == NULL) {
char name[MAXPATHLEN];
- snprintf(name, sizeof(name), "%s.x86", lib);
+ snprintf(name, sizeof(name), "%s.x86_64", lib);
lib = name;
}
#endif
menu_sync_config();
+ // caanoo old config compat hack
+ if (strcmp(Config.Gpu, "gpuPCSX4ALL.so") == 0)
+ strcpy(Config.Gpu, "gpu_unai.so");
+
// sync plugins
for (i = bios_sel = 0; bioses[i] != NULL; i++)
if (strcmp(Config.Bios, bioses[i]) == 0)
endif
CFLAGS += $(PLUGIN_CFLAGS)
+# need to compile to another dir, same files are compiled
+# into main binary without PIC
+OBJS2 = $(patsubst %.o,obj/%.o,$(OBJS))
+
TARGET = gpulib.$(EXT)
-all: ../../config.mak $(TARGET)
+all: ../../config.mak obj $(TARGET)
-$(TARGET): $(OBJS)
+$(TARGET): $(OBJS2)
$(AR) crs $@ $^
+obj/%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^
+
+obj/%.o: %.s
+ $(AS) $(ASFLAGS) -o $@ $^
+
clean:
- $(RM) $(TARGET) $(OBJS)
+ $(RM) $(TARGET) $(OBJS2)
+
+obj:
+ mkdir -p $@
../../config.mak:
@echo "Please run ./configure before running make!"
CC_STANDLALONE = $(CC)
CC_GPULIB = $(CC)
+WD = $(shell pwd)
+PLUGINDIR = $(shell basename $(WD))
+
all: ../../config.mak $(TARGETS)
ifdef BIN_STANDLALONE
endif
$(BIN_STANDLALONE)$(EXT): $(SRC) $(SRC_STANDALONE) $(GPULIB_A)
$(CC_STANDLALONE) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_STANDALONE)
+ ln -fs $(PLUGINDIR)/$@ ../
endif
ifdef BIN_GPULIB
endif
$(BIN_GPULIB)$(EXT): $(SRC) $(SRC_GPULIB) $(GPULIB_A)
$(CC_GPULIB) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_GPULIB)
+ ln -fs $(PLUGINDIR)/$@ ../
endif
$(GPULIB_A):
-all: ../../config.mak spunull.so
-
include ../../config.mak
-spunull.so: spunull.c
+ifneq "$(ARCH)" "arm"
+ EXT = .$(ARCH)
+endif
+TARGET = spunull.so$(EXT)
+WD = $(shell pwd)
+PLUGINDIR = $(shell basename $(WD))
+
+all: ../../config.mak $(TARGET)
+
+$(TARGET): spunull.c
$(CC) $(CFLAGS) -shared -fPIC -ggdb -O2 -o $@ $^
+ ln -fs $(PLUGINDIR)/$(TARGET) ../
clean:
- $(RM) spunull.so
+ $(RM) $(TARGET)
../../config.mak:
@echo "Please run ./configure before running make!"