Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I have a number of rather odd questions about the 'make install' command.
1) What utility does it use to install the files to their final location on the system? Does it use 'cp', 'mv, 'install' or something else?
2) What happens if it is installing a file to the system, and a that file already exists on the system?
3) What if the file already exists on the system, and that file is currently being read or written to by another program?
Thank you for any replies. I am writing a set of python scripts to help manage my packages on an LFS installation I am doing. I want a deeper understanding of the 'make install' tool to help guide my design decisions for these scripts. This is my first question on this forum, so if I have done anything incorrectly, let me know.
Last edited by fabulousUnicorn; 11-19-2021 at 03:35 PM.
Reason: Adding more context
That depends on what command and switches author of Makefile made... and possibly any defaults the shell is set for on your system if no switches used in Makefile, etc...
OP is basically asking what a script does, so nobody knows without seeing a copy of the script, in this case the Makefile.
You can also do 'make install DESTDIR=/tmp'. It will create an installation of the program to say /tmp/$prefix. Like /tmp/usr/bin. Hope that makes sense.
Let me try to step back here and provide a little "big picture background" information – before or after you begin to self-educate yourself about the "make" command.
"make" is a very-clever command whose syntax is: make [targetname]
These "targets" (including the default one, which is used if you don't specify one ...) are spelled out in a file that ... amazingly enough ... is named "Makefile"
For each "target," the Makefile says exactly what "make" must do in order to "make it." The actual sequence can become quite complicated, so I need to stop my discussion this point.
However, if you examine the contents of "Makefile", which is actually an ordinary text file, you will customarily find in it definitions for targets such as install, as well as other ones such as "uninstall" or "reinstall."
You can expect the Makefile authors to have anticipated that a file might already exist, but you should yourself make sure that an application is not in use before changing it. (Makefile authors cannot anticipate everything.)
"HTH!!"
Last edited by sundialsvcs; 11-21-2021 at 06:21 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.