Modification pour compiler toutes les bibliothèques
This commit is contained in:
parent
1d7c901caf
commit
5584f391d7
1 changed files with 5 additions and 3 deletions
8
Makefile
8
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:
|
||||
|
|
Loading…
Reference in a new issue