![]() |
OpenMake Meister |
Phony Targets are Targets that do not represent a "runnable" binary object such as an executable or library. Phony Targets instead are placeholders for performing specific actions such as copying files from one directory to the next.
To create Phony Targets, first a Build Service for the Phony Target needs to be defined. The Build Service must have specific Build Rules and Build Methods associated to the Build Service that performs the logic needed to create the Phony Target.
Typically the Phony Target Build Service has a rule that defines the Final Target as .noext (no extension). The dependency file extensions to the Build Rule should list all of the extensions that the Build Method will expect when performing the action.
In order for the build to understand a Phony Target, a Final Target must be assigned to the Build Service, through a Build Rule. This Final Target is most typically a 0 byte file that is created in the build directory as a result of the build. The Final Target is Phony simply because it is not the end result desired from the execution of the Build Method, but instead a placeholder that indicates the actions of the Phony Target were completed successfully. Because of the need to have a Final Target result, when developing a customized Build Method for Phony Targets, the creation of a Final Target is required.
In some cases, the Phony Target does not need to be created every time a build is completed. For example, if you are using a Phony Target to copy files to a shared execution area, you may only want this Phony Target step executed in certain cases. To prevent Phony Targets from being created with every full build, select the checkbox "exclude from full build" found on the Target Overview Screen. This will prevent the Phony Target from being created when the full build is executed. To build the Phony Target, you must go to the Setup Build screen and "check" the Phony Target independently.