Reputation: 759
I have a 'make' problem that I've boiled down to a very tiny Makefile.
The goal: I have a file, "template". When it gets modified, I want 'make' to run a utility over it to generate "template.c", and then compile "template.c" to become the module "template.o".
So, I'd expect 'make' to look at my Makefile and say "hmmm...template.c is older than 'template', so I need to make it. Hmm, that means I'll need to make template.o" ... and that's fine.
But, instead, I get: Circular template <- template.o dependency dropped.
The Makefile:
# makemake 20230602
default_target: template.o
template.o: template.c
@echo good, we are going to make template.o
template.c: template
cp template template.c
I replaced the utility I use by "cp", to allow easy reproduction of the error.
Yes, I googled/searched ... found a fair number of similar questions, but most were related to pattern matching / wildcard stuff, or true circular loops (a <- a).
Thanks! (on macOS Monterey; GNU Make 3.81)
Upvotes: 0
Views: 16