]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-analog-linux-kernel/dmurphy-analog.git/blob - scripts/mkmakefile
defconfig: Enable M_CAN for dra7
[ti-analog-linux-kernel/dmurphy-analog.git] / scripts / mkmakefile
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
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
7 # Usage
8 # $1 - Kernel src directory
10 # Only overwrite automatically generated Makefiles
11 # (so we do not overwrite kernel Makefile)
12 if test -e Makefile && ! grep -q Automatically Makefile
13 then
14         exit 0
15 fi
16 if [ "${quiet}" != "silent_" ]; then
17         echo "  GEN     Makefile"
18 fi
20 cat << EOF > Makefile
21 # Automatically generated by $0: don't edit
23 ifeq ("\$(origin V)", "command line")
24 VERBOSE := \$(V)
25 endif
26 ifneq (\$(VERBOSE),1)
27 Q := @
28 endif
30 MAKEFLAGS += --no-print-directory
32 .PHONY: __sub-make \$(MAKECMDGOALS)
34 __sub-make:
35         \$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS)
37 \$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
38         @:
39 EOF