arreglos en make y cmake
This commit is contained in:
40
Makefile
40
Makefile
@@ -30,6 +30,14 @@ endif
|
||||
PACK_SOURCES := $(DIR_TOOLS)pack_resources/pack_resources.cpp source/core/resources/resource_pack.cpp
|
||||
PACK_INCLUDES := -Isource
|
||||
|
||||
# ==============================================================================
|
||||
# SHADERS
|
||||
# ==============================================================================
|
||||
SHADER_SCRIPT := $(DIR_ROOT)tools/shaders/compile_spirv.sh
|
||||
SHADER_VERT_H := $(DIR_ROOT)source/core/rendering/sdl3gpu/postfx_vert_spv.h
|
||||
SHADER_FRAG_H := $(DIR_ROOT)source/core/rendering/sdl3gpu/postfx_frag_spv.h
|
||||
GLSLC := $(shell command -v glslc 2>/dev/null)
|
||||
|
||||
# ==============================================================================
|
||||
# VERSION (extracted from defines.hpp)
|
||||
# ==============================================================================
|
||||
@@ -157,6 +165,25 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
# ==============================================================================
|
||||
# REGLAS PARA COMPILACIÓN DE SHADERS
|
||||
# ==============================================================================
|
||||
compile_shaders:
|
||||
ifdef GLSLC
|
||||
@echo "Compilando shaders SPIR-V..."
|
||||
@$(SHADER_SCRIPT)
|
||||
@echo "✓ Shaders compilados"
|
||||
else
|
||||
@if [ -f "$(SHADER_VERT_H)" ] && [ -f "$(SHADER_FRAG_H)" ]; then \
|
||||
echo "⚠ glslc no encontrado - usando headers SPIR-V precompilados"; \
|
||||
else \
|
||||
echo "ERROR: glslc no encontrado y headers SPIR-V no existen."; \
|
||||
echo " Instala glslc: sudo apt install glslang-tools"; \
|
||||
echo " O ejecuta manualmente: tools/shaders/compile_spirv.sh"; \
|
||||
exit 1; \
|
||||
fi
|
||||
endif
|
||||
|
||||
# ==============================================================================
|
||||
# REGLAS PARA HERRAMIENTA DE EMPAQUETADO Y RESOURCES.PACK
|
||||
# ==============================================================================
|
||||
@@ -185,6 +212,7 @@ windows:
|
||||
strip -s -R .comment -R .gnu.version "$(WIN_TARGET_FILE).exe" --strip-unneeded
|
||||
|
||||
windows_release:
|
||||
@$(MAKE) compile_shaders
|
||||
@$(MAKE) resources.pack
|
||||
@echo off
|
||||
@echo Creando release para Windows - Version: $(VERSION)
|
||||
@@ -230,7 +258,7 @@ macos:
|
||||
clang++ $(ALL_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
||||
|
||||
macos_release:
|
||||
@$(MAKE) pack_tool
|
||||
@$(MAKE) compile_shaders
|
||||
@$(MAKE) resources.pack
|
||||
@echo "Creando release para macOS - Version: $(VERSION)"
|
||||
|
||||
@@ -274,7 +302,6 @@ macos_release:
|
||||
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
||||
|
||||
# Empaqueta el .dmg de la versión Intel con create-dmg
|
||||
$(MKDIR) "$(DIST_DIR)"
|
||||
@echo "Creando DMG Intel con iconos de 96x96..."
|
||||
create-dmg \
|
||||
--volname "$(APP_NAME)" \
|
||||
@@ -329,7 +356,7 @@ linux:
|
||||
strip -s -R .comment -R .gnu.version "$(TARGET_FILE)" --strip-unneeded
|
||||
|
||||
linux_release:
|
||||
@$(MAKE) pack_tool
|
||||
@$(MAKE) compile_shaders
|
||||
@$(MAKE) resources.pack
|
||||
@echo "Creando release para Linux - Version: $(VERSION)"
|
||||
|
||||
@@ -338,12 +365,9 @@ linux_release:
|
||||
@GIT_HASH=$$(git rev-parse --short=7 HEAD 2>/dev/null || echo "unknown"); \
|
||||
sed "s/@GIT_HASH@/$$GIT_HASH/g" source/version.h.in > source/version.h
|
||||
|
||||
# Elimina carpetas previas
|
||||
# Elimina carpeta temporal previa y la recrea (crea dist/ si no existe)
|
||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||
|
||||
# Crea la carpeta temporal para realizar el lanzamiento
|
||||
$(MKDIR) "$(RELEASE_FOLDER)"
|
||||
$(MKDIR) "$(DIST_DIR)"
|
||||
|
||||
# Copia ficheros
|
||||
cp resources.pack "$(RELEASE_FOLDER)"
|
||||
@@ -387,4 +411,4 @@ help:
|
||||
|
||||
FORCE:
|
||||
|
||||
.PHONY: windows windows_release macos macos_release linux linux_release pack_tool resources.pack show_version help
|
||||
.PHONY: windows windows_release macos macos_release linux linux_release compile_shaders pack_tool resources.pack show_version help
|
||||
|
||||
Reference in New Issue
Block a user