xref: /aosp_15_r20/external/coreboot/util/lint/lint-stable-030-makefile-inc (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1#!/usr/bin/env sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3#
4# DESCR: Verify that Makefiles are not named Makefile.inc
5#
6
7LINTDIR="$(
8  cd -- "$(dirname "$0")" > /dev/null 2>&1 || return
9  pwd -P
10)"
11
12# shellcheck source=helper_functions.sh
13. "${LINTDIR}/helper_functions.sh"
14
15# Exit if the code isn't in a git repo
16if [ "${IN_GIT_TREE}" -eq 0 ]; then
17  exit 0
18fi
19
20MAKELIST="$(${FIND_FILES} | grep Makefile.inc)"
21if [ -n "${MAKELIST}" ]; then
22  echo "Error: Makefiles should be Makefile.mk not Makefile.inc"
23  echo "${MAKELIST}"
24fi
25