---
url: /examples/configuration/custom_rule.md
---

# Custom Rule

We can use `rule()` to define custom build rules to handle specific file types or build logic.

For a custom rules tutorial, see [Custom Rules Guide](/guide/project-configuration/custom-rule). For the complete API, see [Custom Rule API](/api/description/custom-rule). For built-in rules, see [Built-in Rules](/api/description/builtin-rules).

## Basic Example

### Build and Run

```bash
$ xmake
```
