asn1: Restore styling of generated sources

This commit is contained in:
Nicolas Williams
2022-01-11 17:10:37 -06:00
parent ff4033eb59
commit 04523254c1
3 changed files with 63 additions and 21 deletions

View File

@@ -139,22 +139,7 @@ check-local::
test "$$failed" -eq 0 || exit 1; \
fi
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:
@if [ ! -x "$(CLANG_FORMAT)" ]; then \
cmp -s $< $@ 2> /dev/null || cp $< $@; \
else \
cp $< $@.tmp.c; \
$(CLANG_FORMAT) -style='{BasedOnStyle: Mozilla, AlwaysBreakAfterReturnType: TopLevelDefinitions, IndentWidth: 4, SortIncludes: false}' -i $@.tmp.c; \
cmp -s $@.tmp.c $@ 2> /dev/null || mv $@.tmp.c $@; \
fi
.hx.h:
@cmp -s $< $@ 2> /dev/null || cp $< $@;
SUFFIXES += .x .z
SUFFIXES += .1 .3 .5 .7 .8 .cat1 .cat3 .cat5 .cat7 .cat8