When compiling code with make, where does the compiled result go?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
That depends on the Makefile. If no Makefile exists, I believe the result is in the current directory.
If no makefile exists, make won't run like that. But the choices are never so numerous. Either the new binary is in the current directory or in one of the sub-directories. Most of the time, in my experience, there is "bin". If not, the binary may be produced right beside the source-files in "src". There are cases, where platform-specific subdirectories should be scrutinized. I have also one package that allows Gnu-Make or CMake and drops the binary in the pertinently named sub-directory.
Searching *all these* and even more, is not an immensly long process. Human logic applies in pratically all packages that I compile.., even my own.
Cheerio
P.S.: when working in the w3m browser the edit button below my post is labelled "Edit Mess". How did you know me that well...
Last edited by Michael Uplawski; 12-10-2020 at 06:57 AM.
$ ls
hi.c
$ make hi
cc hi.c -o hi
hi.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main(){printf("hi!\n");}
^
... warning messages ...
$ ./hi
hi!
$
Maybe not, but someone who finds the thread later can be comforted and maybe less alienated by a lax handling of the forum conventions. All is theory; you have to want and I am always glad to see people want something.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.