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

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