Blame view
scripts/mkmakefile
896 Bytes
1da177e4c
|
1 2 3 4 5 6 7 8 9 10 |
#!/bin/sh # Generates a small Makefile used in the root of the output # directory, to allow make to be started from there. # The Makefile also allow for more convinient build of external modules # Usage # $1 - Kernel src directory # $2 - Output directory # $3 - version # $4 - patchlevel |
fd5f0cd6b
|
11 |
test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
18c32dac7
|
12 13 |
# Only overwrite automatically generated Makefiles # (so we do not overwrite kernel Makefile) |
971edcfc8
|
14 |
if test -e $2/Makefile && ! grep -q Automatically $2/Makefile |
18c32dac7
|
15 16 17 |
then exit 0 fi |
fd5f0cd6b
|
18 19 20 |
echo " GEN $2/Makefile" cat << EOF > $2/Makefile |
1da177e4c
|
21 22 23 24 25 26 27 28 29 |
# Automatically generated by $0: don't edit VERSION = $3 PATCHLEVEL = $4 KERNELSRC := $1 KERNELOUTPUT := $2 MAKEFLAGS += --no-print-directory |
96678281b
|
30 |
.PHONY: all \$(MAKECMDGOALS) |
0b35786d7
|
31 |
all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) |
1da177e4c
|
32 |
all: |
0b35786d7
|
33 |
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$(all) |
1da177e4c
|
34 |
|
96678281b
|
35 |
Makefile:; |
1da177e4c
|
36 |
|
0b35786d7
|
37 38 |
\$(all) %/: all @: |
1da177e4c
|
39 |
EOF |