modificat makefile
This commit is contained in:
83
Makefile
83
Makefile
@@ -69,13 +69,11 @@ INCLUDES := -Isource -Isource/external
|
|||||||
# Variables según el sistema operativo
|
# Variables según el sistema operativo
|
||||||
CXXFLAGS_BASE := -std=c++20 -Wall
|
CXXFLAGS_BASE := -std=c++20 -Wall
|
||||||
CXXFLAGS := $(CXXFLAGS_BASE) -Os -ffunction-sections -fdata-sections
|
CXXFLAGS := $(CXXFLAGS_BASE) -Os -ffunction-sections -fdata-sections
|
||||||
CXXFLAGS_DEBUG := $(CXXFLAGS_BASE) -g -D_DEBUG
|
|
||||||
LDFLAGS :=
|
LDFLAGS :=
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
FixPath = $(subst /,\\,$1)
|
FixPath = $(subst /,\\,$1)
|
||||||
CXXFLAGS += -DWINDOWS_BUILD
|
CXXFLAGS += -DWINDOWS_BUILD
|
||||||
CXXFLAGS_DEBUG += -DWINDOWS_BUILD
|
|
||||||
LDFLAGS += -Wl,--gc-sections -static-libstdc++ -static-libgcc \
|
LDFLAGS += -Wl,--gc-sections -static-libstdc++ -static-libgcc \
|
||||||
-Wl,-Bstatic -lpthread -Wl,-Bdynamic -Wl,-subsystem,windows \
|
-Wl,-Bstatic -lpthread -Wl,-Bdynamic -Wl,-subsystem,windows \
|
||||||
-lmingw32 -lws2_32 -lSDL3 -lSDL3_ttf
|
-lmingw32 -lws2_32 -lSDL3 -lSDL3_ttf
|
||||||
@@ -91,16 +89,9 @@ else
|
|||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
CXXFLAGS += -DLINUX_BUILD
|
CXXFLAGS += -DLINUX_BUILD
|
||||||
CXXFLAGS_DEBUG += -DLINUX_BUILD
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
CXXFLAGS += -DMACOS_BUILD -arch arm64
|
CXXFLAGS += -DMACOS_BUILD -arch arm64
|
||||||
CXXFLAGS_DEBUG += -DMACOS_BUILD -arch arm64
|
|
||||||
# Si quieres binarios universales:
|
|
||||||
# CXXFLAGS += -arch x86_64
|
|
||||||
# CXXFLAGS_DEBUG += -arch x86_64
|
|
||||||
# Y frameworks si hacen falta:
|
|
||||||
# LDFLAGS += -framework Cocoa -framework IOKit
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -136,16 +127,6 @@ windows:
|
|||||||
$(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
|
||||||
|
|
||||||
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: force_resource_pack
|
windows_release: force_resource_pack
|
||||||
@echo "Creando release para Windows - Version: $(VERSION)"
|
@echo "Creando release para Windows - Version: $(VERSION)"
|
||||||
|
|
||||||
@@ -178,10 +159,6 @@ macos:
|
|||||||
@echo "Compilando para macOS: $(TARGET_NAME)"
|
@echo "Compilando para macOS: $(TARGET_NAME)"
|
||||||
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
$(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: force_resource_pack
|
macos_release: force_resource_pack
|
||||||
@echo "Creando release para macOS - Version: $(VERSION)"
|
@echo "Creando release para macOS - Version: $(VERSION)"
|
||||||
|
|
||||||
@@ -289,10 +266,6 @@ linux:
|
|||||||
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
||||||
strip -s -R .comment -R .gnu.version "$(TARGET_FILE)" --strip-unneeded
|
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: force_resource_pack
|
linux_release: force_resource_pack
|
||||||
@echo "Creando release para Linux - Version: $(VERSION)"
|
@echo "Creando release para Linux - Version: $(VERSION)"
|
||||||
# Elimina carpetas previas
|
# Elimina carpetas previas
|
||||||
@@ -415,13 +388,9 @@ linux_release_desktop: force_resource_pack
|
|||||||
|
|
||||||
raspi:
|
raspi:
|
||||||
@echo "Compilando para Raspberry Pi: $(TARGET_NAME)"
|
@echo "Compilando para Raspberry Pi: $(TARGET_NAME)"
|
||||||
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(TARGET_FILE)
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o $(TARGET_FILE)
|
||||||
strip -s -R .comment -R .gnu.version $(TARGET_FILE) --strip-unneeded
|
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: force_resource_pack
|
raspi_release: force_resource_pack
|
||||||
@echo "Creando release para Raspberry Pi - Version: $(VERSION)"
|
@echo "Creando release para Raspberry Pi - Version: $(VERSION)"
|
||||||
# Elimina carpetas previas
|
# Elimina carpetas previas
|
||||||
@@ -436,7 +405,7 @@ raspi_release: force_resource_pack
|
|||||||
cp README.md "$(RELEASE_FOLDER)"
|
cp README.md "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
# Compila
|
# Compila
|
||||||
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
||||||
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
||||||
|
|
||||||
# Empaqueta ficheros
|
# Empaqueta ficheros
|
||||||
@@ -447,25 +416,6 @@ raspi_release: force_resource_pack
|
|||||||
# Elimina la carpeta temporal
|
# Elimina la carpeta temporal
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
anbernic: force_resource_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
|
# Regla para mostrar la versión actual
|
||||||
show_version:
|
show_version:
|
||||||
@echo "Version actual: $(VERSION)"
|
@echo "Version actual: $(VERSION)"
|
||||||
@@ -474,20 +424,19 @@ show_version:
|
|||||||
help:
|
help:
|
||||||
@echo "Makefile para ViBe3 Physics"
|
@echo "Makefile para ViBe3 Physics"
|
||||||
@echo "Comandos disponibles:"
|
@echo "Comandos disponibles:"
|
||||||
@echo " windows - Compilar para Windows"
|
@echo " windows - Compilar para Windows"
|
||||||
@echo " windows_debug - Compilar debug para Windows"
|
@echo " windows_release - Crear release completo para Windows (.zip)"
|
||||||
@echo " windows_release - Crear release completo para Windows (.zip)"
|
@echo " linux - Compilar para Linux"
|
||||||
@echo " linux - Compilar para Linux"
|
@echo " linux_release - Crear release basico para Linux (.tar.gz)"
|
||||||
@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 " linux_release_desktop - Crear release con integracion desktop para Linux"
|
||||||
@echo " macos - Compilar para macOS"
|
@echo " macos - Compilar para macOS"
|
||||||
@echo " macos_debug - Compilar debug para macOS"
|
@echo " macos_release - Crear release completo para macOS (.dmg)"
|
||||||
@echo " macos_release - Crear release completo para macOS (.dmg)"
|
@echo " raspi - Compilar para Raspberry Pi"
|
||||||
@echo " pack_tool - Compilar herramienta de empaquetado"
|
@echo " raspi_release - Crear release para Raspberry Pi (.tar.gz)"
|
||||||
@echo " resources.pack - Generar pack de recursos desde data/"
|
@echo " pack_tool - Compilar herramienta de empaquetado"
|
||||||
@echo " force_resource_pack - Regenerar resources.pack (usado por releases)"
|
@echo " resources.pack - Generar pack de recursos desde data/"
|
||||||
@echo " show_version - Mostrar version actual ($(VERSION))"
|
@echo " force_resource_pack - Regenerar resources.pack (usado por releases)"
|
||||||
@echo " help - Mostrar esta ayuda"
|
@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
|
.PHONY: windows windows_release macos macos_release linux linux_release linux_release_desktop raspi raspi_release show_version help pack_tool force_resource_pack
|
||||||
Reference in New Issue
Block a user