RetroArch/Makefile.shaders
2014-02-21 18:45:03 +01:00

81 lines
2.3 KiB
Makefile

DOWNLOAD_SHADERS = 1
DOWNLOAD_OVERLAYS = 1
SHADER_DIR := media/shaders
OVERLAY_DIR := media/overlays
SHADER_GLSL_DIR := media/shaders_glsl
PLATFORM_MEDIA_SHADER_DIR := ps3/pkg/USRDIR/cores/shaders
SHADER_DEST_PS3_COBRA_DIR := ps3/iso/PS3_GAME/USRDIR/cores/shaders
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
ifeq ($(shell uname), Linux)
PYTHON2 = python2
PYTHON3 = python
GIT = git
else ifneq ($(findstring Darwin,$(shell uname -a)),)
PYTHON2 = python2
PYTHON3 = python
GIT = git
else
PYTHON2 = python2.exe
PYTHON3 = python.exe
GIT = git.exe
endif
checkout-shaders:
ifeq ($(DOWNLOAD_SHADERS),1)
@if test -d $(SHADER_DIR); then \
echo "[SHADER CHECKOUT::] Git pulling common-shaders..."; \
cd $(SHADER_DIR); \
$(GIT) pull; \
cd ../../../../..; \
else \
echo "[SHADER CHECKOUT::] Git cloning common-shaders first..."; \
$(GIT) clone git://github.com/libretro/common-shaders.git $(SHADER_DIR); \
fi
endif
checkout-overlays:
ifeq ($(DOWNLOAD_OVERLAYS),1)
@if test -d $(OVERLAY_DIR); then \
echo "[OVERLAY CHECKOUT::] Git pulling common-overlays..."; \
cd $(OVERLAY_DIR); \
$(GIT) pull; \
cd ../../../../..; \
else \
echo "[OVERLAY CHECKOUT::] Git cloning common-overlays first..."; \
$(GIT) clone git://github.com/libretro/common-overlays.git $(OVERLAY_DIR); \
fi
endif
convert-xml:
$(PYTHON) tools/cg2glsl.py $(SHADER_DIR) $(SHADER_GLSL_DIR)
deploy-ps3: checkout-shaders
@if test -d $(PLATFORM_MEDIA_SHADER_DIR); then \
cp -r $(SHADER_DIR)/* $(PLATFORM_MEDIA_SHADER_DIR); \
else \
echo "[DEPLOY PS3::] Creating PS3 shader directory first..."; \
mkdir -p $(PLATFORM_MEDIA_SHADER_DIR) || bin/true; \
fi
@echo "[DEPLOY PS3::] Copied shaders to PS3 shaders directory."
deploy-ps3-cobra: checkout-shaders
@if test -d $(SHADER_DEST_PS3_COBRA_DIR); then \
cp -r $(SHADER_DIR)/* $(SHADER_DEST_PS3_COBRA_DIR); \
else \
echo "[DEPLOY PS3::] Creating PS3 shader directory first..."; \
mkdir -p $(SHADER_DEST_PS3_COBRA_DIR) || bin/true; \
fi
@echo "[DEPLOY PS3::] Copied shaders to PS3 shaders directory."