Making the Makefile create directories

This commit is contained in:
Valentin Moguérou 2021-10-06 20:57:01 +02:00
parent f09329adcf
commit 69f733f20a

View File

@ -3,11 +3,13 @@ FLAGS = -Wall -fpic
LFLAGS = -s
all: bin/libcatwalk.so
bin/libcatwalk.so: obj/directions.o obj/grid.o obj/indicators.o obj/route.o
-@mkdir -p $(@D)
$(CC) -shared -o $@ $(FLAGS) $^ $(LFLAGS)
obj/%.o: src/%.c
-@mkdir -p $(@D)
$(CC) -o $@ -c $(FLAGS) $<
obj/directions.o: src/directions.c
@ -17,6 +19,6 @@ obj/route.o: src/route.c
.PHONY: clean mrproper
clean:
rm -f obj/*
rm -rf obj
mrproper: clean
rm -f bin/*
rm -rf bin