In addition to global variables, Code::Blocks supports usage of variables whose definition is stored within a project. To create a project variable, open Project->Build options...->Custom variables (tab). From the tree selection on the left-hand side, Code::Blocks offers the option of having the variable defined for the entire project, or per build target.
The center box contains a list of all currently defined project variables (this is often empty). Any variable defined here is accessible through $(variable). It is often useful to use project variables to manage filename pre/post-fixes, as it enables all occurrences to be changed simultaneously.
Note: all global variable constraints apply to per-project variables as well.