Getting the Latest Version and Installation133
4.6.4The ifndef Directive
The
ifndef
directive is similar to the
ifdef
directive. However selection of a block of
commands is reversed as compared to
ifdef
directive. Its format is as follows:
ifndef variable
block if variable is empty
else
block if variable is not empty
endif
4.6.5The for Control Structure
You have already used the
for
directive in the example of using
make
with multiple
directories. This directive is used to perform repeated operation on multiple items. The follow-
ing rule in the makefile is used to go into multiple directories and remove object files in each of
these directories:
SUBDIRS = ftp-dir tftp-dir common-dir
clean:
for dir in $(SUBDIRS) ; do \
( cd $$dir ; rm *.o) ; \
done
Each time a new value is assigned to variable
dir
from the values listed by the
SUBDIRS
variable until all of the values are used.
4.7Getting the Latest Version and Installation
Almost all of the Linux distributions come with
make
. The Red Hat 7.1 distribution that we
have used for this book already has the latest version of
make
. However if you want to get the
latest version of
GNU make
, it is available at the following FTP site.
ftp://ftp.gnu.org/pub/gnu/make/
This FTP site has multiple versions of the
make
utility. Download the latest version,
which will be a zipped
tar
file. The latest version at the time of writing this book is 3.79.1 and
the filename is
make-3.79.1.tar.gz.
4.7.1Compilation
After downloading this file, just un-tar it into a directory using the following command:
tar zxvf make-3.79.1.tar.gz
The source files will be extracted into directory
make-3.79.1
. Change to this directory
and run the
configure
script. It will create the makefiles appropriate for you. You should
have some previous version of
make
in order to build the latest version. Use the
make
com-
mand; the default rule contains information about how to build
make
. Use the following com-
Next Page >>
<< Previous Page
Back to the Table of Contents