beautypg.com

Customizing managed builds, Creating custom make targets, Running commands before and after builds – HP Integrity NonStop J-Series User Manual

Page 62

background image

Customizing managed builds

Although managed builds generate makefiles, you can still customize managed builds. NSDEE
provides two separate mechanisms for customizing managed builds. The first mechanism involves
writing your own version of top-level makefile targets. The second mechanism involves using project
properties to add commands to be invoked before and after Build Project and Deploy Project
actions.

Creating custom make targets

Managed builds support customization with the following three include statements written to every
top-level auto-generated makefile, one per build configuration:

-include ../makefile.init

-include ../makefile.defs

-include ../makefile.targets

The above include statements pull in text from the files makefile.init, makefile.defs, and
makefile.targets

. NSDEE does not create any of the three files, but you can create any or

all of them. No errors are generated if any of the three files are not present when the makefile is
used.

The makefile.init file is included at the top of the top-level makefile. Use it to add your own
makefile initialization.

The makefile.defs file is included in the top-level makefile just before build targets. Use it to
define your own makefile macros or to alter predefined macros such as those declared in the
auto-generated make include files, objects.mk and source.mk. For example, you can add
objects built by another project by specifying the path to the objects using the USER_OBJS macro
defined in objects.mk (as makefile.defs is included "after" objects.mk in the top-level
makefile). USER_OBJS is included on the command-line of the final build target for a project. For
details, see

“Adding externally-built objects and linkfiles to managed builds” (page 111)

.

The makefile.targets file is included at the bottom of the top-level makefile. Use it to add
your own build targets, which you can then build with the Make Target view by also adding your
own build targets in that view.

You can also use makefile.targets to override predefined build targets. For details, see

“Creating a makefile.targets file for managed builds” (page 114)

.

Running commands before and after builds

Set up commands to run before and after builds, and before and after deploying the final build
object.

Figure 15 (page 63)

shows an example of using project properties to set simple commands

to issue before and after a build.

62

Concepts

This manual is related to the following products: