# Common build variables and functions for GlaMaC # This file contains shared configuration used by all build modules # Linux-only build configuration PLATFORM := linux EXE_EXT := MKDIR := mkdir -p RM := rm -f RMDIR := rm -rf CC := gcc SDL3_LIBS := $(shell pkg-config --libs sdl3 SDL3_ttf 2>/dev/null || echo -lSDL3 -lSDL3_ttf) -lm # Directories (relative to project root) SRCDIR := ../src BINDIR := ../bin INCDIR := ../include # Base flags CFLAGS_BASE := -I$(INCDIR) -O2 -flto # Security and warning flags SECURITY_FLAGS := -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE WARNING_FLAGS := -Wall -Wextra -Wformat=2 -Wformat-security -Wnull-dereference -Wstack-protector -Wvla # Compiler flags CFLAGS := $(CFLAGS_BASE) $(SECURITY_FLAGS) $(WARNING_FLAGS) -march=native # Source files GLAMAC_SRCS := $(wildcard $(SRCDIR)/glamac/*.c) GLAUTILS_SRCS := $(wildcard $(SRCDIR)/glautils/*.c) GLAUTILS_BINS := $(patsubst $(SRCDIR)/glautils/%.c, $(BINDIR)/%, $(GLAUTILS_SRCS)) # Glass data dependencies for fgla GLASS_DATA_SRCS := $(SRCDIR)/glamac/glass_data.c $(SRCDIR)/glamac/glamac_errors.c # Common directory creation rules $(BINDIR): $(MKDIR) $(BINDIR)