Commit 8aea0b4e authored by Jeremy White's avatar Jeremy White Committed by Frediano Ziglio

Add make style targets.

These use a refined version of the doc/spice_indent tool to make sure
that all controlled sources follow the spice style guide.
Acked-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
parent c5cfc19f
......@@ -13,22 +13,21 @@
# func()
# That requires calling indent with some thoughtfulness
# By default, it will break procedure types onto newlines
# if you have a file that does not do that, you may want
# to add
# --dont-break-procedure-type
# to your invocation.
# which is not always the desired behavior
# Add --dont-break-procedure-type to change that
if [ ! -f "$1" ] ; then
echo Error: specify a filename to process with indent
if [ $# -lt 1 ] ; then
echo Error: specify at least one file to process with indent
echo Usage:
echo 'spice_indent <filename> [ extra-options ]'
echo ' spice_indent [ extra-options ] <filename> [ filename... ]'
echo 'A useful option is --dont-break-procedure-type'
exit 1
fi
fname="$1"
shift
indent "$fname" \
# Run the indent command with no version control; we're using git after all...
VERSION_CONTROL=none \
indent \
--no-space-after-function-call-names \
--braces-after-func-def-line \
--braces-on-if-line \
......
......@@ -39,3 +39,6 @@ spicedummy_drv_la_SOURCES = \
display.c \
dummy.h \
present.c
style: $(spicedummy_drv_la_SOURCES)
$(top_srcdir)/../doc/spice_indent $^
......@@ -48,3 +48,6 @@ EXTRA_DIST = \
if HAVE_GTEST
SUBDIRS = tests
endif
style: $(x11spice_SOURCES)
$(top_srcdir)/doc/spice_indent --dont-break-procedure-type $^
......@@ -39,3 +39,6 @@ callgrind.out.x:
clean-local:
rm -f callgrind.out.*
style: $(x11spice_test_SOURCES)
$(top_srcdir)/doc/spice_indent --dont-break-procedure-type $^
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment