Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland MAKE v4.0 - make basics http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MAKE basics
===========
MAKE uses rules from a text file (MAKEFILE or MAKEFILE.MAK by default)
to determine which files to build and how to build them. For example,
you can get MAKE to compile an .EXE file if the date-time stamps for
the .CPP files that contain the code for the .EXE are more recent than
the .EXE itself. MAKE is very useful when you build a program from
more than one file because MAKE will recompile only the files that you
modified since the last compile.

Two types of rules (explicit and implicit) tell MAKE what files depend
on each other. MAKE then compares the date-time stamp of the files in
a rule and determines if it should execute a command (the commands
usually tell MAKE which files to recompile or link, but the commands
can be nearly any operating system command).

The general syntax for MAKE is:

        MAKE [options...] [targets[s]]

(To get command-line help for MAKE, type MAKE -? or MAKE -h.)

"Options" are MAKE options that control how MAKE works, and
"targets" are the names of the files in a makefile that you want MAKE to
build. Options are separated from MAKE by a single space. Options and
targets are also separated by spaces.

If you type MAKE at the command prompt, MAKE performs the following
default tasks:

To place MAKE instructions in a file other than MAKEFILE, see
the section titled "MAKE options."

MAKE looks in the current directory for a file called BUILTINS.MAK
(this file contains rules MAKE always follows unless you use the -r option).
If it can't find the file in the current directory, it looks in the
directory where MAKE.EXE is stored. After loading BUILTINS.MAK, MAKE looks
for a file called MAKEFILE or MAKEFILE.MAK. If MAKE can't find any of these
files, it gives you an error message.

When MAKE finds a makefile, it tries to build only the first target
file in the makefile (although the first target can force other
targets to be built). MAKE checks the time and date of the dependent
files for the first target. If the dependent files are more recent
than the target file, MAKE executes the target commands, which update
the target. See the section called "Using makefiles" for more
information on instructions in makefiles.

 1) If a dependent file for the first target appears as a target elsewhere
    in the makefile, MAKE checks its dependencies and builds it before
    building the first target. This chain reaction is called linked
    dependency.

 2) If the MAKE build process fails, MAKE deletes the target file it was
    building. To get MAKE to keep a target when a build fails, see the
    .precious directive.

You can stop MAKE by using <Ctrl><Break> or <Ctrl><C>.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson