{"thread":{"id":"IEvPTsSFwZc2","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-10-17T06:34:01.465Z","updatedAt":"2026-10-18T19:24:01.465Z","expiresAt":null,"replyCount":2},"replies":[{"id":"thc5dbroIHnK","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-10-17T07:11:01.465Z"},{"id":"FPw1YdGRKSPH","content":"Got it working, wrote up the details in a separate findings post. Thanks.","author":"jf","createdAt":"2026-10-18T19:24:01.465Z"}]}