mirror of
https://github.com/libretro/Libretro-Supermodel.git
synced 2026-11-07 11:15:58 -10:00
Archive old platform-specific Makefiles for reference
- Move Makefile.{android,common,osx,rpi64,unix,windows} to Makefiles/old_unified_makefile_backup/
- Create Makefile.backup.old as reference copy
- Old build configuration now available for historical reference
This commit is contained in:
1 parent
fc90855b11
commit
d412b6d672
7 files changed
+131
-7
No files matched your search
@@ -0,0 +1,105 @@
|
||||
# --- Global Variables ---
|
||||
DEBUG ?= 0
|
||||
PSS_STYLE ?= 1
|
||||
EXTERNAL_ZLIB ?= 0
|
||||
HAVE_GRIFFIN ?= 1
|
||||
STATIC_LINKING ?= 0
|
||||
CORE_DIR := .
|
||||
TARGET_NAME := supermodel
|
||||
|
||||
# --- Platform Detection ---
|
||||
ifeq ($(platform),)
|
||||
platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
platform = win
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
platform = osx
|
||||
else ifneq ($(findstring win,$(shell uname -a)),)
|
||||
platform = win
|
||||
endif
|
||||
endif
|
||||
|
||||
# --- Include Common Sources FIRST ---
|
||||
# This populates SOURCES_C, SOURCES_CXX and base INCFLAGS
|
||||
include Makefile.common
|
||||
|
||||
# --- Include Platform Specifics SECOND ---
|
||||
# This allows Windows/Unix/OSX files to APPEND to INCFLAGS and set CC/CXX/OBJOUT
|
||||
ifneq (,$(findstring msvc,$(platform)))
|
||||
include Makefile.windows
|
||||
else ifneq (,$(findstring win,$(platform)))
|
||||
include Makefile.windows
|
||||
else ifneq (,$(findstring osx,$(platform)))
|
||||
include Makefile.osx
|
||||
else ifneq (,$(findstring android,$(platform)))
|
||||
include Makefile.android
|
||||
else ifneq (,$(findstring rpi5,$(platform)))
|
||||
include Makefile.rpi64
|
||||
else ifneq (,$(findstring rpi4-64,$(platform)))
|
||||
include Makefile.rpi64
|
||||
else ifneq (,$(findstring rpi64,$(platform)))
|
||||
include Makefile.rpi64
|
||||
else
|
||||
include Makefile.unix
|
||||
endif
|
||||
|
||||
# --- Safety Defaults (In case platform files miss them) ---
|
||||
OBJOUT ?= -o
|
||||
LINKOUT ?= -o
|
||||
|
||||
# --- Flag Assembly ---
|
||||
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
|
||||
ifneq ($(GIT_VERSION)," unknown")
|
||||
DEFINES += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
OBJECTS := $(SOURCES_C:.c=.o) $(SOURCES_CXX:.cpp=.o)
|
||||
|
||||
# Combine defines from common file and platform settings
|
||||
# Use += to ensure we don't wipe out GLEW_STATIC or other Windows flags
|
||||
DEFINES += $(COREDEFINES) $(PLATFORM_DEFINES) -DSUPERMODEL_OSD_LIBRETRO
|
||||
|
||||
ifeq ($(STATIC_LINKING),1)
|
||||
DEFINES += -DSTATIC_LINKING
|
||||
endif
|
||||
|
||||
ifeq ($(platform), sncps3)
|
||||
WARNING_DEFINES =
|
||||
else ifneq (,$(findstring msvc,$(platform)))
|
||||
WARNING_DEFINES =
|
||||
LIBM :=
|
||||
else
|
||||
WARNING_DEFINES = -Wno-write-strings
|
||||
endif
|
||||
|
||||
CFLAGS += $(fpic) $(WARNING_DEFINES) $(DEFINES)
|
||||
CXXFLAGS += $(fpic) $(WARNING_DEFINES) $(DEFINES)
|
||||
LDFLAGS += $(LIBM)
|
||||
|
||||
# --- Build Rules ---
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
ifeq ($(STATIC_LINKING),1)
|
||||
ifneq (,$(findstring msvc,$(platform)))
|
||||
$(LD) $(LINKOUT)$@ $(OBJECTS)
|
||||
else
|
||||
$(AR) rcs $@ $(OBJECTS)
|
||||
endif
|
||||
else
|
||||
$(LD) $(LINKOUT)$@ $(SHARED) $(OBJECTS) $(LDFLAGS) $(LIBS)
|
||||
endif
|
||||
|
||||
# THE FIX: Note the absence of space between $(OBJOUT) and $@
|
||||
%.o: %.cpp
|
||||
$(CXX) -c $(OBJOUT)$@ $< $(CXXFLAGS) $(INCFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(OBJOUT)$@ $< $(CFLAGS) $(INCFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS)
|
||||
|
||||
.PHONY: clean
|
||||
File renamed without changes.
File renamed without changes.
@@ -18,17 +18,36 @@ ifeq ($(platform), osx)
|
||||
fpic := -fPIC
|
||||
SHARED := -dynamiclib
|
||||
|
||||
# --- Toolchain Detection ---
|
||||
# --- Toolchain Detection & Auto-Setup ---
|
||||
# For native macOS builds
|
||||
ifeq ($(shell uname -s),Darwin)
|
||||
CC ?= clang
|
||||
CXX ?= clang++
|
||||
CLANG_CMD := clang
|
||||
else
|
||||
# Cross-compile from Linux
|
||||
CC ?= clang
|
||||
CXX ?= clang++
|
||||
CLANG_CMD := clang
|
||||
# Cross-compile from Linux using osxcross
|
||||
# Auto-detect osxcross installation at /opt/osxcross
|
||||
OSXCROSS_ROOT ?= /opt/osxcross
|
||||
|
||||
ifeq ($(shell test -f $(OSXCROSS_ROOT)/target/bin/o64-clang && echo found),found)
|
||||
# osxcross found at $(OSXCROSS_ROOT)
|
||||
# Override CC/CXX to use osxcross (prevents system cc from being used)
|
||||
override CC := $(OSXCROSS_ROOT)/target/bin/o64-clang
|
||||
override CXX := $(OSXCROSS_ROOT)/target/bin/o64-clang++
|
||||
CLANG_CMD := $(OSXCROSS_ROOT)/target/bin/o64-clang
|
||||
override LD := $(OSXCROSS_ROOT)/target/bin/o64-clang++
|
||||
|
||||
# Ensure osxcross tools are in PATH for the build process
|
||||
export PATH := $(OSXCROSS_ROOT)/target/bin:$(PATH)
|
||||
|
||||
# Auto-set MACOSX_SDK if not already set
|
||||
ifeq ($(MACOSX_SDK),)
|
||||
MACOSX_SDK := $(OSXCROSS_ROOT)/target/SDK/MacOSX12.0.sdk
|
||||
endif
|
||||
else
|
||||
# osxcross not found - give helpful error message
|
||||
$(error osxcross not found at $(OSXCROSS_ROOT). Please install osxcross there, or override with: make platform=osx OSXCROSS_ROOT=/path/to/osxcross)
|
||||
endif
|
||||
endif
|
||||
|
||||
LD := $(CXX)
|
||||
@@ -63,7 +82,7 @@ ifeq ($(platform), osx)
|
||||
LIBS := -framework OpenGL -framework CoreFoundation -lz
|
||||
|
||||
# --- FileSystem Path Implementation ---
|
||||
SOURCES_CXX += $(CORE_DIR)/Src/OSD/Unix/FileSystemPath.cpp
|
||||
SOURCES_CXX += $(CORE_DIR)/Src/OSD/OSX/FileSystemPath.cpp
|
||||
|
||||
# macOS doesn't support Legacy3D (old fixed-pipeline OpenGL)
|
||||
# Modern macOS requires at least OpenGL 3.2 which doesn't have fixed-pipeline functions
|
||||
@@ -3,7 +3,7 @@ CC = aarch64-linux-gnu-gcc
|
||||
CXX = aarch64-linux-gnu-g++
|
||||
LD = aarch64-linux-gnu-g++
|
||||
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
TARGET := $(TARGET_NAME)_libretro_aarch64.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T -Wl,-no-undefined
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user