mkmakefile 563 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. # Generates a small Makefile used in the root of the output
  3. # directory, to allow make to be started from there.
  4. # The Makefile also allow for more convinient build of external modules
  5. # Usage
  6. # $1 - Kernel src directory
  7. # $2 - Output directory
  8. # $3 - version
  9. # $4 - patchlevel
  10. cat << EOF
  11. # Automatically generated by $0: don't edit
  12. VERSION = $3
  13. PATCHLEVEL = $4
  14. KERNELSRC := $1
  15. KERNELOUTPUT := $2
  16. MAKEFLAGS += --no-print-directory
  17. all:
  18. \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
  19. %::
  20. \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
  21. EOF