summaryrefslogtreecommitdiff
path: root/build/dependencies.mk
diff options
context:
space:
mode:
authoradmin <admin@optics-design.com>2025-08-05 11:28:41 +0200
committeradmin <admin@optics-design.com>2025-08-05 11:28:41 +0200
commit04b3fcb479f5aaae06d18b315a8bdc8c298f4eae (patch)
tree92f60caef26f98a83681aa0e1f360df03203bbe4 /build/dependencies.mk
parent9496ae0a50e6848121c7e913ca2dc55c8e6c84c1 (diff)
removed clustering
Diffstat (limited to 'build/dependencies.mk')
-rw-r--r--build/dependencies.mk52
1 files changed, 52 insertions, 0 deletions
diff --git a/build/dependencies.mk b/build/dependencies.mk
new file mode 100644
index 0000000..fa10af4
--- /dev/null
+++ b/build/dependencies.mk
@@ -0,0 +1,52 @@
+# 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 \ No newline at end of file
Back to https://optics-design.com