2021-02-16 16:12:37 +01:00
|
|
|
CC=gcc
|
2021-02-17 15:05:38 +01:00
|
|
|
CFLAGS=-Wall -g -Isrc/shell_tools
|
|
|
|
LIB=src/shell_tools
|
2021-02-16 16:12:37 +01:00
|
|
|
|
2021-02-16 22:28:32 +01:00
|
|
|
all: directories rishtik clean
|
|
|
|
|
|
|
|
rishtik: obj/lib.o obj/shell.o
|
2021-02-16 16:12:37 +01:00
|
|
|
$(CC) -o $@ $^
|
|
|
|
|
2021-02-16 22:28:32 +01:00
|
|
|
obj/shell.o: src/shellOpt.c
|
2021-02-16 16:12:37 +01:00
|
|
|
$(CC) $(CFLAGS) $^ -o $@ -c
|
|
|
|
|
2021-02-17 15:05:38 +01:00
|
|
|
obj/lib.o: $(LIB)/parser.c
|
|
|
|
$(CC) $(CFLAGS) $^ -o $@ -c
|
2021-02-16 16:12:37 +01:00
|
|
|
|
2021-02-16 22:28:32 +01:00
|
|
|
.PHONY: all directories clean
|
2021-02-16 16:12:37 +01:00
|
|
|
|
|
|
|
directories:
|
|
|
|
if ! [ -d "obj" ]; then \
|
|
|
|
mkdir obj; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf obj
|