2021-02-16 16:12:37 +01:00
|
|
|
CC=gcc
|
2021-02-16 17:28:36 +01:00
|
|
|
CFLAGS=-Wall -g -Isrc/parser
|
2021-02-16 16:12:37 +01:00
|
|
|
|
|
|
|
%: obj/lib.o obj/%.o
|
|
|
|
$(CC) -o $@ $^
|
|
|
|
|
|
|
|
obj/%.o: src/%.c
|
|
|
|
$(CC) $(CFLAGS) $^ -o $@ -c
|
|
|
|
|
2021-02-16 17:28:36 +01:00
|
|
|
obj/lib.o: src/parser/parser.c directories
|
2021-02-16 16:12:37 +01:00
|
|
|
$(CC) $(CFLAGS) $< -o $@ -c
|
|
|
|
|
|
|
|
.PHONY: directories clean
|
|
|
|
|
|
|
|
directories:
|
|
|
|
if ! [ -d "obj" ]; then \
|
|
|
|
mkdir obj; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf obj
|