# Makefile for the open-source release of adventure 2.5
-# SPDX-FileCopyrightText: Eric S. Raymond <esr@thyrsus.com>
+# SPDX-FileCopyrightText: (C) Eric S. Raymond <esr@thyrsus.com>
# SPDX-License-Identifier: BSD-2-Clause
# To build with save/resume disabled, pass CFLAGS="-DADVENT_NOSAVE"
cheat: $(CHEAT_OBJS) dungeon.o
$(CC) $(CCFLAGS) $(DBX) -o cheat $(CHEAT_OBJS) dungeon.o $(LDFLAGS) $(LIBS)
-check: advent cheat
+CSUPPRESSIONS = --suppress=missingIncludeSystem --suppress=invalidscanf
+cppcheck:
+ @-cppcheck -I. --quiet --template gcc -UPROP_SET_SEEN --enable=all $(CSUPPRESSIONS) *.[ch]
+
+pylint:
+ @-pylint --score=n *.py */*.py
+
+check: advent cheat pylint cppcheck
cd tests; $(MAKE) --quiet
+reflow:
+ @clang-format --style="{IndentWidth: 8, UseTab: ForIndentation}" -i $$(find . -name "*.[ch]")
+ @black --quiet *.py
+
# Requires gcov, lcov, libasan6, and libubsan1
# The last two are Ubuntu names, might vary on other distributions.
# After this, run your browser on coverage/open-adventure/index.html
debug: CCFLAGS += -fsanitize=undefined
debug: linty
-CSUPPRESSIONS = --suppress=missingIncludeSystem --suppress=invalidscanf
-cppcheck:
- cppcheck -I. --template gcc --enable=all $(CSUPPRESSIONS) *.[ch]
-
-pylint:
- @pylint --score=n *.py */*.py