Creating a description file
The make command uses information from a description file, which you create, to build a file containing the completed program, which is then called a target file.
The description file informs the make command how to build the target file, which files are involved, and what their relationships are to the other files in the procedure. The description file contains the following information:
- Target file name
- Parent file names that make up the target file
- Commands that create the target file from the parent files
- Definitions of macros in the description file
- User-specified rules for building target files
By checking the dates of the parent files, themake command determines which files to create to get an up-to-date copy of the target file. If any parent file was changed more recently than the target file, the make command creates the files affected by the change, including the target file.
If you name the description file either makefile or Makefile and are working in the directory containing that description file, type the following to update the first target file and its parent files:
make
Updating occurs regardless of the number of files changed since the last time the make command created the target file. In most cases, the description file is easy to write and does not change often.
To keep many different description files in the same directory, name them differently. Then, enter:
make -f Desc-File
where Desc-File is the name of the description file.