--- a/src/kernel/Makefile
+++ b/src/kernel/Makefile
@@ -43,7 +43,7 @@
 
 
 deps: $(HEADERS)
-	$(CXX) $(MANDATORY_INCPATH) -M $(SOURCES) > deps
+	$(CXX) $(MANDATORY_INCPATH) -M -MF deps $(SOURCES)
 
 $(TARGET): deps $(OBJECTS)
 	-$(DEL_FILE) $(TARGET)