Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 1 | .. todo:: |
| 2 | |
| 3 | Joakim: Move this under porting guidelines instead? |
| 4 | |
| 5 | .. _license_headers: |
| 6 | |
| 7 | ############### |
| 8 | License headers |
| 9 | ############### |
| 10 | This document defines the format of the copyright and license headers in OP-TEE |
| 11 | source files. Such headers shall comply with the rules described here, which are |
| 12 | compatible with the rules adopted by the Linux kernel community. |
| 13 | |
| 14 | New source files |
| 15 | **************** |
| 16 | |
| 17 | - **Rule 1.1** Shall contain exactly one SPDX license identifier, which can |
| 18 | express a single or multiple licenses (refer to SPDX_ for syntax details). |
| 19 | |
| 20 | - **Rule 1.2** The SPDX license identifier shall be added as a comment line. |
| 21 | It shall be the first possible line in the file which can contain a |
| 22 | comment. The comment style shall depend on the file type: |
| 23 | |
| 24 | - **Rule 1.2.1** C source: ``// SPDX-License-Identifier: <expression>`` |
| 25 | - **Rule 1.2.2** C header: ``/* SPDX-License-Identifier: <expression> */`` |
| 26 | - **Rule 1.2.3** Assembly: ``/* SPDX-License-Identifier: <expression> */`` |
| 27 | - **Rule 1.2.4** Python, shell: ``# SPDX-License-Identifier: <expression>`` |
| 28 | |
| 29 | - **Rule 1.3** Shall contain at least one copyright line |
| 30 | |
| 31 | - **Rule 1.4** Shall not contain the mention 'All rights reserved' |
| 32 | |
| 33 | - **Rule 1.5** Shall not contain any license notice other than the SPDX license |
| 34 | identifier |
| 35 | |
| 36 | Note that files imported from external projects are not new files. The rules for |
| 37 | pre-existing files (below) apply. |
| 38 | |
| 39 | Pre-existing or imported files |
| 40 | ****************************** |
| 41 | |
| 42 | - **Rule 2.1** SPDX license identifiers shall be added according to the |
| 43 | license notice(s) in the file and the rules above (1.1 and 1.2*) |
| 44 | |
| 45 | - **Rule 2.2** It is recommended that license notices be removed once the |
| 46 | corresponding identifier has been added. Note however that this may only |
| 47 | be done by the copyright holder(s) of the file. |
| 48 | |
| 49 | - **Rule 2.3** Similar to 2.2, and subject to the same conditions, the text: |
| 50 | "All rights reserved" shall be removed also. |
| 51 | |
| 52 | .. _SPDX: https://spdx.org/licenses/ |