correccions en el Makefile de windows

This commit is contained in:
2025-11-23 21:49:33 +01:00
parent ea30c24f7f
commit 4aa6693f51
4 changed files with 11 additions and 5 deletions

View File

@@ -9,8 +9,13 @@ DIR_TOOLS := $(addsuffix /, $(DIR_ROOT)tools)
# ==============================================================================
# TARGET NAMES (extraídos de CMakeLists.txt)
# ==============================================================================
ifeq ($(OS),Windows_NT)
TARGET_NAME := $(shell powershell -Command "$$line = Get-Content CMakeLists.txt | Where-Object {$$_ -match '^project'}; if ($$line -match 'project\s*\x28(\w+)') { $$matches[1] }")
LONG_NAME := $(shell powershell -Command "$$line = Get-Content CMakeLists.txt | Where-Object {$$_ -match 'PROJECT_LONG_NAME'}; if ($$line -match '\"(.+)\"') { $$matches[1] }")
else
TARGET_NAME := $(shell awk '/^project/ {gsub(/[)(]/, " "); print $$2}' CMakeLists.txt)
LONG_NAME := $(shell grep 'PROJECT_LONG_NAME' CMakeLists.txt | sed 's/.*"\(.*\)".*/\1/')
endif
TARGET_FILE := $(DIR_BIN)$(TARGET_NAME)
APP_NAME := $(LONG_NAME)
RELEASE_FOLDER := $(TARGET_NAME)_release
@@ -180,7 +185,8 @@ windows:
windows_debug:
@echo off
@echo Compilando version debug para Windows: "$(WIN_TARGET_FILE)_debug.exe"
g++ $(ALL_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_debug.exe"
windres release/$(TARGET_NAME).rc -O coff -o $(RESOURCE_FILE)
g++ $(ALL_SOURCES) $(RESOURCE_FILE) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_debug.exe"
windows_release:
@$(MAKE) pack_tool
@@ -203,7 +209,7 @@ windows_release:
powershell Copy-Item "LICENSE" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "README.md" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "gamecontrollerdb.txt" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "release\*.dll" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "release\dll\*.dll" -Destination "$(RELEASE_FOLDER)"
# Compila (con icono)
windres release/$(TARGET_NAME).rc -O coff -o $(RESOURCE_FILE)

Binary file not shown.

View File

@@ -5,5 +5,5 @@ constexpr const char* NAME = "pollo";
constexpr const char* LONG_NAME = "Los pollos hermanos";
constexpr const char* VERSION = "0.1";
constexpr const char* COPYRIGHT = "@2025 JailDesigner";
constexpr const char* GIT_HASH = "cb26e71";
constexpr const char* GIT_HASH = "ea30c24";
} // namespace Project