VERS=$(shell sed -n <NEWS '/^[0-9]/s/:.*//p' | head -1)
.PHONY: debug indent release refresh dist linty html clean
+.PHONY: check coverage
CC?=gcc
CCFLAGS+=-std=c99 -D_DEFAULT_SOURCE -DVERSION=\"$(VERS)\" -Wpedantic -O2
advent: $(OBJS) linenoise.o dungeon.o
$(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) dungeon.o linenoise.o $(LDFLAGS) $(LIBS)
-main.o: advent.h dungeon.h
+main.o: advent.h dungeon.h linenoise.o
init.o: advent.h dungeon.h
misc.o: advent.h dungeon.h
-cheat.o: advent.h dungeon.h
+cheat.o: advent.h dungeon.h linenoise.o
saveresume.o: advent.h dungeon.h
dungeon.c dungeon.h: make_dungeon.py adventure.yaml
python3 make_dungeon.py
-linenoise.o: linenoise/linenoise.h
+linenoise.o: linenoise/linenoise.h
+ @test -s linenoise/linenoise.h || { echo -e "linenoise not present. Try:\n\
+ git submodule update --recursive --remote --init"; exit 1; }
$(CC) -c linenoise/linenoise.c
-linenoise-dbg: linenoise/linenoise.h
+linenoise-dbg: linenoise/linenoise.h
+ @test -s linenoise/linenoise.h || { echo -e "linenoise not present. Try:\n\
+ git submodule update --recursive --remote --init"; exit 1; }
$(CC) $(CCFLAGS) -c linenoise/linenoise.c
clean: