Ctrl+ Cทำให้ a SIGINTถูกส่งไปยังกระบวนการที่กำลังทำงานอยู่ กระบวนการนี้สามารถจับสัญญาณได้ ในซอร์สโค้ด make คุณสามารถค้นหากับดักสำหรับสัญญาณนี้ได้commands.c:
/* If we got a signal that means the user
wanted to kill make, remove pending targets. */
if (sig == SIGTERM || sig == SIGINT
... remove childrens ...
/* Delete any non-precious intermediate files that were made. */
remove_intermediates (1);
remove_intermediates()เป็นฟังก์ชันการล้างข้อมูลmakeให้ดูนิยามของมันที่นี่:
/* Remove all nonprecious intermediate files.
If SIG is nonzero, this was caused by a fatal signal,
meaning that a different message will be printed, and
the message will go to stderr rather than stdout. */
และหลังจากนั้นในฟังก์ชั่นที่คุณเห็นมันจะถูกลบอย่างมีประสิทธิภาพ:
status = unlink (f->name);
สรุป:
โดยทั่วไปไม่ต้อง affraid makeขัดจังหวะการสะสมด้วย หากไม่ใช่สัญญาณที่จับไม่ได้ ( SIGKILL, SIGSEGV, SIGSTOP) จะทำการล้างไฟล์กลาง