diff options
Diffstat (limited to 'build/native.mk')
-rw-r--r-- | build/native.mk | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/build/native.mk b/build/native.mk new file mode 100644 index 0000000..e4495d5 --- /dev/null +++ b/build/native.mk @@ -0,0 +1,42 @@ +# Native build rules for GlaMaC
+# This file contains rules for building on the native platform (Linux/Windows)
+
+# Default target
+all: glamac glautils
+
+# Native build targets
+glamac: $(BINDIR)/glamac$(EXE_EXT)
+
+glautils: $(GLAUTILS_BINS)
+
+$(BINDIR)/glamac$(EXE_EXT): $(GLAMAC_SRCS) | $(BINDIR)
+ @echo "Building glamac..."
+ $(CC) $^ $(CFLAGS_NATIVE) $(SDL3_LIBS) -o $@
+
+# Special rule for fgla which needs glass_data dependencies
+$(BINDIR)/fgla$(EXE_EXT): $(SRCDIR)/glautils/fgla.c $(GLASS_DATA_SRCS) | $(BINDIR)
+ $(CC) $^ $(CFLAGS_NATIVE) -o $@
+
+# General rule for other glautils (excluding fgla)
+$(BINDIR)/%$(EXE_EXT): $(SRCDIR)/glautils/%.c | $(BINDIR)
+ $(CC) $< $(CFLAGS_NATIVE) -o $@
+
+# 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
+ @cd .. && python3 scripts/excel_to_json.py $< -o $@
+
+# Cleanup
+clean: clean-deps-files
+ $(RMDIR) $(BINDIR) 2>/dev/null || true
+
+rebuild: clean all
+
+# Build-related phony targets
+.PHONY: all glamac glautils convert-catalogs clean rebuild
\ No newline at end of file |