update for final rounds, clang-format related values

The use of `cindent(1)` and `indent(1)` by the IOCCC Judges
during final round processing has been deprecated in favor
of the `clang-format(1)` tool.

Removed rules in `1337.mk` related to `cindent(1)` and `indent(1)`.

Added `make clang-format` rule to `1337.mk`.

Added `${CLANG_FORMAT}` Makefile variable to `var.mk`.

Created `.clang-format` to hold the IOCCC style, a style that
is somewhat similar to the Linux Kernel style.
This commit is contained in:
Landon Curt Noll committed 2025-06-19 19:29:59 -07:00
1 parent f0f464dee2
commit 76357fc5db
3 files changed
+97 -33

No files matched your search

+16 -33
View File
@@ -3,44 +3,27 @@
# extended utility rules
########################
.PHONY: indent_clean indent_clobber install
# you may be able to misunderstand the source by reading indent.c
#
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no indent tool found, ident $< yourself, sorry"; \
echo "exit 17"; \
exit 17; \
fi
indent_clean: clean
@-if [ -f indent.c ]; then \
echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
indent_clobber: indent_clean clobber
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
echo 'ate sandwich'; \
fi
install:
@echo "Dr. Spock says that is not logical!"
@${TRUE}
######################
# clang-format options
######################
.PHONY: clang-format
# NOTE: The IOCCC Judges set CLANG_FORMAT_STYLE according to the ".clang-format" file.
#
# https://github.com/ioccc-src/winner/blob/master/.clang-format
#
# NOTE: Please don't add "// clang-format off" to your code: that is both annoying, and is easily disabled.
#
clang-format: ${PROG}.c
${CLANG_FORMAT} -style=file ${PROG}.c
#####################
# make a difference #
#####################