makefile target all: not built automatically
Hello I noticed that the all: target must be at the top of a makefile, unless explicitly built by make all. Is this expected? It seems quite limiting.. I'm running GNU Make 3.81, built for Windows32. Please retain my email address in any replies. Best regards, Jon Output: C:\make system target C:\make all system target all target C:\ = save the following text as makefile in an empty folder. # Simple makefile example .PHONY: system system: @echo system target all: system @echo all target # End simple makefile example ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make
Re: makefile target all: not built automatically
On Tue, 2011-04-26 at 13:31 +0100, Jon Grant wrote: I noticed that the all: target must be at the top of a makefile, unless explicitly built by make all. Is this expected? It seems quite limiting.. There is nothing special about the all target. That's just a convention that many, but not all, makefile authors use. Make itself doesn't treat the all target, if it exists, in any special way. The GNU make manual says: The order of rules is not significant, except for determining the default goal: the target for `make' to consider, if you do not otherwise specify one. The default goal is the target of the first rule in the first makefile. -- --- Paul D. Smith psm...@gnu.org Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net Please remain calm...I may be mad, but I am a professional. --Mad Scientist ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make
Re: makefile target all: not built automatically
Hello Paul On 26 April 2011 13:34, Paul Smith psm...@gnu.org wrote: On Tue, 2011-04-26 at 13:31 +0100, Jon Grant wrote: I noticed that the all: target must be at the top of a makefile, unless explicitly built by make all. Is this expected? It seems quite limiting.. There is nothing special about the all target. That's just a convention that many, but not all, makefile authors use. Make itself doesn't treat the all target, if it exists, in any special way. The GNU make manual says: The order of rules is not significant, except for determining the default goal: the target for `make' to consider, if you do not otherwise specify one. The default goal is the target of the first rule in the first makefile. Thank you for this. Could the text be updated to confirm that the target all: does not need to be the default target, this is a convention that many, but not all, makefile authors use. Make itself does not treat the all target, if it exists in a special way. I could not find a mention of the all target in manual sections. Perhaps it could even be mentioned in this chapter that all is not a special target: http://www.gnu.org/s/hello/manual/make/Special-Targets.html Best regards, Jon ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make
Re: makefile target all: not built automatically
Perhaps it could even be mentioned in this chapter that all is not a special target: There are quite a lot of other target names we could mention as not being special targets ! I think the thing you need to know, to understand what *is* documented, is that the first rule read, when parsing the make files, is the one made by default. No name is special in this regard, except that some (like .PHONY; quite probably all special targets) are ignored when determining which is first. Eddy. ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make