clang-format generated code for easier debugging
This commit is contained in:
@@ -143,11 +143,20 @@ check-local::
|
||||
|
||||
SUFFIXES += .x .z .hx
|
||||
|
||||
# It's useful for debugging to format generated sources. The default for all
|
||||
# clang-format styles is to sort includes, but in many cases in-tree we really
|
||||
# don't want to do that.
|
||||
.x.c:
|
||||
@cmp -s $< $@ 2> /dev/null || cp $< $@
|
||||
@if [ -z "$(CLANG_FORMAT)" ]; then \
|
||||
cmp -s $< $@ 2> /dev/null || cp $< $@; \
|
||||
else \
|
||||
cp $< $@.tmp.c; \
|
||||
$(CLANG_FORMAT) -style='{BasedOnStyle: Chromium, SortIncludes: false}' -i $@.tmp.c; \
|
||||
cmp -s $@.tmp.c $@ 2> /dev/null || mv $@.tmp.c $@; \
|
||||
fi
|
||||
|
||||
.hx.h:
|
||||
@cmp -s $< $@ 2> /dev/null || cp $< $@
|
||||
@cmp -s $< $@ 2> /dev/null || cp $< $@;
|
||||
|
||||
SUFFIXES += .1 .3 .5 .7 .8 .cat1 .cat3 .cat5 .cat7 .cat8
|
||||
|
||||
|
Reference in New Issue
Block a user