path: root/docs
diff options
authorIan Spray <ian.spray@arm.com>2014-01-30 17:25:28 +0000
committerDan Handley <dan.handley@arm.com>2014-01-30 17:55:31 +0000
commit36eaaf37690c1019c99335e708361b5a613101db (patch)
tree39f8b4b782d50946ea257774af5f761039f54f9b /docs
parent35fab8c979a2955bf031459ac630ad16012bcaa1 (diff)
Allow style checking of tree and local changes
New phony Makefile targets have been added: * checkcodebase * checkpatch The checkcodebase target will run a Linux style compliance check over the entire codebase, and honours the V=1 Makefile verbose setting and so will show more information when this is enabled. If the local directory is a git checkout then the output of git ls-files is used to decide which files to test for compliance. If the local directory is not under git control then a 'best attempt' is made, but in this case it should be noted that it is possible for additional non-codebase files to be tested, so care should be taken when parsing the output. The checkpatch target will compare local changes against the git origin/master to allow issues with the last set of changes to be identified. To override the change comparision location, set the BASE_COMMIT variable to your desired git branch. Both targets rely on the Linux source tree script checkpatch.pl to do the syntax checking, and expects that the CHECKPATCH environment variable points to the location of this file. Notes on the usage of these targets have been added to the contributing.md and docs/user-guide.md text files. Change-Id: I6d73c97af578e24a34226d972afadab9d30f1d8d
Diffstat (limited to 'docs')
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/user-guide.md b/docs/user-guide.md
index 0358e07..a0dbae7 100644
--- a/docs/user-guide.md
+++ b/docs/user-guide.md
@@ -141,6 +141,29 @@ Extra debug options can be passed to the build system by setting `CFLAGS`:
NOTE: The Foundation FVP does not provide a debugger interface.
+#### Checking source code style
+When making changes to the source for submission to the project, the source
+must be in compliance with the Linux style guide, and to assist with this check
+the project Makefile contains two targets, which both utilise the checkpatch.pl
+script that ships with the Linux source tree.
+To check the entire source tree, you must first download a copy of checkpatch.pl
+(or the full Linux source), set the CHECKPATCH environment variable to point to
+the script and build the target checkcodebase:
+ make CHECKPATCH=../linux/scripts/checkpatch.pl checkcodebase
+To just check the style on the files that differ between your local branch and
+the remote master, use:
+ make CHECKPATCH=../linux/scripts/checkpatch.pl checkpatch
+If you wish to check your patch against something other than the remote master,
+set the BASE_COMMIT variable to your desired branch. By default, BASE_COMMIT
+is set to 'origin/master'.
### Obtaining the normal world software
#### Obtaining UEFI