From be838127168d0482a8e38f8baed9c01442209028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Mogu=C3=A9rou?= Date: Mon, 15 Apr 2024 23:56:46 +0200 Subject: [PATCH] Ajout d'un Makefile --- Makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e926582 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +CC=gcc +FLAGS=-g -Wall -Wextra -Wpedantic +LFLAGS= + + +all: bin/main + +OBJECTS = obj/main.o obj/structure.o obj/display.o obj/algorithm.o +bin/main: bin $(OBJECTS) + $(CC) -o $@ $(LFLAGS) $(FLAGS) $(OBJECTS) + +obj/main.o: main.c obj + $(CC) -o $@ -c $(FLAGS) $< + +obj/structure.o: structure.c structure.h obj + $(CC) -o $@ -c $(FLAGS) $< + +obj/display.o: display.c display.h obj + $(CC) -o $@ -c $(FLAGS) $< + +obj/algorithm.o: algorithm.c algorithm.h obj + $(CC) -o $@ -c $(FLAGS) $< + +bin: + mkdir -p bin + +obj: + mkdir -p obj + + +.PHONY: clean + +clean: + rm -rf bin/ obj/