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