fix: evitar error 'ruta no encontrada' en Windows con find
En Windows, `find` es un comando de cmd distinto al de Unix, causando el error "El sistema no puede encontrar la ruta especificada" al evaluar DATA_FILES. Se condiciona el uso de find solo en sistemas no-Windows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17
Makefile
17
Makefile
@@ -9,9 +9,9 @@ DIR_TOOLS := $(addsuffix /, $(DIR_ROOT)tools)
|
|||||||
TARGET_NAME := vibe3_physics
|
TARGET_NAME := vibe3_physics
|
||||||
TARGET_FILE := $(DIR_BIN)$(TARGET_NAME)
|
TARGET_FILE := $(DIR_BIN)$(TARGET_NAME)
|
||||||
APP_NAME := ViBe3 Physics
|
APP_NAME := ViBe3 Physics
|
||||||
RELEASE_FOLDER := vibe3_release
|
RELEASE_FOLDER := dist/_tmp
|
||||||
RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME)
|
RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME)
|
||||||
RESOURCE_FILE := release/windows/vibe3.res
|
RESOURCE_FILE := build/vibe3.res
|
||||||
DIST_DIR := dist
|
DIST_DIR := dist
|
||||||
|
|
||||||
# Variables para herramienta de empaquetado
|
# Variables para herramienta de empaquetado
|
||||||
@@ -66,7 +66,7 @@ APP_SOURCES := $(wildcard source/*.cpp) \
|
|||||||
APP_SOURCES := $(filter-out source/main_old.cpp, $(APP_SOURCES))
|
APP_SOURCES := $(filter-out source/main_old.cpp, $(APP_SOURCES))
|
||||||
|
|
||||||
# Includes
|
# Includes
|
||||||
INCLUDES := -Isource -Isource/external
|
INCLUDES := -Isource -Isource/external -Ibuild/generated_shaders
|
||||||
|
|
||||||
# Variables según el sistema operativo
|
# Variables según el sistema operativo
|
||||||
CXXFLAGS_BASE := -std=c++20 -Wall
|
CXXFLAGS_BASE := -std=c++20 -Wall
|
||||||
@@ -107,7 +107,11 @@ $(PACK_TOOL): $(PACK_SOURCES)
|
|||||||
pack_tool: $(PACK_TOOL)
|
pack_tool: $(PACK_TOOL)
|
||||||
|
|
||||||
# Detectar todos los archivos en data/ como dependencias (regenera si cualquiera cambia)
|
# Detectar todos los archivos en data/ como dependencias (regenera si cualquiera cambia)
|
||||||
DATA_FILES := $(shell find data -type f 2>/dev/null)
|
ifeq ($(OS),Windows_NT)
|
||||||
|
DATA_FILES :=
|
||||||
|
else
|
||||||
|
DATA_FILES := $(shell find data -type f 2>/dev/null)
|
||||||
|
endif
|
||||||
|
|
||||||
resources.pack: $(PACK_TOOL) $(DATA_FILES)
|
resources.pack: $(PACK_TOOL) $(DATA_FILES)
|
||||||
@echo "Generando resources.pack desde directorio data/..."
|
@echo "Generando resources.pack desde directorio data/..."
|
||||||
@@ -123,8 +127,7 @@ force_resource_pack: $(PACK_TOOL)
|
|||||||
|
|
||||||
# Reglas para compilación
|
# Reglas para compilación
|
||||||
windows:
|
windows:
|
||||||
@echo off
|
@echo Compilando para Windows con nombre: $(APP_NAME).exe
|
||||||
@echo Compilando para Windows con nombre: "$(APP_NAME).exe"
|
|
||||||
windres release/windows/vibe3.rc -O coff -o $(RESOURCE_FILE)
|
windres release/windows/vibe3.rc -O coff -o $(RESOURCE_FILE)
|
||||||
$(CXX) $(APP_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_TARGET_FILE).exe"
|
$(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
|
strip -s -R .comment -R .gnu.version "$(WIN_TARGET_FILE).exe" --strip-unneeded
|
||||||
@@ -134,6 +137,7 @@ windows_release: force_resource_pack
|
|||||||
|
|
||||||
# Crea carpeta temporal 'RELEASE_FOLDER'
|
# Crea carpeta temporal 'RELEASE_FOLDER'
|
||||||
@if exist "$(RELEASE_FOLDER)" rmdir /S /Q "$(RELEASE_FOLDER)"
|
@if exist "$(RELEASE_FOLDER)" rmdir /S /Q "$(RELEASE_FOLDER)"
|
||||||
|
@if not exist "$(DIST_DIR)" mkdir "$(DIST_DIR)"
|
||||||
@mkdir "$(RELEASE_FOLDER)"
|
@mkdir "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
# Copia el archivo 'resources.pack'
|
# Copia el archivo 'resources.pack'
|
||||||
@@ -145,7 +149,6 @@ windows_release: force_resource_pack
|
|||||||
@copy /Y release\windows\dll\*.dll "$(RELEASE_FOLDER)\" >nul 2>&1 || echo DLLs copied successfully
|
@copy /Y release\windows\dll\*.dll "$(RELEASE_FOLDER)\" >nul 2>&1 || echo DLLs copied successfully
|
||||||
|
|
||||||
# Compila
|
# Compila
|
||||||
@if not exist "$(DIST_DIR)" mkdir "$(DIST_DIR)"
|
|
||||||
@windres release/windows/vibe3.rc -O coff -o $(RESOURCE_FILE)
|
@windres release/windows/vibe3.rc -O coff -o $(RESOURCE_FILE)
|
||||||
@$(CXX) $(APP_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_RELEASE_FILE).exe"
|
@$(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
|
@strip -s -R .comment -R .gnu.version "$(WIN_RELEASE_FILE).exe" --strip-unneeded
|
||||||
|
|||||||
Reference in New Issue
Block a user