**Problema:** Inconsistencia entre Makefile y Info.plist - Info.plist declaraba 10.15 (Catalina) - Makefile compilaba para 11.0 (Big Sur) en Apple Silicon - Makefile compilaba para 10.15 en Intel **Solución:** Unificar todo a macOS 12.0 (Monterey, 2021) - Info.plist: LSMinimumSystemVersion 10.15 → 12.0 - Makefile arm64: -target arm64-apple-macos11 → macos12 - Makefile x86_64: -target x86_64-apple-macos10.15 → macos12 **Resultado:** ✅ Ambos archivos sincronizados (declaran 12.0) ✅ Elimina soporte para macOS 10.15 y 11.0 ✅ Optimizaciones del compilador para Monterey+ ✅ Warning cambiará a "building for macOS-12.0" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
431 lines
20 KiB
Makefile
431 lines
20 KiB
Makefile
# Directorios
|
|
DIR_ROOT := $(dir $(abspath $(MAKEFILE_LIST)))
|
|
DIR_SOURCES := $(addsuffix /, $(DIR_ROOT)source)
|
|
DIR_BIN := $(addsuffix /, $(DIR_ROOT))
|
|
DIR_BUILD := $(addsuffix /, $(DIR_ROOT)build)
|
|
DIR_TOOLS := $(addsuffix /, $(DIR_ROOT)tools)
|
|
|
|
# Variables
|
|
TARGET_NAME := vibe3_physics
|
|
TARGET_FILE := $(DIR_BIN)$(TARGET_NAME)
|
|
APP_NAME := ViBe3 Physics
|
|
RELEASE_FOLDER := vibe3_release
|
|
RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME)
|
|
RESOURCE_FILE := release/vibe3.res
|
|
|
|
# Variables para herramienta de empaquetado
|
|
ifeq ($(OS),Windows_NT)
|
|
PACK_TOOL := $(DIR_TOOLS)pack_resources.exe
|
|
PACK_CXX := $(CXX)
|
|
else
|
|
PACK_TOOL := $(DIR_TOOLS)pack_resources
|
|
PACK_CXX := $(CXX)
|
|
endif
|
|
PACK_SOURCES := $(DIR_TOOLS)pack_resources.cpp $(DIR_SOURCES)resource_pack.cpp
|
|
PACK_INCLUDES := -I$(DIR_ROOT)
|
|
|
|
# Versión automática basada en la fecha actual (específica por SO)
|
|
ifeq ($(OS),Windows_NT)
|
|
VERSION := $(shell powershell -Command "Get-Date -Format 'yyyy-MM-dd'")
|
|
else
|
|
VERSION := $(shell date +%Y-%m-%d)
|
|
endif
|
|
|
|
# Variables específicas para Windows (usando APP_NAME)
|
|
ifeq ($(OS),Windows_NT)
|
|
WIN_TARGET_FILE := $(DIR_BIN)$(APP_NAME)
|
|
WIN_RELEASE_FILE := $(RELEASE_FOLDER)/$(APP_NAME)
|
|
else
|
|
WIN_TARGET_FILE := $(TARGET_FILE)
|
|
WIN_RELEASE_FILE := $(RELEASE_FILE)
|
|
endif
|
|
|
|
# Nombres para los ficheros de lanzamiento
|
|
WINDOWS_RELEASE := $(TARGET_NAME)-$(VERSION)-win32-x64.zip
|
|
MACOS_INTEL_RELEASE := $(TARGET_FILE)-$(VERSION)-macos-intel.dmg
|
|
MACOS_APPLE_SILICON_RELEASE := $(TARGET_FILE)-$(VERSION)-macos-apple-silicon.dmg
|
|
LINUX_RELEASE := $(TARGET_FILE)-$(VERSION)-linux.tar.gz
|
|
RASPI_RELEASE := $(TARGET_FILE)-$(VERSION)-raspberry.tar.gz
|
|
|
|
# Lista completa de archivos fuente (detección automática con wildcards, como CMakeLists.txt)
|
|
APP_SOURCES := $(wildcard source/*.cpp) \
|
|
$(wildcard source/external/*.cpp) \
|
|
$(wildcard source/shapes/*.cpp) \
|
|
$(wildcard source/themes/*.cpp) \
|
|
$(wildcard source/state/*.cpp) \
|
|
$(wildcard source/input/*.cpp) \
|
|
$(wildcard source/scene/*.cpp) \
|
|
$(wildcard source/shapes_mgr/*.cpp) \
|
|
$(wildcard source/boids_mgr/*.cpp) \
|
|
$(wildcard source/text/*.cpp) \
|
|
$(wildcard source/ui/*.cpp)
|
|
|
|
# Excluir archivos antiguos si existen
|
|
APP_SOURCES := $(filter-out source/main_old.cpp, $(APP_SOURCES))
|
|
|
|
# Includes
|
|
INCLUDES := -Isource -Isource/external
|
|
|
|
# Variables según el sistema operativo
|
|
ifeq ($(OS),Windows_NT)
|
|
FixPath = $(subst /,\\,$1)
|
|
CXXFLAGS := -std=c++20 -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -static-libgcc -Wl,-Bstatic -lpthread -Wl,-Bdynamic -Wl,-subsystem,windows -DWINDOWS_BUILD
|
|
CXXFLAGS_DEBUG := -std=c++20 -Wall -g -D_DEBUG -DWINDOWS_BUILD
|
|
LDFLAGS := -lmingw32 -lws2_32 -lSDL3 -lopengl32
|
|
RM := del /Q
|
|
MKDIR := mkdir
|
|
else
|
|
FixPath = $1
|
|
CXXFLAGS := -std=c++20 -Wall -Os -ffunction-sections -fdata-sections
|
|
CXXFLAGS_DEBUG := -std=c++20 -Wall -g -D_DEBUG
|
|
LDFLAGS := -lSDL3 -lSDL3_ttf
|
|
RMFILE := rm -f
|
|
RMDIR := rm -rdf
|
|
MKDIR := mkdir -p
|
|
UNAME_S := $(shell uname -s)
|
|
ifeq ($(UNAME_S),Linux)
|
|
CXXFLAGS += -DLINUX_BUILD
|
|
LDFLAGS += -lGL
|
|
endif
|
|
ifeq ($(UNAME_S),Darwin)
|
|
CXXFLAGS += -Wno-deprecated -DMACOS_BUILD
|
|
CXXFLAGS_DEBUG += -Wno-deprecated -DMACOS_BUILD
|
|
LDFLAGS += -framework OpenGL
|
|
# Configurar arquitectura (por defecto arm64, como en CMake)
|
|
CXXFLAGS += -arch arm64
|
|
CXXFLAGS_DEBUG += -arch arm64
|
|
endif
|
|
endif
|
|
|
|
# Reglas para herramienta de empaquetado y resources.pack
|
|
$(PACK_TOOL): $(PACK_SOURCES)
|
|
@echo "Compilando herramienta de empaquetado..."
|
|
$(PACK_CXX) -std=c++17 -Wall -Os $(PACK_INCLUDES) $(PACK_SOURCES) -o $(PACK_TOOL)
|
|
@echo "✓ Herramienta de empaquetado lista: $(PACK_TOOL)"
|
|
|
|
pack_tool: $(PACK_TOOL)
|
|
|
|
resources.pack: $(PACK_TOOL)
|
|
@echo "Generando resources.pack desde directorio data/..."
|
|
$(PACK_TOOL) data resources.pack
|
|
@echo "✓ resources.pack generado exitosamente"
|
|
|
|
# Reglas para compilación
|
|
windows:
|
|
@echo off
|
|
@echo Compilando para Windows con nombre: "$(APP_NAME).exe"
|
|
windres release/vibe3.rc -O coff -o $(RESOURCE_FILE)
|
|
$(CXX) $(APP_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_TARGET_FILE).exe"
|
|
strip -s -R .comment -R .gnu.version "$(WIN_TARGET_FILE).exe" --strip-unneeded
|
|
|
|
windows_rec:
|
|
@echo off
|
|
@echo Compilando version de grabacion para Windows: "$(APP_NAME)_rec.exe"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DRECORDING $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_rec.exe"
|
|
|
|
windows_debug:
|
|
@echo off
|
|
@echo Compilando version debug para Windows: "$(APP_NAME)_debug.exe"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_debug.exe"
|
|
|
|
windows_release: resources.pack
|
|
@echo "Creando release para Windows - Version: $(VERSION)"
|
|
|
|
# Crea carpeta temporal 'RELEASE_FOLDER'
|
|
@if exist "$(RELEASE_FOLDER)" rmdir /S /Q "$(RELEASE_FOLDER)"
|
|
@mkdir "$(RELEASE_FOLDER)"
|
|
|
|
# Copia el archivo 'resources.pack'
|
|
@copy /Y "resources.pack" "$(RELEASE_FOLDER)\" >nul
|
|
|
|
# Copia los ficheros que estan en la raíz del proyecto
|
|
@copy /Y "LICENSE" "$(RELEASE_FOLDER)\" >nul 2>&1 || echo LICENSE not found (optional)
|
|
@copy /Y "README.md" "$(RELEASE_FOLDER)\" >nul
|
|
@copy /Y release\*.dll "$(RELEASE_FOLDER)\" >nul 2>&1 || echo DLLs copied successfully
|
|
|
|
# Compila
|
|
@windres release/vibe3.rc -O coff -o $(RESOURCE_FILE)
|
|
@$(CXX) $(APP_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_RELEASE_FILE).exe"
|
|
@strip -s -R .comment -R .gnu.version "$(WIN_RELEASE_FILE).exe" --strip-unneeded
|
|
|
|
# Crea el fichero .zip
|
|
@if exist "$(WINDOWS_RELEASE)" del /Q "$(WINDOWS_RELEASE)"
|
|
@powershell.exe -Command "Compress-Archive -Path '$(RELEASE_FOLDER)/*' -DestinationPath '$(WINDOWS_RELEASE)' -Force"
|
|
@echo "Release creado: $(WINDOWS_RELEASE)"
|
|
|
|
# Elimina la carpeta temporal 'RELEASE_FOLDER'
|
|
@rmdir /S /Q "$(RELEASE_FOLDER)"
|
|
|
|
macos:
|
|
@echo "Compilando para macOS: $(TARGET_NAME)"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
|
|
|
macos_debug:
|
|
@echo "Compilando version debug para macOS: $(TARGET_NAME)_debug"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
|
|
|
macos_release: resources.pack
|
|
@echo "Creando release para macOS - Version: $(VERSION)"
|
|
# Elimina datos de compilaciones anteriores
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
$(RMDIR) Frameworks
|
|
$(RMFILE) tmp.dmg
|
|
$(RMFILE) "$(MACOS_INTEL_RELEASE)"
|
|
$(RMFILE) "$(MACOS_APPLE_SILICON_RELEASE)"
|
|
|
|
# Crea la carpeta temporal para hacer el trabajo y las carpetas obligatorias para crear una app de macos
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS"
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
|
$(MKDIR) Frameworks
|
|
|
|
# Copia carpetas y ficheros
|
|
cp resources.pack "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
|
cp -R release/frameworks/SDL3.xcframework "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
|
|
cp -R release/frameworks/SDL3_ttf.xcframework "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
|
|
cp -R release/frameworks/SDL3.xcframework Frameworks
|
|
cp -R release/frameworks/SDL3_ttf.xcframework Frameworks
|
|
cp release/*.icns "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
|
cp release/Info.plist "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents"
|
|
cp LICENSE "$(RELEASE_FOLDER)"
|
|
cp README.md "$(RELEASE_FOLDER)"
|
|
|
|
# Crea enlaces
|
|
ln -s /Applications "$(RELEASE_FOLDER)"/Applications
|
|
|
|
# Compila la versión para procesadores Intel
|
|
ifdef ENABLE_MACOS_X86_64
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DMACOS_BUNDLE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos12
|
|
|
|
# Firma la aplicación
|
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
|
|
|
# Empaqueta el .dmg de la versión Intel
|
|
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
|
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_INTEL_RELEASE)"
|
|
$(RMFILE) tmp.dmg
|
|
@echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"
|
|
endif
|
|
|
|
# Compila la versión para procesadores Apple Silicon
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DMACOS_BUNDLE -DSDL_DISABLE_IMMINTRIN_H $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos12
|
|
|
|
# Firma la aplicación
|
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
|
|
|
# Empaqueta el .dmg de la versión Apple Silicon
|
|
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
|
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_APPLE_SILICON_RELEASE)"
|
|
$(RMFILE) tmp.dmg
|
|
@echo "Release Apple Silicon creado: $(MACOS_APPLE_SILICON_RELEASE)"
|
|
|
|
# Elimina las carpetas temporales
|
|
$(RMDIR) Frameworks
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
linux:
|
|
@echo "Compilando para Linux: $(TARGET_NAME)"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
|
strip -s -R .comment -R .gnu.version "$(TARGET_FILE)" --strip-unneeded
|
|
|
|
linux_debug:
|
|
@echo "Compilando version debug para Linux: $(TARGET_NAME)_debug"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
|
|
|
linux_release: resources.pack
|
|
@echo "Creando release para Linux - Version: $(VERSION)"
|
|
# Elimina carpetas previas
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
# Crea la carpeta temporal para realizar el lanzamiento
|
|
$(MKDIR) "$(RELEASE_FOLDER)"
|
|
|
|
# Copia ficheros
|
|
cp resources.pack "$(RELEASE_FOLDER)"
|
|
cp LICENSE "$(RELEASE_FOLDER)"
|
|
cp README.md "$(RELEASE_FOLDER)"
|
|
|
|
# Compila
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
|
|
|
# Empaqueta ficheros
|
|
$(RMFILE) "$(LINUX_RELEASE)"
|
|
tar -czvf "$(LINUX_RELEASE)" -C "$(RELEASE_FOLDER)" .
|
|
@echo "Release creado: $(LINUX_RELEASE)"
|
|
|
|
# Elimina la carpeta temporal
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
linux_release_desktop: resources.pack
|
|
@echo "Creando release con integracion desktop para Linux - Version: $(VERSION)"
|
|
# Elimina carpetas previas
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
# Crea la estructura de directorios estándar para Linux
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)"
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/bin"
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications"
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps"
|
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/$(TARGET_NAME)"
|
|
|
|
# Copia ficheros del juego
|
|
cp resources.pack "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/$(TARGET_NAME)/"
|
|
cp LICENSE "$(RELEASE_FOLDER)/$(TARGET_NAME)/"
|
|
cp README.md "$(RELEASE_FOLDER)/$(TARGET_NAME)/"
|
|
|
|
# Compila el ejecutable
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(TARGET_NAME)/bin/$(TARGET_NAME)"
|
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FOLDER)/$(TARGET_NAME)/bin/$(TARGET_NAME)" --strip-unneeded
|
|
|
|
# Crea el archivo .desktop
|
|
@echo '[Desktop Entry]' > "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Version=1.0' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Type=Application' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Name=$(APP_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Comment=Arcade action game - defend Earth from alien invasion!' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Exec=/opt/$(TARGET_NAME)/bin/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Icon=$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Path=/opt/$(TARGET_NAME)/share/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Terminal=false' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'StartupNotify=true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Categories=Game;ArcadeGame;' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
@echo 'Keywords=arcade;action;shooter;retro;' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
|
|
|
# Copia el icono (si existe) y lo redimensiona si es necesario
|
|
@if [ -f "release/icon.png" ]; then \
|
|
if command -v magick >/dev/null 2>&1; then \
|
|
magick "release/icon.png" -resize 256x256 "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
|
echo "Icono redimensionado de release/icon.png (usando ImageMagick)"; \
|
|
elif command -v convert >/dev/null 2>&1; then \
|
|
convert "release/icon.png" -resize 256x256 "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
|
echo "Icono redimensionado de release/icon.png (usando ImageMagick legacy)"; \
|
|
elif command -v ffmpeg >/dev/null 2>&1; then \
|
|
ffmpeg -i "release/icon.png" -vf scale=256:256 "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png" -y -loglevel quiet; \
|
|
echo "Icono redimensionado de release/icon.png (usando ffmpeg)"; \
|
|
else \
|
|
cp "release/icon.png" "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
|
echo "Icono copiado sin redimensionar (instalar ImageMagick o ffmpeg para redimensionado automatico)"; \
|
|
fi; \
|
|
elif [ -f "release/coffee.png" ]; then \
|
|
cp "release/coffee.png" "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
|
echo "Icono copiado desde release/coffee.png"; \
|
|
else \
|
|
echo "Advertencia: No se encontró release/icon.png ni release/coffee.png - crear icono manualmente"; \
|
|
fi
|
|
|
|
# Crea script de instalación
|
|
@echo '#!/bin/bash' > "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'echo "Instalando $(APP_NAME)..."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo mkdir -p /opt/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo cp -R bin /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo cp -R share /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo cp LICENSE /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo cp README.md /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo mkdir -p /usr/share/applications' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo mkdir -p /usr/share/icons/hicolor/256x256/apps' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo cp /opt/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop /usr/share/applications/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo cp /opt/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png /usr/share/icons/hicolor/256x256/apps/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo update-desktop-database /usr/share/applications 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'sudo gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'echo "$(APP_NAME) instalado correctamente!"' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
@echo 'echo "Ya puedes encontrarlo en el menu de aplicaciones en la categoria Juegos."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
chmod +x "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
|
|
|
# Crea script de desinstalación
|
|
@echo '#!/bin/bash' > "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'echo "Desinstalando $(APP_NAME)..."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'sudo rm -rf /opt/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'sudo rm -f /usr/share/applications/$(TARGET_NAME).desktop' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'sudo rm -f /usr/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'sudo update-desktop-database /usr/share/applications 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'sudo gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
@echo 'echo "$(APP_NAME) desinstalado correctamente."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
chmod +x "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
|
|
|
# Empaqueta ficheros
|
|
$(RMFILE) "$(TARGET_NAME)-$(VERSION)-linux-desktop.tar.gz"
|
|
tar -czvf "$(TARGET_NAME)-$(VERSION)-linux-desktop.tar.gz" -C "$(RELEASE_FOLDER)" .
|
|
@echo "Release con integracion desktop creado: $(TARGET_NAME)-$(VERSION)-linux-desktop.tar.gz"
|
|
@echo "Para instalar: extraer y ejecutar ./$(TARGET_NAME)/install.sh"
|
|
|
|
# Elimina la carpeta temporal
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
raspi:
|
|
@echo "Compilando para Raspberry Pi: $(TARGET_NAME)"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(TARGET_FILE)
|
|
strip -s -R .comment -R .gnu.version $(TARGET_FILE) --strip-unneeded
|
|
|
|
raspi_debug:
|
|
@echo "Compilando version debug para Raspberry Pi: $(TARGET_NAME)_debug"
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE -DDEBUG $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
|
|
|
raspi_release: resources.pack
|
|
@echo "Creando release para Raspberry Pi - Version: $(VERSION)"
|
|
# Elimina carpetas previas
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
# Crea la carpeta temporal para realizar el lanzamiento
|
|
$(MKDIR) "$(RELEASE_FOLDER)"
|
|
|
|
# Copia ficheros
|
|
cp resources.pack "$(RELEASE_FOLDER)"
|
|
cp LICENSE "$(RELEASE_FOLDER)"
|
|
cp README.md "$(RELEASE_FOLDER)"
|
|
|
|
# Compila
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
|
|
|
# Empaqueta ficheros
|
|
$(RMFILE) "$(RASPI_RELEASE)"
|
|
tar -czvf "$(RASPI_RELEASE)" -C "$(RELEASE_FOLDER)" .
|
|
@echo "Release creado: $(RASPI_RELEASE)"
|
|
|
|
# Elimina la carpeta temporal
|
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
|
|
|
anbernic: resources.pack
|
|
@echo "Compilando para Anbernic: $(TARGET_NAME)"
|
|
# Elimina carpetas previas
|
|
$(RMDIR) "$(RELEASE_FOLDER)"_anbernic
|
|
|
|
# Crea la carpeta temporal para realizar el lanzamiento
|
|
$(MKDIR) "$(RELEASE_FOLDER)"_anbernic
|
|
|
|
# Copia ficheros
|
|
cp resources.pack "$(RELEASE_FOLDER)"_anbernic
|
|
|
|
# Compila
|
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DANBERNIC -DNO_SHADERS -DARCADE -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(RELEASE_FOLDER)_anbernic/$(TARGET_NAME)
|
|
|
|
# Opción para deshabilitar audio (equivalente a la opción DISABLE_AUDIO de CMake)
|
|
no_audio:
|
|
@echo "Compilando sin audio: $(TARGET_NAME)_no_audio"
|
|
$(CXX) $(filter-out source/external/jail_audio.cpp,$(APP_SOURCES)) $(INCLUDES) -DNO_AUDIO $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)_no_audio"
|
|
|
|
# Regla para mostrar la versión actual
|
|
show_version:
|
|
@echo "Version actual: $(VERSION)"
|
|
|
|
# Regla de ayuda
|
|
help:
|
|
@echo "Makefile para ViBe3 Physics"
|
|
@echo "Comandos disponibles:"
|
|
@echo " windows - Compilar para Windows"
|
|
@echo " windows_debug - Compilar debug para Windows"
|
|
@echo " windows_release - Crear release completo para Windows (.zip)"
|
|
@echo " linux - Compilar para Linux"
|
|
@echo " linux_debug - Compilar debug para Linux"
|
|
@echo " linux_release - Crear release basico para Linux (.tar.gz)"
|
|
@echo " linux_release_desktop - Crear release con integracion desktop para Linux"
|
|
@echo " macos - Compilar para macOS"
|
|
@echo " macos_debug - Compilar debug para macOS"
|
|
@echo " macos_release - Crear release completo para macOS (.dmg)"
|
|
@echo " pack_tool - Compilar herramienta de empaquetado"
|
|
@echo " resources.pack - Generar pack de recursos desde data/"
|
|
@echo " show_version - Mostrar version actual ($(VERSION))"
|
|
@echo " help - Mostrar esta ayuda"
|
|
|
|
.PHONY: windows windows_rec windows_debug windows_release macos macos_debug macos_release linux linux_debug linux_release linux_release_desktop raspi raspi_debug raspi_release anbernic no_audio show_version help pack_tool |