cdxf
cdxf

Reputation: 5648

What are makefiles, 'make install', etc.?

I see the following things in Linux, but what are they?

./configure
make
make install

etc etc.

Upvotes: 11

Views: 36036

Answers (7)

Chace Burke
Chace Burke

Reputation: 11

There is also make clean.

Here is a good reference: Tutorial on writing makefiles

Upvotes: 0

Oded
Oded

Reputation: 498904

make is part of the build system commonly used in Unix-type systems - binutils.

It looks at make files which hold configuration information and build targets.

Specifically -

  • ./configure - this is a script that sets up the environment for the build
  • make - calls make with the default build target. Normally builds the application.
  • make install - calls make with the install build target. Normally installs the application.

Upvotes: 10

ldav1s
ldav1s

Reputation: 16305

'./configure' is a shell script that is portable across multiple Unix systems (Linux, Solaris, etc.). './configure' does a few things: test the build environment, fix up portability issues, check for other optional software, check for where you want to install the software package, etc. You can find out what kind of options can be configured by './configure --help'. Just invoking './configure' will just configure the package with whatever it considers default. The main output file from running './configure' is usually a file called 'Makefile' which is the combined build/install/uninstall instructions for the software package.

'make' uses the 'Makefile' to build the default target which is usually the entire collection of things that need to be built.

'make install' uses the 'Makefile' to build the 'install' target which installs the software.

Upvotes: 2

Paul Tomblin
Paul Tomblin

Reputation: 182762

./configure is a program that looks at your system configuration and builds some of the system dependencies for your program. make is a program that looks at your Makefile (which was probably built by configure) and uses the rules in there to build your program. The Makefile can have multiple "targets" which are rule sets to do different things - the default is usually just to compile and link your program. When you say make with no arguments, it runs the default target. When you say make install you're running the install target, which usually installs the binaries or libraries built by the default target in their final locations. clean is another common Makefile target that deletes all the generated files like intermediate object files.

Upvotes: 13

Erik B
Erik B

Reputation: 42554

It is basically a build system.

./configure checks if you have all the required dependencies and creates the Makefile.
make compiles the software using the rules of the Makefile.
make install moves the software to the correct location in the filesystem.

Upvotes: 4

Justin
Justin

Reputation: 86729

Make takes care of running the (sometimes very complex) set of instructions and commands needed to build source control into a compiled executable or library.

make (software)

make is a utility that automatically builds executable programs and libraries from source code

Upvotes: 3

o0'.
o0'.

Reputation: 11863

configure checks if you have all the prerequisites/dependencies to build the software.

make does the actual compilation.

make install installs the software in the correct location.

Upvotes: 7

Related Questions