1
我試圖從源代碼構建trace-cmd.git;最糟糕的是,我已經在同一臺機器上建立過一次,成功;但是沒有留下任何註釋,也不能說出在此期間發生了什麼。使錯誤的路徑,與「沒有規則制定目標」失敗
所以現在我試圖重建,我也得到了可怕的:
trace-cmd$ make
make: *** No rule to make target `/media/disk/trace-cmd/event-parse.c', needed by `event-parse.o'. Stop.
好吧,讓我們來看看調試說:
trace-cmd$ make -d
...
Successfully remade target file `trace_python_dir'.
Pruning file `tc_version.h'.
Considering target file `libparsevent.a'.
Considering target file `event-parse.o'.
Pruning file `/media/disk/src/trace-cmd/event-parse.c'. ## THIS EXISTS!
Pruning file `.event-parse.d'.
Considering target file `/media/disk/trace-cmd/event-parse.c'. ## THIS DOESN'T???
File `/media/disk/trace-cmd/event-parse.c' does not exist.
...
Trying pattern rule with stem `event-parse.w'.
Trying implicit prerequisite `/media/disk/trace-cmd/SCCS/s.event-parse.w'.
Trying pattern rule with stem `event-parse'.
Rejecting impossible implicit prerequisite `/media/disk/trace-cmd/event-parse.w'.
No implicit rule found for `/media/disk/trace-cmd/event-parse.c'.
Finished prerequisites of target file `/media/disk/trace-cmd/event-parse.c'.
Must remake target `/media/disk/trace-cmd/event-parse.c'.
make: *** No rule to make target `/media/disk/trace-cmd/event-parse.c', needed by `event-parse.o'. Stop.
OK,這是怎麼回事?當然實際文件存在:
trace-cmd$ ls -la /media/disk/src/trace-cmd/event-parse.c
-rw-r--r-- 1 user user 121563 2013-03-20 19:03 /media/disk/src/trace-cmd/event-parse.c
...但這是/media/disk/src/trace-cmd/event-parse.c
!!並且:
make
已經發現它一次;- 尚未
make
決定,出於某種原因,從路徑刪除/src/
,
...這顯然文件不存在:
trace-cmd$ ls /media/disk/trace-cmd/event-parse.c
ls: cannot access /media/disk/trace-cmd/event-parse.c: No such file or directory
有人能解釋我, make
有什麼可能的原因決定放棄一部分路徑,使它找不到一個文件,它最初有一個正確的參考?
下一次,請考慮使用'remake'來調試這些問題。 –
非常感謝評論,@BasileStarynkevitch--之前曾聽說過「重拍」,但我沒有想到它適用於這種情況。乾杯! – sdaau