Fix make debug check
[open-adventure.git] / Makefile
index e9c0de38748c06354386d324043636b3d04772a7..43f1f9514caa1c1286ec093cbb47e5147d92d307 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@
 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
@@ -46,7 +47,7 @@ SOURCES=$(OBJS:.o=.c) advent.h adventure.yaml Makefile control linenoise/linenoi
 advent:        $(OBJS) linenoise.o dungeon.o
        $(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) dungeon.o linenoise.o $(LDFLAGS) $(LIBS)
 
-main.o:                linenoise-gitmodule advent.h dungeon.h
+main.o:                advent.h dungeon.h linenoise.o
 
 init.o:                advent.h dungeon.h
 
@@ -56,7 +57,7 @@ score.o:      advent.h dungeon.h
 
 misc.o:                advent.h dungeon.h
 
-cheat.o:       linenoise-gitmodule advent.h dungeon.h
+cheat.o:       advent.h dungeon.h linenoise.o
 
 saveresume.o:  advent.h dungeon.h
 
@@ -66,13 +67,14 @@ dungeon.o:  dungeon.c dungeon.h
 dungeon.c dungeon.h: make_dungeon.py adventure.yaml
        python3 make_dungeon.py
 
-linenoise-gitmodule: 
-       test -s linenoise/linenoise.h || { echo "\nlinenoise not present. Try: \n\n\tgit submodule update --recursive --remote --init\n"; exit 1; }
-
-linenoise.o:   linenoise-gitmodule 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-gitmodule 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: