GNU Make 4.4.1
Built for x86_64-redhat-linux-gnu
I've been fooling around looking at gmake's debug output.
When running
make -d -f makefile
I saw the following output:
Reading makefile 'makefile'...
Updating makefiles....
Considering target file 'makefile'.
Looking for an implicit rule for 'makefile'.
Trying pattern rule '%: %.o' with stem 'makefile'.
Trying implicit prerequisite 'makefile.o'.
Not found 'makefile.o'.
Trying pattern rule '%: %.c' with stem 'makefile'.
Trying implicit prerequisite 'makefile.c'.
Not found 'makefile.c'.
Trying pattern rule '%: %.cc' with stem 'makefile'.
Trying implicit prerequisite 'makefile.cc'.
Not found 'makefile.cc'.
Trying pattern rule '%: %.C' with stem 'makefile'.
Trying implicit prerequisite 'makefile.C'.
Not found 'makefile.C'.
Trying pattern rule '%: %.cpp' with stem 'makefile'.
Trying implicit prerequisite 'makefile.cpp'.
Not found 'makefile.cpp'.
Trying pattern rule '%: %.p' with stem 'makefile'.
Trying implicit prerequisite 'makefile.p'.
Not found 'makefile.p'.
Trying pattern rule '%: %.f' with stem 'makefile'.
Trying implicit prerequisite 'makefile.f'.
Not found 'makefile.f'.
Trying pattern rule '%: %.F' with stem 'makefile'.
Trying implicit prerequisite 'makefile.F'.
Not found 'makefile.F'.
Trying pattern rule '%: %.m' with stem 'makefile'.
Trying implicit prerequisite 'makefile.m'.
Not found 'makefile.m'.
Trying pattern rule '%: %.r' with stem 'makefile'.
Trying implicit prerequisite 'makefile.r'.
Not found 'makefile.r'.
Trying pattern rule '%: %.s' with stem 'makefile'.
Trying implicit prerequisite 'makefile.s'.
Not found 'makefile.s'.
Trying pattern rule '%: %.S' with stem 'makefile'.
Trying implicit prerequisite 'makefile.S'.
Not found 'makefile.S'.
Trying pattern rule '%: %.mod' with stem 'makefile'.
Trying implicit prerequisite 'makefile.mod'.
Not found 'makefile.mod'.
Trying pattern rule '%: %.sh' with stem 'makefile'.
Trying implicit prerequisite 'makefile.sh'.
Not found 'makefile.sh'.
Trying pattern rule '%:: %,v' with stem 'makefile'.
Trying implicit prerequisite 'makefile,v'.
Not found 'makefile,v'.
Trying pattern rule '%:: RCS/%,v' with stem 'makefile'.
Trying implicit prerequisite 'RCS/makefile,v'.
and a bunch more similar lines, all treating makefile like a target.
My question is why is make treating an argument that is clearly
specified as a makefile name as a target?
Cordially,
Jon Forrest