Skip to content

Commit

Permalink
Add checkpatch targets to Makefile
Browse files Browse the repository at this point in the history
+ added target for calling checkpatch on working and staging area
+ added documentation for targets in Readme

Signed-off-by: Markus S. Wamser <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
  • Loading branch information
Markus S. Wamser authored and jforissier committed Dec 17, 2018
1 parent 0da41e9 commit fcf09d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,12 @@ cscope:
${q}rm -f cscope.*
${q}find $(PWD) -name "*.[chSs]" | grep -v "$(PWD)/out" > cscope.files
${q}cscope -b -q -k

.PHONY: checkpatch checkpatch-staging checkpatch-working
checkpatch: checkpatch-staging checkpatch-working

checkpatch-working:
${q}./scripts/checkpatch.sh

checkpatch-staging:
${q}./scripts/checkpatch.sh --cached
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ Regarding the checkpatch tool, it is not included directly into this project.
Please use checkpatch.pl from the Linux kernel git in combination with the
local [checkpatch script].

There are also targets for common use cases in the [Makefile](Makefile):

```
make checkpatch #check staging and working area
make checkpatch-staging #check staging area (added, but not committed files)
make checkpatch-working #check working area (modified, but not added files)
```

[build]: https://github.com/OP-TEE/build
[checkpatch script]: scripts/checkpatch.sh
[checkpatch]: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl
Expand Down

0 comments on commit fcf09d2

Please sign in to comment.