]> git.ipfire.org Git - thirdparty/u-boot.git/blame - scripts/mkmakefile
Merge tag 'xilinx-for-v2024.04-rc1-v2' of https://source.denx.de/u-boot/custodians...
[thirdparty/u-boot.git] / scripts / mkmakefile
CommitLineData
22433fc5 1#!/bin/sh
473fc279 2# SPDX-License-Identifier: GPL-2.0
22433fc5
MY
3# Generates a small Makefile used in the root of the output
4# directory, to allow make to be started from there.
5# The Makefile also allow for more convinient build of external modules
6
7# Usage
8# $1 - Kernel src directory
22433fc5 9
22433fc5
MY
10# Only overwrite automatically generated Makefiles
11# (so we do not overwrite kernel Makefile)
473fc279 12if test -e Makefile && ! grep -q Automatically Makefile
22433fc5
MY
13then
14 exit 0
15fi
16if [ "${quiet}" != "silent_" ]; then
473fc279 17 echo " GEN Makefile"
22433fc5
MY
18fi
19
473fc279 20cat << EOF > Makefile
22433fc5
MY
21# Automatically generated by $0: don't edit
22
22433fc5
MY
23ifeq ("\$(origin V)", "command line")
24VERBOSE := \$(V)
25endif
26ifneq (\$(VERBOSE),1)
27Q := @
28endif
29
22433fc5
MY
30MAKEFLAGS += --no-print-directory
31
e7734404 32.PHONY: __sub-make \$(MAKECMDGOALS)
22433fc5 33
e7734404 34__sub-make:
473fc279 35 \$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS)
22433fc5 36
e7734404 37\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
22433fc5
MY
38 @:
39EOF