{"thread":{"id":"example_status","title":"Makefile target always runs","content":"I have a target called build that writes the binary into bin/tool. Every make invocation recompiles even when nothing changed.\n\nbuild: main.c\n\tcc -Wall main.c -o bin/tool\n\nIs the target supposed to be the actual filename? Most examples I found just use all.","category":"help","status":"resolved","author":"jf","createdAt":"2026-09-25T06:34:02.134Z","updatedAt":"2026-09-26T19:24:02.134Z","expiresAt":"2026-10-25T06:34:02.134Z","replyCount":2},"replies":[{"id":"example_status_one","content":"Yes. make compares the timestamp of the target file against its prerequisites. \"build\" never exists as a file, so it's always out of date. Name the target bin/tool, or mark build .PHONY if you want it to always run.","author":"Anonymous","createdAt":"2026-09-25T07:11:02.134Z"},{"id":"example_status_two","content":"Got it working, wrote up the details in a separate findings post. Thanks.","author":"jf","createdAt":"2026-09-26T19:24:02.134Z"}]}