rishtik/Makefile

27 lines
441 B
Makefile
Raw Permalink Normal View History

2021-02-16 16:12:37 +01:00
CC=gcc
2021-02-17 19:29:04 +01:00
CFLAGS=-Wall -g -Isrc/boitoutil
LIB=src/boitoutil
src:=$(wildcard $(LIB)/*.c)
obj:=$(patsubst $(LIB)/%.c,obj/%.o,$(src))
2021-02-16 16:12:37 +01:00
all: directories rishtik clean
rishtik: $(obj) obj/shell.o
2021-02-16 16:12:37 +01:00
$(CC) -o $@ $^
obj/shell.o: src/shellOpt.c
2021-02-16 16:12:37 +01:00
$(CC) $(CFLAGS) $^ -o $@ -c
$(obj): obj/%.o: $(LIB)/%.c
2021-02-17 15:05:38 +01:00
$(CC) $(CFLAGS) $^ -o $@ -c
2021-02-16 16:12:37 +01:00
.PHONY: all directories clean
2021-02-16 16:12:37 +01:00
directories:
if ! [ -d "obj" ]; then \
mkdir -p obj/lib; \
2021-02-16 16:12:37 +01:00
fi
clean:
rm -rf obj