From e86c90e7392e345cd458a5524148aa011cafff2d Mon Sep 17 00:00:00 2001 From: gandc Date: Thu, 13 Mar 2025 19:26:02 +0300 Subject: [PATCH] Update Makefile. Use ./build dir --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 33051eb..5aac66d 100644 --- a/Makefile +++ b/Makefile @@ -6,17 +6,20 @@ CFLAGS = -Wall all: task1 task2 task3 task4 -task1: - $(CC) $(CFLAGS) task1/main.c -o task1/task1 +build: + mkdir -p build + +task1: build + $(CC) $(CFLAGS) task1/main.c -o build/task1 -task2: - $(CC) $(CFLAGS) task2/main.c -o task2/task2 +task2: build + $(CC) $(CFLAGS) task2/main.c -o build/task2 -task3: - $(CC) $(CFLAGS) task3/main.c -o task3/task3 +task3: build + $(CC) $(CFLAGS) task3/main.c -o build/task3 -task4: - $(CC) $(CFLAGS) task4/main.c -lm -o task4/task4 +task4: build + $(CC) $(CFLAGS) task4/main.c -lm -o build/task4 clean: - rm -f task1/task1 task2/task2 task3/task3 task4/task4 + rm -f build/task1 build/task2 build/task3 build/task4 \ No newline at end of file