2020-12-02 12:07:52 +00:00
|
|
|
#########################
|
|
|
|
## Toolchain variables ##
|
|
|
|
#########################
|
|
|
|
|
|
|
|
# Default toolchain directory
|
|
|
|
TOOLCHAIN_DIR=/opt/gcw0-toolchain
|
|
|
|
|
|
|
|
# All toolchain-related variables may be
|
|
|
|
# overridden via the command line
|
|
|
|
ifdef GCW0_CC
|
|
|
|
CC = $(GCW0_CC)
|
|
|
|
else
|
|
|
|
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-gcc
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef GCW0_CXX
|
|
|
|
CXX = $(GCW0_CXX)
|
|
|
|
else
|
|
|
|
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-g++
|
|
|
|
endif
|
|
|
|
|
2021-02-16 10:16:56 +00:00
|
|
|
ifdef GCW0_STRIP
|
|
|
|
STRIP = $(GCW0_STRIP)
|
|
|
|
else
|
|
|
|
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-strip
|
|
|
|
endif
|
|
|
|
|
2020-12-02 12:07:52 +00:00
|
|
|
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config
|
|
|
|
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config
|
|
|
|
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
|
|
|
|
|
|
|
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
|
|
|
|
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
|
|
|
|
|
|
|
|
#########################
|
|
|
|
#########################
|
|
|
|
|
2020-10-01 14:54:11 +00:00
|
|
|
PACKAGE_NAME = retroarch
|
|
|
|
|
|
|
|
DEBUG ?= 0
|
|
|
|
|
|
|
|
DINGUX = 1
|
|
|
|
HAVE_SCREENSHOTS = 0
|
|
|
|
HAVE_REWIND = 1
|
|
|
|
HAVE_7ZIP = 1
|
|
|
|
HAVE_AL = 1
|
|
|
|
# ALSA freezes when switching back from menu
|
|
|
|
HAVE_ALSA = 0
|
|
|
|
HAVE_DSP_FILTER = 1
|
|
|
|
HAVE_VIDEO_FILTER = 1
|
|
|
|
HAVE_STATIC_VIDEO_FILTERS = 1
|
|
|
|
HAVE_STATIC_AUDIO_FILTERS = 1
|
|
|
|
HAVE_FILTERS_BUILTIN = 1
|
2020-12-02 09:49:37 +00:00
|
|
|
HAVE_BUILTINMBEDTLS = 0
|
2020-10-01 14:54:11 +00:00
|
|
|
HAVE_BUILTINZLIB = 1
|
|
|
|
HAVE_C99 = 1
|
|
|
|
HAVE_CC = 1
|
|
|
|
HAVE_CC_RESAMPLER = 1
|
|
|
|
HAVE_CHD = 1
|
2020-10-08 12:22:35 +00:00
|
|
|
HAVE_COMMAND = 0
|
2020-10-01 14:54:11 +00:00
|
|
|
HAVE_CXX = 1
|
|
|
|
HAVE_DR_MP3 = 1
|
|
|
|
HAVE_DYNAMIC = 1
|
|
|
|
HAVE_EGL = 0
|
|
|
|
HAVE_FREETYPE = 0
|
|
|
|
HAVE_GDI = 1
|
2020-12-02 09:49:37 +00:00
|
|
|
HAVE_GETADDRINFO = 0
|
2020-10-01 14:54:11 +00:00
|
|
|
HAVE_GETOPT_LONG = 1
|
|
|
|
HAVE_GLSL = 0
|
|
|
|
HAVE_HID = 1
|
|
|
|
HAVE_IBXM = 1
|
|
|
|
HAVE_IMAGEVIEWER = 1
|
|
|
|
HAVE_LANGEXTRA = 0
|
|
|
|
HAVE_LIBRETRODB = 1
|
|
|
|
HAVE_MENU = 1
|
|
|
|
HAVE_MENU_COMMON = 1
|
|
|
|
HAVE_GFX_WIDGETS = 0
|
|
|
|
HAVE_MMAP = 1
|
2023-04-11 15:31:49 +00:00
|
|
|
HAVE_NETWORKING = 1
|
2020-10-01 14:54:11 +00:00
|
|
|
HAVE_OPENDINGUX_FBDEV = 0
|
|
|
|
HAVE_OPENGL = 0
|
|
|
|
HAVE_OPENGL1 = 0
|
|
|
|
HAVE_OPENGLES = 0
|
|
|
|
HAVE_OPENGLES3 = 0
|
|
|
|
HAVE_OPENGL_CORE = 0
|
|
|
|
HAVE_OPENSSL = 1
|
|
|
|
HAVE_OVERLAY = 0
|
|
|
|
HAVE_RBMP = 1
|
|
|
|
HAVE_RJPEG = 1
|
2020-12-02 09:49:37 +00:00
|
|
|
HAVE_RPILED = 0
|
2020-10-01 14:54:11 +00:00
|
|
|
HAVE_RPNG = 1
|
|
|
|
HAVE_RUNAHEAD = 1
|
|
|
|
HAVE_SDL_DINGUX = 1
|
|
|
|
HAVE_SHADERPIPELINE = 0
|
|
|
|
HAVE_STB_FONT = 0
|
|
|
|
HAVE_STB_IMAGE = 1
|
|
|
|
HAVE_STB_VORBIS = 1
|
2020-10-08 12:22:35 +00:00
|
|
|
HAVE_STDIN_CMD = 0
|
2020-10-01 14:54:11 +00:00
|
|
|
HAVE_STRCASESTR = 1
|
|
|
|
HAVE_THREADS = 1
|
|
|
|
HAVE_UDEV = 1
|
|
|
|
HAVE_RGUI = 1
|
|
|
|
HAVE_MATERIALUI = 0
|
|
|
|
HAVE_XMB = 0
|
|
|
|
HAVE_OZONE = 0
|
|
|
|
HAVE_ZLIB = 1
|
|
|
|
HAVE_CONFIGFILE = 1
|
|
|
|
HAVE_PATCH = 1
|
|
|
|
HAVE_CHEATS = 1
|
2020-10-08 12:22:35 +00:00
|
|
|
HAVE_CHEEVOS = 0
|
2020-11-17 15:59:39 +00:00
|
|
|
HAVE_LIBSHAKE = 1
|
2021-10-14 13:57:28 +00:00
|
|
|
HAVE_CORE_INFO_CACHE = 1
|
2020-10-01 14:54:11 +00:00
|
|
|
|
|
|
|
OS = Linux
|
|
|
|
TARGET = retroarch
|
|
|
|
OPK_NAME = retroarch_rg350.opk
|
|
|
|
|
|
|
|
OBJ :=
|
|
|
|
LINK := $(CXX)
|
2020-10-23 15:14:15 +00:00
|
|
|
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer
|
2020-11-27 15:10:37 +00:00
|
|
|
DEF_FLAGS += -mplt -mno-shared
|
2020-10-23 15:14:15 +00:00
|
|
|
DEF_FLAGS += -ffunction-sections -fdata-sections
|
2020-10-01 14:54:11 +00:00
|
|
|
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD
|
|
|
|
DEF_FLAGS += -Wall -Wno-unused-variable
|
2021-03-23 12:46:25 +00:00
|
|
|
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE -flto
|
2020-12-02 09:49:37 +00:00
|
|
|
LIBS := -ldl -lz -lrt -ludev -pthread
|
2020-10-01 14:54:11 +00:00
|
|
|
CFLAGS :=
|
|
|
|
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
|
|
|
ASFLAGS :=
|
2021-03-23 12:46:25 +00:00
|
|
|
LDFLAGS := -Wl,--gc-sections
|
2020-12-02 12:07:52 +00:00
|
|
|
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
|
|
|
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
2020-10-01 14:54:11 +00:00
|
|
|
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
|
|
|
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
|
|
|
|
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
|
|
|
DEFINES += -DHAVE_AL=1
|
|
|
|
DEFINES += -DHAVE_FILTERS_BUILTIN
|
|
|
|
DEFINES += -DHAVE_UDEV=1
|
|
|
|
|
2020-12-02 12:07:52 +00:00
|
|
|
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
|
|
|
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
|
|
|
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
|
|
|
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
2020-10-01 14:54:11 +00:00
|
|
|
AL_LIBS := -lopenal
|
|
|
|
MMAP_LIBS = -lc
|
|
|
|
|
|
|
|
OBJDIR_BASE := obj-unix
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
OBJDIR := $(OBJDIR_BASE)/debug
|
|
|
|
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
|
|
|
else
|
|
|
|
OBJDIR := $(OBJDIR_BASE)/release
|
|
|
|
DEF_FLAGS += -O2 -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
|
|
|
include Makefile.common
|
|
|
|
|
|
|
|
DEF_FLAGS += $(INCLUDE_DIRS)
|
2021-03-23 12:46:25 +00:00
|
|
|
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
2020-10-01 14:54:11 +00:00
|
|
|
CFLAGS += $(DEF_FLAGS)
|
|
|
|
CXXFLAGS += $(DEF_FLAGS)
|
|
|
|
|
|
|
|
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
|
|
|
|
|
|
|
Q := @
|
|
|
|
|
|
|
|
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
|
|
|
|
|
|
|
define DESKTOP_ENTRY
|
|
|
|
[Desktop Entry]
|
2020-10-26 15:24:46 +00:00
|
|
|
Name=RetroArch
|
|
|
|
Comment=Frontend for emulators, game engines
|
2020-10-01 14:54:11 +00:00
|
|
|
Exec=retroarch
|
|
|
|
Terminal=false
|
|
|
|
Type=Application
|
|
|
|
StartupNotify=true
|
|
|
|
Icon=retroarch
|
|
|
|
Categories=emulators;
|
|
|
|
X-OD-NeedsDownscaling=true
|
|
|
|
endef
|
|
|
|
export DESKTOP_ENTRY
|
|
|
|
|
|
|
|
all: $(TARGET) opk
|
|
|
|
|
|
|
|
-include $(RARCH_OBJ:.o=.d)
|
|
|
|
|
|
|
|
SYMBOL_MAP := -Wl,-Map=output.map
|
|
|
|
|
|
|
|
$(TARGET): $(RARCH_OBJ)
|
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2020-11-17 15:59:39 +00:00
|
|
|
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
2020-10-01 14:54:11 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@$(if $(Q), $(shell echo echo CC $<),)
|
2020-11-17 15:59:39 +00:00
|
|
|
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
2020-10-01 14:54:11 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.cpp
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@$(if $(Q), $(shell echo echo CXX $<),)
|
2020-11-17 15:59:39 +00:00
|
|
|
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
2020-10-01 14:54:11 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.m
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@$(if $(Q), $(shell echo echo OBJC $<),)
|
2020-11-17 15:59:39 +00:00
|
|
|
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
2020-10-01 14:54:11 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.S $(HEADERS)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@$(if $(Q), $(shell echo echo AS $<),)
|
2020-11-17 15:59:39 +00:00
|
|
|
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
2020-10-01 14:54:11 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJDIR_BASE)
|
|
|
|
rm -f $(TARGET)
|
|
|
|
rm -f *.d
|
|
|
|
rm -rf $(OPK_NAME)
|
|
|
|
|
|
|
|
opk: $(TARGET)
|
|
|
|
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
|
|
|
|
rm -f $(OPK_NAME)
|
|
|
|
cp media/ico_src/icon32.png retroarch.png
|
2021-06-27 02:08:22 +00:00
|
|
|
ifeq ($(STRIP_BIN),1)
|
|
|
|
$(STRIP) --strip-unneeded retroarch
|
|
|
|
endif
|
2020-12-02 12:07:52 +00:00
|
|
|
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
2020-10-01 14:54:11 +00:00
|
|
|
rm -f default.gcw0.desktop retroarch.png
|
|
|
|
|
|
|
|
.PHONY: all clean opk
|
|
|
|
|
|
|
|
print-%:
|
|
|
|
@echo '$*=$($*)'
|