Modification pour compiler toutes les bibliothèques

This commit is contained in:
rick 2021-02-17 23:18:21 +01:00
parent 1d7c901caf
commit 5584f391d7
Signed by: Rick
GPG key ID: 2B593F087240EE99

View file

@ -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: