From 8332d652eac5b46d8b8b02b25d47aa5355ef31cd Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Aug 2025 18:25:31 +0200 Subject: added schott json --- Makefile | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index afd1db5..f419cb9 100644 --- a/Makefile +++ b/Makefile @@ -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 -- cgit v1.2.3