The *.d depends files for make just list the files used when building an object
file. Removing a file listed in such a dependency file causes make to search
for a way to recreate it. This usually cannot work because these files aren't
autogenerated.

The gcc option -MP can be used to generate empty rule for these files. Removing
a file in a dependency list will then execute this empty rule and continue with
the execution of the creation of the object file. This compilation process will
then automatically correct the dependency file.

Signed-off-by: Sven Eckelmann <[email protected]>
---
 Makefile     | 2 +-
 vis/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index aeee2e8..ec9dc11 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ BINARY_NAME = alfred
 OBJ = main.o server.o client.o netsock.o send.o recv.o hash.o unix_sock.o 
util.o debugfs.o batadv_query.o
 
 # alfred flags and options
-CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
 LDLIBS += -lrt
 
 # disable verbose output
diff --git a/vis/Makefile b/vis/Makefile
index 8585f9a..9bf72c9 100644
--- a/vis/Makefile
+++ b/vis/Makefile
@@ -23,7 +23,7 @@ BINARY_NAME = vis
 OBJ = vis.o debugfs.o
 
 # alfred flags and options
-CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
 LDLIBS += -lrt
 
 # disable verbose output
-- 
1.8.4.rc3

Reply via email to