resource.pack

This commit is contained in:
2026-04-15 23:26:43 +02:00
parent c3534ace9c
commit 0faa605ad9
35 changed files with 1537 additions and 1851 deletions

View File

@@ -3,6 +3,7 @@
# ==============================================================================
DIR_ROOT := $(dir $(abspath $(MAKEFILE_LIST)))
DIR_BIN := $(addsuffix /, $(DIR_ROOT))
DIR_PACK_TOOL := tools/pack_resources
# ==============================================================================
# TARGET NAMES
@@ -60,14 +61,23 @@ endif
# ==============================================================================
# COMPILACIÓN CON CMAKE
# ==============================================================================
all:
all: resources.pack
@cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
@cmake --build build
debug:
debug: resources.pack
@cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
@cmake --build build
# ==============================================================================
# REGLAS PARA HERRAMIENTA DE EMPAQUETADO Y RESOURCES.PACK
# ==============================================================================
pack_tool:
@$(MAKE) -C $(DIR_PACK_TOOL)
resources.pack:
@$(MAKE) -C $(DIR_PACK_TOOL) pack
# ==============================================================================
# RELEASE AUTOMÁTICO (detecta SO)
# ==============================================================================
@@ -86,6 +96,7 @@ endif
# COMPILACIÓN PARA WINDOWS (RELEASE)
# ==============================================================================
windows_release:
@$(MAKE) resources.pack
@echo off
@echo Creando release para Windows - Version: $(VERSION)
@@ -99,7 +110,8 @@ windows_release:
@powershell -Command "if (-not (Test-Path '$(RELEASE_FOLDER)')) {New-Item '$(RELEASE_FOLDER)' -ItemType Directory}"
# Copia ficheros
@powershell -Command "Copy-Item -Path 'data' -Destination '$(RELEASE_FOLDER)' -Recurse -Force"
@powershell -Command "Copy-Item 'resources.pack' -Destination '$(RELEASE_FOLDER)'"
@powershell -Command "Copy-Item 'gamecontrollerdb.txt' -Destination '$(RELEASE_FOLDER)'"
@powershell -Command "Copy-Item 'LICENSE' -Destination '$(RELEASE_FOLDER)'"
@powershell -Command "Copy-Item 'README.md' -Destination '$(RELEASE_FOLDER)'"
@powershell -Command "Copy-Item 'release\windows\dll\*.dll' -Destination '$(RELEASE_FOLDER)'"
@@ -118,6 +130,7 @@ windows_release:
# COMPILACIÓN PARA MACOS (RELEASE)
# ==============================================================================
macos_release:
@$(MAKE) resources.pack
@echo "Creando release para macOS - Version: $(VERSION)"
# Verificar e instalar create-dmg si es necesario
@@ -140,7 +153,8 @@ macos_release:
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
# Copia carpetas y ficheros
cp -R data "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp resources.pack "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp gamecontrollerdb.txt "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp -R release/macos/frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
cp release/icons/*.icns "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp release/macos/Info.plist "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents"
@@ -211,6 +225,7 @@ macos_release:
# COMPILACIÓN PARA LINUX (RELEASE)
# ==============================================================================
linux_release:
@$(MAKE) resources.pack
@echo "Creando release para Linux - Version: $(VERSION)"
# Compila con cmake
@@ -222,7 +237,8 @@ linux_release:
$(MKDIR) "$(RELEASE_FOLDER)"
# Copia ficheros
cp -R data "$(RELEASE_FOLDER)"
cp resources.pack "$(RELEASE_FOLDER)"
cp gamecontrollerdb.txt "$(RELEASE_FOLDER)"
cp LICENSE "$(RELEASE_FOLDER)"
cp README.md "$(RELEASE_FOLDER)"
cp "$(TARGET_FILE)" "$(RELEASE_FILE)"
@@ -240,6 +256,7 @@ linux_release:
# COMPILACIÓN PARA WEBASSEMBLY (requiere Docker)
# ==============================================================================
wasm:
@$(MAKE) resources.pack
@echo "Compilando para WebAssembly - Version: $(VERSION)"
docker run --rm \
--user $(shell id -u):$(shell id -g) \
@@ -295,4 +312,4 @@ help:
@echo " make show_version - Mostrar version actual ($(VERSION))"
@echo " make help - Mostrar esta ayuda"
.PHONY: all debug release windows_release macos_release linux_release wasm controllerdb show_version help
.PHONY: all debug release windows_release macos_release linux_release wasm controllerdb pack_tool resources.pack show_version help