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