From 5de87b56e8518668a6c0a9347a5378b90c083939 Mon Sep 17 00:00:00 2001 From: zerg Date: Mon, 30 Jun 2025 20:13:38 +0330 Subject: [PATCH] add makefile for easier compilation --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..514c9c3 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +CC := cc + +CFLAGS := -g -O3 -Wall -Wextra $(shell sdl2-config --cflags) +LIBS := $(shell sdl2-config --libs) +SRCS := $(wildcard *.c) +OBJS := $(SRCS:%.c=%.o) +TARGET = pong + +$(TARGET): $(OBJS) + $(CC) $^ -o $@ $(LIBS) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -rf *.o $(TARGET) +