diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -62,7 +62,7 @@ $(BINDIR): # Windows cross-compilation (Linux only)
ifeq ($(PLATFORM),linux)
-win: $(BINDIR_WIN)/glamac.exe win-dlls
+win: $(BINDIR_WIN)/glamac.exe win-dlls win-data
win-all: win $(GLAUTILS_BINS_WIN)
@@ -98,6 +98,18 @@ win-dlls: | $(BINDIR_WIN) @cp $(DLL_CACHE)/*.dll $(BINDIR_WIN)/
@echo "Windows build ready in $(BINDIR_WIN)/"
+# Copy data files for Windows build
+win-data: | $(BINDIR_WIN)
+ @echo "Copying data files for Windows..."
+ @$(MKDIR) $(BINDIR_WIN)/data/json
+ @if [ -f "data/json/glasses.json" ]; then \
+ cp data/json/glasses.json $(BINDIR_WIN)/data/json/; \
+ cp data/json/glasses.json $(BINDIR_WIN)/; \
+ echo "Copied glasses.json to Windows build"; \
+ else \
+ echo "Warning: glasses.json not found, Windows build may use fallback data"; \
+ fi
+
# Cross-compilation setup
setup-cross:
@echo "Setting up cross-compilation..."
@@ -123,11 +135,22 @@ win win-all win-dlls setup-cross: @echo "Cross-compilation not available on Windows. Use 'make all' instead."
endif
+# Excel to JSON conversion
+EXCEL_FILES := $(wildcard data/Excel/*.xlsx)
+JSON_FILES := $(patsubst data/Excel/%.xlsx, data/JSON/%.json, $(EXCEL_FILES))
+
+convert-catalogs: $(JSON_FILES)
+
+data/JSON/%.json: data/Excel/%.xlsx scripts/excel_to_json.py
+ @echo "Converting $< to JSON..."
+ @$(MKDIR) data/JSON
+ @python3 scripts/excel_to_json.py $< -o $@
+
# Dependency management
deps:
ifeq ($(PLATFORM),linux)
@echo "Installing dependencies..."
- sudo pacman -S --needed sdl3 git cmake pkgconf freetype2
+ sudo pacman -S --needed sdl3 git cmake pkgconf freetype2 python python-pandas python-openpyxl
@echo "Building SDL3_ttf from source..."
cd /tmp && $(RM) -rf SDL_ttf && \
git clone https://github.com/libsdl-org/SDL_ttf.git && \
@@ -138,6 +161,7 @@ ifeq ($(PLATFORM),linux) @echo "Dependencies installed!"
else
@echo "Install SDL3 development libraries manually on Windows."
+ @echo "Install Python with pandas and openpyxl for Excel conversion."
endif
# Cleanup
@@ -183,6 +207,9 @@ endif @echo " deps - Install SDL3 dependencies"
@echo " clean-deps - Remove SDL3 dependencies"
@echo ""
+ @echo "Glass catalog conversion:"
+ @echo " convert-catalogs - Convert Excel files to JSON"
+ @echo ""
@echo "Quick start:"
ifeq ($(PLATFORM),linux)
@echo " make deps && make all # Native build"
@@ -191,4 +218,4 @@ else @echo " Install SDL3, then: make all"
endif
-.PHONY: all glamac glautils win win-all win-dlls setup-cross deps clean clean-deps clean-cache clean-all rebuild help
\ No newline at end of file +.PHONY: all glamac glautils win win-all win-dlls setup-cross convert-catalogs deps clean clean-deps clean-cache clean-all rebuild help
\ No newline at end of file |