4.5 Make Utility Options

When you build a project in EDE, EDE generates a makefile and uses the graphical make utility wmk to build all your files. However, you can also use the make utility mktc from the command line to build your project.

The invocation syntax is:

This section describes all options for the make utility. The make utility is a command line tool so there are no equivalent options in EDE.

Defining Macros

Command line syntax

Description

With this argument you can define a macro and specify it to the make utility.

A macro definition remains in existence during the execution of the makefile, even when the makefile recursively calls the make utility again. In the recursive call, the macro acts as an environment variable. This means that it is overruled by definitions in the recursive call. Use the option -e to prevent this.

You can specify as many macros as you like. If the command line exceeds the limit of the operating system, you can define the macros in an option file which you then must specify to the compiler with the option -m file.

Defining macros on the command line is, for example, useful in combination with conditional processing as shown in the example below.

Example

Consider the following makefile with conditional rules to build a demo program and a real program:

You can now use a macro definition to set the DEMO flag:

In both cases the absolute obect file real.elf is created but depending on the DEMO flag it is linked with demo.o or with real.o.

Related information

Make utility option -e (Environment variables override macro definitions)
Make utility option -m (Name of invocation file)

-?

Command line syntax

Description

Displays an overview of all command line options.

Example

The following invocation displays a list of the available command line options:

Related information

-

-a

Command line syntax

Description

Normally the make utility rebuilds only those files that are out of date. With this option you tell the make utility to rebuild all files, without checking whether they are out of date.

Example

Rebuilds all your files, regardless of whether they are out of date or not.

Related information

-

-c

Command line syntax

Description

EDE uses this option for the graphical version of make when you create sub-projects. In this case make calls another instance of make for the sub-project. With the option -c, the make utility runs as a child process of the current make.

The option -c overrules the option -err.

Example

The following command runs the make utility as a child process:

Related information

Make utility option -err (Redirect error messages to file)

-D/-DD

Command line syntax

Description

With the option -D the make utility prints every line of the makefile to standard output as it is read by mktc.

With the option -DD not only the lines of the makefile are printed but also the lines of the mktc.mk file (implicit rules).

Example

Each line of the makefile that is read by the make utility is printed to standard output (usually your screen).

Related information

-

-d/-dd

Command line syntax

Description

With the option -d the make utility shows which files are out of date and thus need to be rebuild. The option -dd gives more detail than the option -d.

Example

Shows which files are out of date and rebuilds them.

Related information

-

-e

Command line syntax

Description

If you use macro definitions, they may overrule the settings of the environment variables.

With the option -e, the settings of the environment variables are used even if macros define otherwise.

Example

The make utility uses the settings of the environment variables regardless of macro definitions.

Related information

-

-err

Command line syntax

Description

With this option the make utility redirects error messages and verbose messages to a specified file.

With the option -s the make utility only displays error messages.

Example

The make utility writes messages to the file error.txt.

Related information

Make utility option -s (Do not print commands before execution)

-f

Command line syntax

Description

Default the make utility uses the file makefile to build your files.

With this option you tell the make utility to use the specified file instead of the file makefile. Multiple -f options act as if all the makefiles were concatenated in a left-to-right order.

Example

The make utility uses the file mymake to build your files.

Related information

-

-G

Command line syntax

Description

Normally you must call the make utility mktc from the directory where your makefile and other files are stored.

With the option -G you can call the make utility from within another directory. The path is the path to the directory where your makefile and other files are stored and can be absolute or relative to your current directory.

Example

Suppose your makefile and other files are stored in the directory \currdir\myfiles. When your current directory is \currdir, you can call the make utility as follows:

Related information

-

-i

Command line syntax

Description

When an error occurs during the make process, the make utility exits with a certain exit code.

With the option -i, the make utility exits without an error code, even when errors occurred.

Example

The make utility exits without an error code, even when an error occurs.

Related information

-

-K

Command line syntax

Description

With this option the make utility keeps temporary files it creates during the make process. The make utility stores temporary files in the directory that you have specified with the environment variable TMPDIR or in the default 'temp' directory of your system when the TMPDIR variable is not specified.

Example

The make utility preserves all temporary files.

Related information

Section 1.3.2, Configuring the Command Line Environment, in Chapter Software Installation of the User's Guide.

-k

Command line syntax

Description

When during the make process the make utility encounters an error, it stops rebuilding your files.

With the option -k, the make utility only stops building the target that produced the error. All other targets defined in the makefile are built.

Example

If the make utility encounters an error, it stops building the current target but proceeds with the other targets that are defined in the makefile.

Related information

Make utility option -S (Undo the effect of -k)

-m

Command line syntax

Description

Instead of typing all options on the command line, you can create an option file which contains all options and flags you want to specify. With this option you specify the option file to the make utility.

Use an option file when the length of the command line would exceed the limits of the operating system, or just to store options and save typing.

You can specify the option -m multiple times.

Format of an option file

     "This has a single quote ' embedded"
     'This has a double quote " embedded'
     'This has a double quote " and \
     a single quote '"' embedded"
     "This is a continuation \
     line"
          -> "This is a continuation line"

Example

Suppose the file myoptions contains the following lines:

Specify the option file to the make utility:

This is equivalent to the following command line:

Related information

-

-n

Command line syntax

Description

With this option you tell the make utility to perform a dry run. The make utility shows what it would do but does not actually perform these tasks.

This option is for example useful to quickly inspect what would happen if you call the make utility.

Example

The make utility does not perform any tasks but displays what it would do if called without the option -n.

Related information

Make utility option -s (Do not print commands before execution)

-p

Command line syntax

Description

Normally, if a command in a target rule in a makefile returns an error or when the target construction is interrupted, the make utility removes that target file. With this option you tell the make utility to make all target files precious. This means that all dependency files are never removed.

Example

The make utility never removes target dependency files.

Related information

Special target .PRECIOUS in section 8.3.2, Wrtiting a Makefile in Chapter Using the Utilities of the Reference Guide.

-q

Command line syntax

Description

With this option the make utility does not perform any tasks but only returns an error code. A zero status indicates that all target files are up to date, a non-zero status indicates that some or all target files are out of date.

Example

The make utility only returns an error code that indicates whether all target files are up to date or not. It does not rebuild any files.

Related information

-

-r

Command line syntax

Description

When you call the make utility, it first reads the implicit rules from the file mktc.mk, then it reads the makefile with the rules to build your files. (The file mktc.mk is located in the \etc directory of the TriCore toolchain.)

With this option you tell the make utility not to read mktc.mk and to rely fully on the make rules in the makefile.

Example

The make utility does not read the implicit make rules in mktc.mk.

Related information

-

-S

Command line syntax

Description

With this option you cancel the effect of the option -k. This is never necessary except in a recursive make where the option - k might be inherited from the top-level make via MAKEFLAGS or if you set the option -k in the environment variable MAKEFLAGS.

Example

The effect of the option -k is cancelled so the make utility stops with the make process after it encounters an error.

The option -k in this example may have been set with the environment variable MAKEFLAGS or in a recursive call to mktc in the makefile.

Related information

Make utility option -k (On error, abandon the work for the current target only

-s

Command line syntax

Description

With this option you tell the make utility to perform its tasks without printing the commands it executes. Error messages are normally printed.

Example

The make utility rebuilds your files but does not print the commands it executes during the make process.

Related information

Make utility option -n (Perform a dry run)

-t

Command line syntax

Description

With this option you tell the make utility to touch the target files, bringing them up to date, rather than performing the rules to rebuild them.

Example

The make utility updates out-of-date files by giving them a new date and time stamp. The files are not actually rebuild.

Related information

-

-time

Command line syntax

Description

With this option you tell the make utility to display the current date and time on standard output.

Example

The make utility displays the current date and time and updates out-of-date files.

Related information

-

-V

Command line syntax

Description

Display version information. The make utility ignores all other options or input files.

Example

The make utility does not perform any tasks but displays the following version information:

Related information

-

-W

Command line syntax

Description

With this option the make utility considers the specified target file always as up to date and will not rebuild it.

Example

The make utility rebuilds out of date targets in the makefile except the file test.elf which is considered now as up to date.

Related information

-

-w

Command line syntax

Description

With this option the make utility sends error messages and verbose messages to standard out. Without this option, the make utility sends these messages to standard error.

This option is only useful on UNIX systems.

Example

The make utility sends messages to standard out instead of standard error.

Related information

-

-x

Command line syntax

Description

With this option the make utility shows extended error messages. Extended error messages give more detailed information about the exit status of the make utility after errors. EDE uses this option for the graphical version of make.

Example

If errors occur, the make utility gives extended information.

Related information

-


Copyright © 2003 Altium BV