make main
without any makefile at all?If you haven't done so, delete the makefile now (you have it in version control anyway) and give it a try.
make main
without any makefile at all?If you haven't done so, delete the makefile now (you have it in version control anyway) and give it a try.
https://www.gnu.org/software/make/manual/html_node/Catalogue...
Note: I was initially annoyed with parent's "do this and see what happens" post and its lack of substantive communication, and responded poorly. This comment is substantially edited.
That's an odd thing to read into my comment. I am merely passing on information that was at one point given to me when I myself had a Makefile that was actually not needed because the program it was for was a single source file project like OP.
Also in what way is it easier to read a long document without reference to a specific section than it is to just delete the makefile and run make and the stem of the name of the source file?
Edit: My second paragraph of this comment was written prior to parent commenter editing their comment.
You may feel differently. That's fine. But differing opinions being downvoted to oblivion is ... problematic, at best.
EDIT: After reading your response below, you were right and I was wrong. Editing.
When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."
You may think that encouraging experimentation without giving an explanation is rude, but to me it's just a different way of sharing knowledge.
The parent suggests removing the makefile entirely and running `make main`, and observing the result. That would be a learning experience (and much better than your "RTFM")! But, if you don't want to humor that, the thing to say is: The result is that it works, and correctly builds the program, without a makefile at all.
The explanation is that GNU Make has a catalog of built-in rules (which you linked to); but it's quite a leap from knowing that fact, and even making use of them, to realizing that it means in some cases you don't need a makefile at all.
Exactly my intention. Thank you, I was worried after the first response from the other person that I'd worded myself too poorly and that more people would think I was being "self-impressed and coy" when that was not the intention at all.
make
make main
is enough.