# Dependency management for GlaMaC # This file contains rules for installing and managing dependencies # Automatic dependency generation for source files GLAMAC_DEPS := $(GLAMAC_SRCS:.c=.d) GLAUTILS_DEPS := $(GLAUTILS_SRCS:.c=.d) ALL_DEPS := $(GLAMAC_DEPS) $(GLAUTILS_DEPS) # Include generated dependencies (suppress errors if files don't exist yet) -include $(ALL_DEPS) # Rule to generate dependency files %.d: %.c @$(CC) -MM $(CFLAGS) $< | sed 's|\(.*\)\.o[ ]*:|\1.o \1.d:|' > $@ # Clean dependency files clean-deps-files: $(RM) $(ALL_DEPS) # Add dependency files to clean targets .PHONY: clean-deps-files # Dependency management deps: ifeq ($(PLATFORM),linux) @echo "Installing dependencies..." 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 && \ cd SDL_ttf && git checkout release-3.2.2 && \ cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr && \ make -C build -j$$(nproc) && sudo make -C build install && \ sudo ldconfig @echo "Dependencies installed!" else @echo "Install SDL3 development libraries manually on Windows." @echo "Install Python with pandas and openpyxl for Excel conversion." endif clean-deps: ifeq ($(PLATFORM),linux) @echo "Removing SDL3 dependencies..." sudo pacman -R sdl3 --noconfirm 2>/dev/null || true sudo $(RM) -f /usr/lib/libSDL3_ttf.so* /usr/lib/libSDL3_ttf.a /usr/lib/pkgconfig/SDL3_ttf.pc sudo $(RMDIR) /usr/include/SDL3_ttf/ 2>/dev/null || true sudo ldconfig @echo "Dependencies removed!" endif # Dependency-related phony targets .PHONY: deps clean-deps