BootSplash viewer thing

This commit is contained in:
2026-07-31 00:02:54 +03:00
parent be8dd0bfcd
commit 5a18c2fe30
2 changed files with 137 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# Compiler and Flags
CC := gcc
CFLAGS := -Wall -Wextra -O2
# Query static compiler flags and libraries using pkg-config
PKG_CFLAGS := $(shell pkg-config --static --cflags sdl2 SDL2_image)
PKG_LIBS := $(shell pkg-config --static --libs sdl2 SDL2_image)
# Additional low-level system libraries required for static SDL2/PNG linking
EXTRA_LIBS := -lpng -lz -lm -lpthread -ldl
# Combine all libraries
LIBS := $(PKG_LIBS) $(EXTRA_LIBS)
# Target executable name
TARGET := viewer
SRC := main.c
.PHONY: all clean check
# Default target
all: $(TARGET)
# Compile and statically link the binary
$(TARGET): $(SRC)
$(CC) $(CFLAGS) $(PKG_CFLAGS) $< -o $@ $(LIBS)
# Check if the generated executable is truly statically linked
check: $(TARGET)
@file $(TARGET)
@echo "--- Dynamic Library Dependencies (should show 'not a dynamic executable') ---"
@-ldd $(TARGET) || true
# Clean up built artifacts
clean:
rm -f $(TARGET)