From 5584f391d792dc6500d15badb3e4bc6242ef06b5 Mon Sep 17 00:00:00 2001
From: rick <rick@gnous.eu>
Date: Wed, 17 Feb 2021 23:18:21 +0100
Subject: [PATCH] =?UTF-8?q?Modification=20pour=20compiler=20toutes=20les?=
 =?UTF-8?q?=20biblioth=C3=A8ques?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 5638038..2844b03 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,25 @@
 CC=gcc
 CFLAGS=-Wall -g -Isrc/boitoutil
 LIB=src/boitoutil
+src:=$(wildcard $(LIB)/*.c)
+obj:=$(patsubst $(LIB)/%.c,obj/%.o,$(src))
 
 all: directories rishtik clean
 
-rishtik: obj/lib.o obj/shell.o 
+rishtik: $(obj) obj/shell.o 
 	$(CC) -o $@ $^
 
 obj/shell.o: src/shellOpt.c 
 	$(CC) $(CFLAGS) $^ -o $@ -c
 
-obj/lib.o: $(LIB)/parser.c 
+$(obj): obj/%.o: $(LIB)/%.c
 	$(CC) $(CFLAGS) $^ -o $@ -c
 
 .PHONY: all directories clean
 
 directories:
 	if ! [ -d "obj" ]; then \
-		mkdir obj; \
+		mkdir -p obj/lib; \
 	fi
 
 clean: