Extension makefiles can be used where certain build steps are required
which are not catered for by the generated makefiles. A
bldmake
extension makefile has the form:
<makefile>
::=<target>
: <target_command_1>
<target_command_2>
...<target_command_n>
<target>
::=makmake
" | "freeze
" | "library
" | "clean
" | "final
" | "resource
" | "bld
" | "savespace
" | "releasables
"A target in the extension makefile is an
nmake.exe
target, and should be followed by a colon to denote it
as such.
During build activities, abld
will call the target in the
extension makefile corresponding to the build activity that is being carried
out, and thus the commands listed with the target in the extension makefile
will be executed. Note that the makmake
target corresponds to the abld
makefile
command, bld
to target
, savespace
to target -savespace
, and releasables
to target [-what | -check]
.
All targets should be provided in an extension makefile. This should be done even if no commands are listed with a particular target, for the following two reasons:
The target will be called, during the build, whether commands are listed or not
nmake.exe
will generate an error if the target cannot be
found.
An example of a simple extension makefile is given below:
MAKMAKE :
echo this is an example
FINAL FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE :
This prints this is an example
to the console at the makefile construction stage of an abld
, and does nothing for the other targets.
Note that:
You can put multiple targets on the same line, as above.
You must have a space or a tab at the start of lines containing target commands.
Commands listed with each target can be calls to any tools or system commands that are available at build-time.
If different commands are required for the same target for different
platforms, special nmake.exe
syntax can be used in conjunction
with the $(PLATFORM)
and $(CFG)
macros that
abld
defines to carry out the different commands.
$(CFG)
is defined as UDEB or UREL. $(PLATFORM)
is WINS, ARMI, etc.
For example, the following prints ARMI MAKEMAKE COMMAND
at the makefile stage for the ARMI target, or NOT ARMI BUILD
for any other platform:
!IF "$(PLATFORM)" == "ARMI"
MAKMAKE:
echo ARMI MAKEMAKE COMMAND
!ELSE
MAKMAKE:
echo NOT ARMI BUILD
!ENDIF
FINAL FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE :