mirror of
https://github.com/gbdev/rgbds.git
synced 2025-12-01 15:27:48 +00:00
Add checkpatch.pl config file and Makefile targets
This is used to verify the coding style of patches. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
20
Makefile
20
Makefile
@@ -7,6 +7,7 @@ mandir := ${PREFIX}/man
|
||||
STRIP := -s
|
||||
BINMODE := 555
|
||||
MANMODE := 444
|
||||
CHECKPATCH := ../linux/scripts/checkpatch.pl
|
||||
|
||||
# Other variables
|
||||
|
||||
@@ -144,6 +145,25 @@ install: all
|
||||
$Qinstall -m ${MANMODE} src/link/rgblink.5 ${DESTDIR}${mandir}/man5/rgblink.5
|
||||
$Qinstall -m ${MANMODE} src/gfx/rgbgfx.1 ${DESTDIR}${mandir}/man1/rgbgfx.1
|
||||
|
||||
# Target used to check the coding style of the whole codebase. '.y' and '.l'
|
||||
# files aren't checked, unfortunately...
|
||||
checkcodebase:
|
||||
$Qfor file in `git ls-files | grep -E '\.c|\.h'`; do \
|
||||
${CHECKPATCH} -f "$$file"; \
|
||||
done
|
||||
|
||||
# Target used to check the coding style of the patches from the upstream branch
|
||||
# to the HEAD. Runs checkpatch once for each commit between the current HEAD and
|
||||
# the first common commit between the HEAD and origin/develop. '.y' and '.l'
|
||||
# files aren't checked, unfortunately...
|
||||
checkpatch:
|
||||
$Qeval COMMON_COMMIT=$$(git merge-base HEAD origin/develop); \
|
||||
for commit in `git rev-list $$COMMON_COMMIT..HEAD`; do \
|
||||
echo "[*] Analyzing commit "$$commit"" && \
|
||||
git format-patch --stdout "$$commit~..$$commit" \
|
||||
| ${CHECKPATCH} - || true;\
|
||||
done
|
||||
|
||||
# Target for the project maintainer to easily create web manuals.
|
||||
# It relies on mandoc: http://mdocml.bsd.lv
|
||||
|
||||
|
||||
Reference in New Issue
Block a user