resource.pack
This commit is contained in:
52
tools/pack_resources/Makefile
Normal file
52
tools/pack_resources/Makefile
Normal file
@@ -0,0 +1,52 @@
|
||||
# Makefile para la herramienta de empaquetado de Coffee Crisis
|
||||
# =============================================================
|
||||
|
||||
CXX := g++
|
||||
CXXFLAGS := -std=c++20 -Wall -Os -I../../source
|
||||
SOURCES := pack_resources.cpp ../../source/resource_pack.cpp
|
||||
TARGET := pack_resources
|
||||
CLEAN_FILES := pack_resources *.pack *.o
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
DETECTED_OS := Windows
|
||||
TARGET := $(TARGET).exe
|
||||
CLEAN_CMD := del /Q
|
||||
FixPath = $(subst /,\\,$1)
|
||||
else
|
||||
DETECTED_OS := $(shell uname -s)
|
||||
CLEAN_CMD := rm -f
|
||||
FixPath = $1
|
||||
endif
|
||||
|
||||
.PHONY: all pack_tool pack clean help
|
||||
|
||||
all: pack_tool
|
||||
|
||||
pack_tool:
|
||||
@echo "Compilando herramienta de empaquetado para $(DETECTED_OS)..."
|
||||
$(CXX) $(CXXFLAGS) $(SOURCES) -o $(TARGET)
|
||||
@echo "Herramienta compilada: $(TARGET)"
|
||||
|
||||
clean:
|
||||
@echo "Limpiando archivos generados..."
|
||||
$(CLEAN_CMD) $(call FixPath,$(CLEAN_FILES))
|
||||
@echo "Archivos limpiados"
|
||||
|
||||
# Crear pack final (invocado desde el Makefile raíz)
|
||||
pack: pack_tool
|
||||
ifeq ($(OS),Windows_NT)
|
||||
.\$(TARGET) ..\..\data ..\..\resources.pack
|
||||
else
|
||||
./$(TARGET) ../../data ../../resources.pack
|
||||
endif
|
||||
|
||||
help:
|
||||
@echo "Makefile para herramientas de Coffee Crisis"
|
||||
@echo "==========================================="
|
||||
@echo ""
|
||||
@echo "Comandos disponibles:"
|
||||
@echo " all - Compilar herramienta de empaquetado (por defecto)"
|
||||
@echo " pack_tool - Compilar herramienta de empaquetado"
|
||||
@echo " pack - Crear pack final en ../../resources.pack"
|
||||
@echo " clean - Limpiar archivos generados"
|
||||
@echo " help - Mostrar esta ayuda"
|
||||
Reference in New Issue
Block a user