From 11abe9c6c765b6018cfa67101eb8eaa64127a48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Sat, 12 Apr 2025 22:35:42 +0300 Subject: [PATCH] new makefile --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2009017..5a62241 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,17 @@ -all: - gcc -Wall -Wextra -pedantic -Werror -o executable c-basic/*.c +CC = gcc +CFLAGS = -Wall -Wextra -std=c11 +SRCDIR = . +SRC = $(wildcard $(SRCDIR)/*.c) +OBJ = $(SRC:.c=.o) +TARGET = main + +all: $(TARGET) + +$(TARGET): $(OBJ) + $(CC) $(CFLAGS) -o $@ $^ + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJ) $(TARGET) \ No newline at end of file