refactor: C Rewrite

This commit is contained in:
2026-05-24 09:38:54 +05:30
parent 012e0e1c69
commit 02fb6ed612
7 changed files with 234 additions and 201 deletions

32
Makefile Normal file
View File

@@ -0,0 +1,32 @@
# Compiler settings
CC = gcc
CFLAGS = -O2 -Wall -Wextra $(shell pkg-config --cflags sdl2 SDL2_image)
LIBS = $(shell pkg-config --libs sdl2 SDL2_image)
# Project Structure
TARGET = game-splash
SRC = src/gsplash.c
# Installation Paths (Defaults to user local bin)
PREFIX ?= /usr/local
# Default target run when typing just 'make'
all: $(TARGET)
# Compilation rule
$(TARGET): $(SRC)
$(CC) $(CFLAGS) $(SRC) -o $(TARGET) $(LIBS)
# Install binary system-wide
install: $(TARGET)
install -Dm755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET)
# Remove binary from system
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET)
# Clean build artifacts
clean:
rm -f $(TARGET)
.PHONY: all install uninstall clean