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:
mktc [option...] [target...] [macro=def]
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.
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.
Consider the following makefile with conditional rules to build a demo program and a real program:
ifdef DEMO # the value of DEMO is of no importance real.out : demo.o ltc demo.o main.o -lc -lfp -lrt else real.out : real.o ltc real.o main.o -lc -lfp -lrt endif
real.elf : real.out ltc -FELF -oreal.elf real.out
You can now use a macro definition to set the DEMO flag:
mktc real.elf DEMO=1
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.
Make utility option -e (Environment variables override macro definitions)
Make utility option -m (Name of invocation file)
Displays an overview of all command line options.
The following invocation displays a list of the available command line options:
mktc -?
-
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.
mktc -a
Rebuilds all your files, regardless of whether they are out of date or not.
-
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.
The following command runs the make utility as a child process:
mktc -c
Make utility option -err (Redirect error messages to file)
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).
mktc -D
Each line of the makefile that is read by the make utility is printed to standard output (usually your screen).
-
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.
mktc -d
Shows which files are out of date and rebuilds them.
-
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.
mktc -e
The make utility uses the settings of the environment variables regardless of macro definitions.
-
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.
mktc -err error.txt
The make utility writes messages to the file error.txt.
Make utility option -s (Do not print commands before execution)
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.
mktc mymake
The make utility uses the file mymake to build your files.
-
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.
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:
mktc -G myfiles
-
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.
mktc -i
The make utility exits without an error code, even when an error occurs.
-
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.
mktc -K
The make utility preserves all temporary files.
Section 1.3.2, Configuring the Command Line Environment, in Chapter Software Installation of the User's Guide.
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.
mktc -k
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.
Make utility option -S (Undo the effect of -k)
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.
"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"
Suppose the file myoptions contains the following lines:
-k -err errors.txt test.elf
Specify the option file to the make utility:
mktc -m myoptions
This is equivalent to the following command line:
mktc -k -err errors.txt test.elf
-
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.
mktc -n
The make utility does not perform any tasks but displays what it would do if called without the option -n.
Make utility option -s (Do not print commands before execution)
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.
mktc -p
The make utility never removes target dependency files.
Special target .PRECIOUS in section
8.3.2,
Wrtiting a Makefile in Chapter Using the Utilities of the Reference Guide.
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.
mktc -q
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.
-
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.
mktc -r
The make utility does not read the implicit make rules in mktc.mk.
-
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.
mktc -S
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.
Make utility option -k (On error, abandon the work for the current target only
With this option you tell the make utility to perform its tasks without printing the commands it executes. Error messages are normally printed.
mktc -s
The make utility rebuilds your files but does not print the commands it executes during the make process.
Make utility option -n (Perform a dry run)
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.
mktc -t
The make utility updates out-of-date files by giving them a new date and time stamp. The files are not actually rebuild.
-
With this option you tell the make utility to display the current date and time on standard output.
mktc -time
The make utility displays the current date and time and updates out-of-date files.
-
Display version information. The make utility ignores all other options or input files.
mktc -v
The make utility does not perform any tasks but displays the following version information:
TASKING TriCore VX-toolset program builder vxx.yrz Build nnn Copyright year Altium BV Serial# 00000000
-
With this option the make utility considers the specified target file always as up to date and will not rebuild it.
mktc -W test.elf
The make utility rebuilds out of date targets in the makefile except the file test.elf which is considered now as up to date.
-
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.
mktc -w
The make utility sends messages to standard out instead of standard error.
-
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.
mktc -x
If errors occur, the make utility gives extended information.
-