Linux From Scratch

1

I am currently doing Linux From Scratch.I downloaded some packages.I unzip them using the "tar" command and do the following inside that extracted package:

  1. configure
  2. make
  3. make test
  4. make install

One more thing what is makefile ?

Kindly explain to me the purpose of these commands, especially in terms of LFS.Thanks in Advance.

PRANAY KASTHALA

Posted 2018-03-03T22:26:52.613

Reputation: 21

Question was closed 2018-03-04T07:34:46.947

The configure script is provided by autotools. If you check Google, WikiPedia, etc for Makefile and autotools configure script you should gets lots of resources for learning about them. – BenjiWiebe – 2018-03-03T23:14:56.500

Answers

-1

I (kind of) know what it does but I'm not sure if I know how to explain.

Basically with the sequence of commands you mentioned you are creating something in binary executable form (a program, a library) out of source code (i.e. code written in a programming language) and installing it in your operating system (moving it to an appropriate folder, setting up configuration files, etc).

The makefile is a text file which the make command uses. It helps (automates) tasks. A single makefile may contain information for more than one task or action for make to perform. Without a makefile you would have to perform a lot of complicated manual steps in order to get things done.

"configure": (explanation taken from here) Checks some details about the machine on which the software is going to be installed. This script checks for lots of dependencies on your system. For the particular software to work properly, it may be requiring a lot of things to be existing on your machine already. If any of the major requirements are missing on your system, the configure script would exit and you cannot proceed with the installation, until you get those required things. Otherwise it creates the Makefile to be used in the next step.

"make" without parameters: instructs make to execute the default action (rule) in the makefile. This usually compiles, links and generates the binary you are trying to create (i.e. the program or library). This usually involves converting the source code into object files (which usually have the .o extension) and linking them into a final binary file (which in case of Linux programs usually has no extension or in case of Linux libraries usually has the .so or .a extension). I'm not sure about the steps because I'm a Java programmer and we don't perform these steps very often).

"make test": performs tests on that binary.

"make install": basically moves the binary to the proper folder location.

This explanation can of course receive a lot of improvements, I'm just trying to give you an idea of the general process.

This short tutorial may provide some more information.

Piovezan

Posted 2018-03-03T22:26:52.613

Reputation: 140

http://lmgtfy.com/?q=linux+what+does+configure+do – BenjiWiebe – 2018-03-05T05:14:34.987

@BenjiWiebe Fixed. Btw in case the downvote was yours I think incomplete answers don't deserve a downvote, only wrong ones. – Piovezan – 2018-03-05T13:33:10.750

Downvoters please explain the reason behind the downvote. – Piovezan – 2018-03-05T14:50:42.713

3

The use of a Makefile makes life easier for both the developer and the end user. Basically, it is a cheat sheet of how to build a particular piece of software. For a simple "Hello world" a g++ hw.cpp -o hello_world can work. However, when you have much more complex software, it is often that piece A has to be built before piece B and once those two are done piece C can be built. Manually typing those out - as well as inserting paths to included libraries, temp output files, final installation paths, etc (usually determined when the configure script is run) - can lead to error.

ivanivan

Posted 2018-03-03T22:26:52.613

Reputation: 2 634