https://github.com/torvalds/linux
Raw File
Tip revision: 2be4d50295e2b6f62c07b614e1b103e280dddb84 authored by Linus Torvalds on 27 April 2006, 02:19:25 UTC
Linux v2.6.17-rc3
Tip revision: 2be4d50
mkmakefile
#!/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


cat << EOF
# Automatically generated by $0: don't edit

VERSION = $3
PATCHLEVEL = $4

KERNELSRC    := $1
KERNELOUTPUT := $2

MAKEFLAGS += --no-print-directory

.PHONY: all \$(MAKECMDGOALS)

all:
	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)

Makefile:;

\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
EOF
back to top