]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | #!/bin/sh |
b2441318 | 2 | # SPDX-License-Identifier: GPL-2.0 |
1da177e4 LT |
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 | |
1da177e4 | 9 | |
d2301249 | 10 | if [ "${quiet}" != "silent_" ]; then |
4fd61277 | 11 | echo " GEN Makefile" |
d2301249 | 12 | fi |
fd5f0cd6 | 13 | |
4fd61277 | 14 | cat << EOF > Makefile |
1da177e4 LT |
15 | # Automatically generated by $0: don't edit |
16 | ||
0ff35771 PF |
17 | ifeq ("\$(origin V)", "command line") |
18 | VERBOSE := \$(V) | |
19 | endif | |
20 | ifneq (\$(VERBOSE),1) | |
21 | Q := @ | |
22 | endif | |
23 | ||
1da177e4 LT |
24 | MAKEFLAGS += --no-print-directory |
25 | ||
9319f453 | 26 | .PHONY: __sub-make \$(MAKECMDGOALS) |
96678281 | 27 | |
9319f453 | 28 | __sub-make: |
80d0dda3 | 29 | \$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS) |
0b35786d | 30 | |
9319f453 | 31 | \$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make |
3c955b40 | 32 | @: |
1da177e4 | 33 | EOF |