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
|
CC=gcc
|
||||||
CFLAGS=-Wall -g -Isrc/boitoutil
|
CFLAGS=-Wall -g -Isrc/boitoutil
|
||||||
LIB=src/boitoutil
|
LIB=src/boitoutil
|
||||||
|
src:=$(wildcard $(LIB)/*.c)
|
||||||
|
obj:=$(patsubst $(LIB)/%.c,obj/%.o,$(src))
|
||||||
|
|
||||||
all: directories rishtik clean
|
all: directories rishtik clean
|
||||||
|
|
||||||
rishtik: obj/lib.o obj/shell.o
|
rishtik: $(obj) obj/shell.o
|
||||||
$(CC) -o $@ $^
|
$(CC) -o $@ $^
|
||||||
|
|
||||||
obj/shell.o: src/shellOpt.c
|
obj/shell.o: src/shellOpt.c
|
||||||
$(CC) $(CFLAGS) $^ -o $@ -c
|
$(CC) $(CFLAGS) $^ -o $@ -c
|
||||||
|
|
||||||
obj/lib.o: $(LIB)/parser.c
|
$(obj): obj/%.o: $(LIB)/%.c
|
||||||
$(CC) $(CFLAGS) $^ -o $@ -c
|
$(CC) $(CFLAGS) $^ -o $@ -c
|
||||||
|
|
||||||
.PHONY: all directories clean
|
.PHONY: all directories clean
|
||||||
|
|
||||||
directories:
|
directories:
|
||||||
if ! [ -d "obj" ]; then \
|
if ! [ -d "obj" ]; then \
|
||||||
mkdir obj; \
|
mkdir -p obj/lib; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in a new issue