diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -30,14 +30,18 @@ BINDIR_WIN := bin/win INCDIR := include
DLL_CACHE := $(HOME)/.cache/glamac-dlls
+# 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 := -I$(INCDIR) -O2 -flto $(SECURITY_FLAGS) $(WARNING_FLAGS)
+CFLAGS := $(CFLAGS_BASE) $(SECURITY_FLAGS) $(WARNING_FLAGS)
CFLAGS_NATIVE := $(CFLAGS) -march=native
-CFLAGS_CROSS := $(CFLAGS) -I$(CROSS_PREFIX)/include
+# Windows cross-compilation flags (without stack protector to avoid libssp dependency)
+WARNING_FLAGS_WIN := -Wall -Wextra -Wformat=2 -Wformat-security -Wnull-dereference -Wvla
+CFLAGS_CROSS := $(CFLAGS_BASE) $(WARNING_FLAGS_WIN) -I$(CROSS_PREFIX)/include
# Source files
GLAMAC_SRCS := $(wildcard $(SRCDIR)/glamac/*.c)
@@ -121,6 +125,16 @@ win-data: | $(BINDIR_WIN) else \
echo "Warning: glasses.json not found, Windows build may use fallback data"; \
fi
+ @echo "Copying font for Windows..."
+ @if [ -f "/usr/share/fonts/TTF/DejaVuSans.ttf" ]; then \
+ cp /usr/share/fonts/TTF/DejaVuSans.ttf $(BINDIR_WIN)/; \
+ echo "Copied DejaVuSans.ttf to Windows build"; \
+ elif [ -f "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" ]; then \
+ cp /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf $(BINDIR_WIN)/; \
+ echo "Copied DejaVuSans.ttf to Windows build"; \
+ else \
+ echo "Warning: DejaVu font not found, Windows build may fail to start"; \
+ fi
# Cross-compilation setup
setup-cross:
|