Modify Commands in Makefiles

Modify Commands
These characters can be placed in front of a command to modify how the command is run:

- (dash) Turns error checking off for the command
@ (at sign) Suppress display of the command
! (exclamation point) Execute the command for each dependent file

When using these modifiers:

Turn Error Checking Off (-)

Syntax: -[option] command

The /i option globally turns command error-checking off. The dash (-) command modifier overrides the global setting to turn error check off for commands individually. This modifier is used in two ways:

Error Checking Off Examples

LIGHT.LST : LIGHT.TXT
  - FLASH LIGHT.TXT

In the example above, the Make utility continues execution, regardless of the exit code returned by FLASH.

LIGHT.LST : LIGHT.TXT
  -1 FLASH LIGHT.TXT

In the example above, the Make utility ends if the exit code returned by FLASH is greater than 1.

Suppress Display (@)

Syntax: @ command

The /s option globally suppresses the display of commands while the Make utility is running. The at sign (@) modifier suppresses the display for individual commands.

Note: Regardless of the /s option or the @ modifier, output generated by the command itself always appears.

Suppress Display Example

SORT.EXE : SORT.OBJ
   @ ECHO sorting

The command line calling the ECHO command is not displayed. The output of the ECHO command, however, is displayed.

Exclamation-point Modifier for Dependent Files (!)

Syntax: ! command

The exclamation-point modifier causes the command to be executed for each dependent file if the command uses one of the Make utility's predefined macros $? or $**. The $? macro refers to all dependent files out-of-date with respect to the target. The $** macro refers to all dependent files in the description block.

Exclamation Point (!) Modifier Examples

LEAP.TXT : HOP.ASM SKIP.BAS JUMP.C
  ! print $** lpt1:

The example above executes the following three commands, regardless of the modification dates of the dependent file:

print HOP.ASM lpt1:
print SKIP.BAS lpt11:
print JUMP.C lpt1:

LEAP.TXT : HOP.ASM SKIP.BAS JUMP.C
  ! print $? lpt:

The example above executes the print command only for those dependent files with modification dates later than that of the LEAP.TXT file. If HOP.ASM and JUMP.C have modification dates later than LEAP.TXT, the following two commands are executed:

print HOP.ASM lpt1:
print JUMP.C lpt1:



Supply input to the Make Utility from the Command Line
Supply input to the Make Utility from a Response File


Make Utility Command Options