Make is a general purpose workflow program, usually used for compilation. But it can be used for anything.

When you do something like "make all", the make program executes a rule named "all" from a file in current directory named "Makefile". This rule usually calls the compiler to compile some source code into binaries.

When you do "make install", the make program takes the binaries from the previous step and copies them into some appropriate locations so that they can be accessed. Unlike on Windows, installation just requires copying some libraries and executables and there is no registry requirement as such. In short, "make install" just copies compiled files into appropriate locations.

Answer from sharjeel on Stack Exchange
🌐
DEV Community
dev.to › skypy › linux-make-install-command-2dd6
Linux make install command - DEV Community
September 1, 2021 - $ sudo make install ./installer.sh /opt/testapp kiwi kiwi 'testapp' -> '/opt/testapp/bin/testapp' (backup: '/opt/testapp/bin/testapp~') 'testapp.conf' -> '/opt/testapp/etc/testapp.conf' (backup: '/opt/testapp/etc/testapp.conf~') installation ...
Top answer
1 of 5
78

Make is a general purpose workflow program, usually used for compilation. But it can be used for anything.

When you do something like "make all", the make program executes a rule named "all" from a file in current directory named "Makefile". This rule usually calls the compiler to compile some source code into binaries.

When you do "make install", the make program takes the binaries from the previous step and copies them into some appropriate locations so that they can be accessed. Unlike on Windows, installation just requires copying some libraries and executables and there is no registry requirement as such. In short, "make install" just copies compiled files into appropriate locations.

2 of 5
54

make install does whatever the Makefile author wants it to do. Typically, by this point, it is too late to change the install directory, as it is often known earlier, during the build, so help files and configuration files can be referenced with the correct pathnames.

Many projects use the GNU Autotools to try to improve their portability among hardware and operating system differences. (Different Unix variants use slightly different headers for declarations of functions that are slightly off the usual path -- except most programs need one or another of the ones declared in different locations.)

When a project does use the Autotools, the normal mantra to install it is:

./configure
make
make install

The ./configure typically allows you to use a command line option like --prefix /opt/apache or something similar to specify a different pathname. /usr/local/ is a common default prefix. It is far easier for locally built software to live in one place and distribution-provided software to live in the "main directories": /usr/ /bin/, and so on. (Packagers are very careful to never touch files in /usr/local/ -- they know it is exclusively for system administrators.)

Anyway, the ./configure --prefix /path/to/new/prefix will set a variable in the Makefile that is available when compiling the program, modifying the manual pages so they point to the correct locations for files, modifying configuration files, etc. So make will build the software specifically for the install location you want and make install will install it into that location.

Most programs can run even without the final make install step -- just ./program_name will often start them up. This is definitely a per-project thing -- some, like postfix, qmail, etc., are made up of many different moving pieces and rely on them all working together. Others, like ls or su might be self-contained enough to execute fine from the directory they were built in. (This is not often useful -- but sometimes very useful.)

However, not all projects use the Autotools -- they are huge, complicated, and miserable to maintain. Hand-written Makefiles are much simpler to write, and I personally think just distributing a simple Makefile with configuration variables available is a lot easier on developers and users both. (Though the ./configure ; make ; make install mantra is really easy on users when it works.)

Discussions

makefile - How can I install and use "make" in Windows? - Stack Overflow
Many Makefiles are written for Unix-like systems and will require you to install a significant amount of additional utilities (including a supported compiler if the project involves compiled code) such as Cygwin, or simply switching to a platform like WSL if you really cannot free yourself from Windows entirely. ... make is a GNU command... More on stackoverflow.com
🌐 stackoverflow.com
c - How to implement "make install" in a Makefile? - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Ask questions, find answers and collaborate at work with Stack Overflow for Teams More on stackoverflow.com
🌐 stackoverflow.com
February 8, 2020
install command in makefile - Stack Overflow
Iam getting some error while installing executable in /usr/local/bin thru makefile: install -m 755 my_execble /usr/local/bin install: cannot create regular file /usr/local/bin/my_execble: Permission More on stackoverflow.com
🌐 stackoverflow.com
make - What is the purpose of the 'install' command? - Unix & Linux Stack Exchange
I've seen the install command used in a lot of Makefiles, and its existence and usage are kind of confusing. From the manpages, it seems like a knockoff of cp with less features, but I assume it wo... More on unix.stackexchange.com
🌐 unix.stackexchange.com
🌐
GNU
gnu.org › software › make › manual › html_node › Install-Command-Categories.html
Install Command Categories (GNU make)
Here is one way of extracting the pre-installation commands (the -s option to make is needed to silence messages about entering subdirectories): make -s -n install -o all \ PRE_INSTALL=pre-install \ POST_INSTALL=post-install \ NORMAL_INSTALL=normal-install \ | gawk -f pre-install.awk · where ...
🌐
Thoughtbot
thoughtbot.com › blog › the-magic-behind-configure-make-make-install
The magic behind configure, make, and make install
August 5, 2024 - ... Now that the software is built and ready to run, the files can be copied to their final destinations. The make install command will copy the built program, and its libraries and documentation, to the correct locations.
Find elsewhere
🌐
The Linux Documentation Project
tldp.org › HOWTO › Software-Building-HOWTO-3.html
Building and Installing Software Packages for Linux: Using Make
The imake utility constructs a Makefile appropriate for your system from the Imakefile. In almost all cases, however, you would run xmkmf, a shell script that invokes imake, a front end for it. Check the README or INSTALL file included in the software archive for specific instructions.
🌐
Medium
medium.com › @jaz1 › introduction-to-makefiles-a10035631f69
Introduction to Makefiles. A Makefile is a file with a list of… | by Jaz Allibhai | Medium
January 31, 2022 - For example, if you want to install ... you can define the task in the Makefile and run a simple make command (for example, ‘make install’) to install all the dependencies....
🌐
iO Flood
ioflood.com › blog › install-make-command-linux
Intro to 'make' Linux Command: Installation and Usage
April 26, 2024 - Finally, install ‘make’ using the make install command. cd make-4.2.1/ ./configure make sudo ./make install # Output: # Making install in glob # make[1]: Entering directory '/home/user/make-4.2.1/glob' # ... The configure script works by ...
🌐
Colorado State University
math.colostate.edu › ~yzhou › computer › writemakefile.html
Tutorial on writing makefiles
Often it is convenient to put commands into the makefile that don't actually build a file, but are somehow logically associated with the build process. For example, a very common procedure in makefiles is something like this: prefix=/usr/local install: our_program install -m 0755 our_program ...
🌐
Medium
medium.com › @dmaioni › makefile-compile-and-install-projects-9ba10ce21566
Makefile, compile and install projects | by Daniel Maioni | Medium
June 6, 2023 - A Makefile is a file containing a set of directives used by the make build automation tool to generate a target/goal (install, uninstall, remove some files and others) The make command, will compile the project, and make install will copy those ...
🌐
Simon Tatham
chiark.greenend.org.uk › doc › make-doc › make.html › Makefile-Conventions.html
Makefile Conventions (GNU make)
Every Makefile should also define the variables INSTALL_PROGRAM and INSTALL_DATA. (The default for INSTALL_PROGRAM should be $(INSTALL); the default for INSTALL_DATA should be ${INSTALL} -m 644.) Then it should use those variables as the commands for actual installation, for executables and ...
🌐
SourceForge
gnuwin32.sourceforge.net › packages › make.htm
make for Windows
For each non-source file in the program, the makefile specifies the shell commands to compute it. These shell commands can run a compiler to produce an object file, the linker to produce an executable, ar to update a library, or TeX or Makeinfo to format documentation. Make is not limited to building a package. You can also use Make to control installing ...
🌐
Windows Forum
windowsforum.com › forums › windows help and support forums › windows news
How to Install and Use Makefiles on Windows 11: A Complete Guide | Windows Forum
April 20, 2025 - To streamline the command usage, renaming is beneficial: File Explorer Navigation: Go to where MinGW is installed, open the Bin folder, and locate mingw32-make.exe. Renaming: Simply rename this file to make. Now, instead of typing mingw32-make, you can simply use make moving forward. Once Make is installed, it's time to create your first Makefile:
🌐
Linux Hint
linuxhint.com › install-make-ubuntu
How to install make on Ubuntu – Linux Hint
It includes executable targets and instructions and is not permitted to generate several makefiles. It’s best if you make a separate directory for it. It maintains track of recently updated files, so only update those that are needed. As a result, this article will show you how to install the make package on Ubuntu. Before installing the make package, it is better to update your already installed packages; otherwise, you may find compatibility issues with some software. You can do that by typing. ... This command will provide you with the information of all outdated packages that can be upgraded to the newer version, so this is highly recommended before installing any new package.