/*****************************************************************************
*                              MAKEFILE
*
*  PURPOSE: Build the following modules:
*
*           "a_hello.obj"
*           "a_world.obj"
*           "hello.obj"
*           "world.obj"
*           "message.lib"
*           "greeting.obj"
*           "greeting.exe"
*
*  NOTE: None of the comments in this make file are required.  They have
*        been provided to help you understand how CMAKE handles each
*        command.  In other words, this make file could be reduced down to
*        the following seven commands:
*
*        masm /W2 /V /Z a_hello.asm,a_hello.obj;
*        masm /W2 /V /Z a_world.asm,a_world.obj;
*        cl /c /W4 hello.c
*        cl /c /W4 world.c
*        lib @message.lrf
*        cl /c /W4 greeting.c
*        link @greeting.lnk
*
*****************************************************************************/

/*****************************************************************************
*                             A_HELLO.OBJ
*
*  The following MASM command will be executed only when one of the
*  following conditions is true:
*
*  1. "a_hello.obj" does not exist.
*  2. "a_hello.asm" is newer than "a_hello.obj".
*  3. "hello.inc" is newer than "a_hello.obj".
*
*****************************************************************************/

masm /W2 /V /Z a_hello.asm,a_hello.obj;

/*****************************************************************************
*                             A_WORLD.OBJ
*
*  The following MASM command will be executed only when one of the
*  following conditions is true:
*
*  1. "a_world.obj" does not exist.
*  2. "a_world.asm" is newer than "a_world.obj".
*  3. "world.inc" is newer than "a_world.obj".
*
*****************************************************************************/

masm /W2 /V /Z a_world.asm,a_world.obj;

/*****************************************************************************
*                              HELLO.OBJ
*
*  The following CL command will be executed only when one of the
*  following conditions is true:
*
*  1. "hello.obj" does not exist.
*  2. "hello.c" is newer than "hello.obj".
*  3. "hello.h" is newer than "hello.obj".
*
*****************************************************************************/

cl /c /W4 hello.c

/*****************************************************************************
*                               WORLD.OBJ
*
*  The following CL command will be executed only when one of the
*  following conditions is true:
*
*  1. "world.obj" does not exist.
*  2. "world.c" is newer than "world.obj".
*  3. "world.h" is newer than "world.obj".
*
*****************************************************************************/

cl /c /W4 world.c

/*****************************************************************************
*                              MESSAGE.LIB
*
*  The following LIB command will be executed only when one of the
*  following conditions is true:
*
*  1. "message.lib" does not exist.
*  2. "a_hello.obj" is newer than "message.lib".
*  3. "a_world.obj" is newer than "message.lib".
*  4. "hello.obj" is newer than "message.lib".
*  5. "world.obj" is newer than "message.lib".
*
*  Actually, only those objects that are newer than the library,
*  "message.lib", will be added to the library.  For example, suppose
*  "message.lib" exists, "a_hello.obj" is newer than "message.lib", and
*  "message.lib" is newer than "a_world.obj", "hello.obj", and "world.obj".
*  In this case, only "a_hello.obj" must be added to the library,
*  "message.lib".  Thus, in this case, CMAKE would execute the following
*  command:
*
*  lib @message.clb
*
*  where "message.clb" consists of the following lines:
*
*  message.lib
*  -+a_hello.obj ;
*
*****************************************************************************/

lib @message.lrf

/*****************************************************************************
*                           GREETING.OBJ
*
*  The following CL command will be executed only when one of the
*  following conditions is true:
*
*  1. "greeting.obj" does not exist.
*  2. "greeting.c" is newer than "greeting.obj".
*  3. "a_hello.h" is newer than "greeting.obj".
*  4. "a_world.h" is newer than "greeting.obj".
*  5. "greeting.h" is newer than "greeting.obj".
*
*****************************************************************************/

cl /c /W4 greeting.c

/*****************************************************************************
*                           GREETING.EXE
*
*  The following LINK command will be executed only when one of the
*  following conditions is true:
*
*  1. "greeting.exe" does not exist.
*  2. "greeting.obj" is newer than "greeting.exe".
*  3. "message.lib" is newer than "greeting.exe".
*
*****************************************************************************/

link @greeting.lnk
