Build System | configure Ā Equivalent | make Ā Equivalent | Used In | ć
¤ |
GNU Autotools (Unix) | ./configure | make | GLIBC, OpenSSL, Bash | ā ļø Limited (with MinGW/Cygwin) |
CMake | cmake . | make | Qt, LLVM, KDE | Native Windows support |
Meson/Ninja | meson setup | ninja | GNOME, Systemd | Cross-platform |
Bazel | bazel build | bazel run | TensorFlow, Google projects | Cross-platform |
MSBuild | .sln Ā orĀ .vcxproj Ā files | msbuild <project>.sln | .NET, Windows apps | Windows-only |
SCons | ć
¤ | ć
¤ | Embedded systems | Cross-platform |
š What DoĀ configure
,Ā make
, andĀ make install
Ā Do?
When compiling software from source (like GLIBC), we typically run three key commands:
1ļøā£Ā
./configure
2ļøā£Ā
make
3ļøā£Ā
make install
Each command has a specific purpose in theĀ compilation and installation process. Letās break them down! š
š 1ļøā£Ā ./configure
Ā - Prepares the Build
What It Does:
- Checks your systemĀ to see if it has the necessary dependencies (likeĀ
gcc
,Āmake
, etc.).
- Sets up configuration filesĀ (e.g.,Ā
Makefile
) based on your system.
- Defines where the program will be installedĀ (viaĀ
-prefix=<install_path>
).
Example:
bash CopyEdit ./configure --prefix=/opt/glibc-2.32
- This tells the software:"When installed, put the files inĀ
/opt/glibc-2.32
Ā instead of the defaultĀ/usr/local
."
- If you donāt useĀ
-prefix
, the default install location isĀ/usr/local
.
What It Produces:
- Creates aĀ
Makefile
Ā that tellsĀmake
Ā how to build the program.
š 2ļøā£Ā make
Ā - Compiles the Source Code
What It Does:
- Reads theĀ
Makefile
Ā (created byĀconfigure
).
- Compiles the source codeĀ into object files (
.o
Ā files).
- LinksĀ the compiled files to create an executable binary.
Example:
bash CopyEdit make -j$(nproc)
- TheĀ
j$(nproc)
Ā flag tellsĀmake
Ā toĀ use all available CPU coresĀ for faster compilation.
What It Produces:
- A compiled version of the program (in theĀ
build/
Ā folder, not installed yet).
Note:Ā At this stage, the program is compiled butĀ not installed. You can run it from the build directory but not from anywhere else.
š 3ļøā£Ā make install
Ā - Installs the Compiled Program
What It Does:
- Copies the compiled filesĀ from theĀ
build/
Ā folder to the directory specified byĀ-prefix
.
- Makes the program available system-wideĀ (or in the Conda environment, if installed there).
Example:
bash CopyEdit make install
- If you usedĀ
-prefix=/opt/glibc-2.32
, then afterĀmake install
, the files will be installed in:
bash CopyEdit /opt/glibc-2.32/bin/ /opt/glibc-2.32/lib/
make install
Ā typically creates:bin/
Ā ā Executables
lib/
Ā ā Libraries
include/
Ā ā Headers
share/
Ā ā Data files
etc/
Ā ā Config files
lib/pkgconfig/
Ā ā Metadata
What It Produces:
- TheĀ final installed versionĀ of the program.
- Now, you can run it from anywhere without specifying a full path.
Ā
š TL;DR: What Each Step Does
Command | What It Does | What It Produces |
./configure | Prepares the build (checks dependencies, sets paths, createsĀ Makefile ). | AĀ Makefile Ā (instructions for compiling). |
make | Compiles the source code into binaries. | A workingĀ compiledĀ program (but not installed yet). |
make install | Installs the program in the specified directory ( --prefix ). | TheĀ final installed versionĀ of the program. |
Ā