Page 144 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 144
Network Operating Systems-I
notes
Did u know? What are the uses of the make command?
7.3.3 Looking for Documentation
Most developers provide README or INSTALL files in the program archive. These are text files
that include instructions on compiling and installing the program.
Linux provides a developer’s utility called make. This utility allows the developer to provide a
script called a Makefile, which, when run through make, will compile the program automatically.
The Makefile can also include installation instructions.
In most cases, change to the directory containing the source code, then run the command make,
followed by the command make install. There might also a configure script that needs to be run
with ./configure before the make command.
Task “The Makefile can also include installation instructions.” Comment
7.4 Configuring the Package
Most packages ship with an auto-configuration script; it is safe to assume they do unless their
documentation says otherwise. These scripts are typically named configure, and they take
parameters. There are a handful of stock parameters that are available across all configure scripts,
but the interesting stuff occurs on a program-by-program basis. Each package will have a handful
of features that can be enabled or disabled or that have special values set at compile time, and
they must be set up via configure.
To see what configure options come with a package, simply run:
./configure --help
Yes, those are two hyphens (--) before the word “help.”
One commonly available option is --prefix. This option allows you to set the base directory where
the package gets installed. By default, most packages use /usr/local. Each component in the
package will install into the appropriate directory in /usr/local.
With all of the options you want set up, a final run of configure will create a special type of file
called a makefile. Makefiles are the foundation of the compilation phase. Generally, if configure
fails you will not get a makefile. Make sure that the configure command did indeed complete
without any errors.
7.4.1 compiling your package
One of the key benefits of open-source software is that you have the source code in your hands.
If the developer chooses to stop working on it, you can continue. If you find a problem, you can
fix it. In other words, you are in control of the situation and not at the mercy of a commercial
developer you can’t control. But having the source code means you need to be able to compile it,
too. Otherwise all you have is a bunch of text files that can’t do much.
In this section, we will step through the process of compiling the Hello package, a GNU software
package that might seem useless at first, but there are reasons for its existence. Most GNU
software conforms to a standard method of installing, so let’s go ahead and get the package.
Compiling your package is the easy part. All you need to do is run make, like so:
make
138 LoveLy professionaL university