Specifying a Make Target | Removing a Target |
Define New or Edit Target Dialog Boxes | Building a Project |
When building in the Sun WorkShopTM programming environment, two types of targets are involved: a Sun WorkShop target and a user makefile target.
A Sun WorkShop target is an object derived from the build directory, the makefile, and the make target. When a Sun WorkShop target is built, it is added to the list of Sun WorkShop targets in the Build Menu picklist and in the Build Edit Target command. To build a particular WorkShop build target, select it from the menu picklist. When you begin a build, Sun WorkShop looks for the first target in the Sun WorkShop target list and builds it.
A project (see Working With Projects) can contain multiple targets. For an executable, static library/archive, shared library, or Fortran application, your executable/library is one target, and a special Clean target is another (found in the Build menu picklist). The Clean target deletes all of your project's generated files (for example, the .o files), the source browsing database, the C++ templates database, the executable itself, and other build-related files.
For a complex project, you can have more targets that are listed in the Build menu picklist. For example, your project can generate five libraries and an executable to link them together. Each library or executable is then a Sun WorkShop target, and you can build each individual one by selecting it from the Build menu picklist.
See Creating a New Project or Editing a Project for more information.
A user makefile target is an object that make knows how to build from the directions (rules) contained in a particular makefile. Makefiles are generally designed so that the default target (the one you get when you do not specify a target) is the most commonly built target.
A makefile contains entries that describe how to bring a make target up to date with respect to those files on which it depends (called dependencies). Since each dependency is a make target, each dependency might have dependencies of its own. Targets and file dependencies and subdependencies form a tree structure that make traces when deciding whether or not to rebuild a make target.
For a user makefile project, each target listed in the Build menu picklist is a makefile or a makefile target to be built (to create a user makefile project, see Creating a New Project).