foo.c: foo fsm < foo > foo.c Your problem here is that in addition to your explicit rule, there is also an implicit suffix rule for `foo: foo.c', thus causing a loop. You need to disable the suffix rule. ------------------------------------------------------------------------------