mkconfig 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh -e
  2. # Script to create header files and links to configure
  3. # U-Boot for a specific board.
  4. #
  5. # Parameters: Target Architecture CPU Board [VENDOR] [SOC]
  6. #
  7. # (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
  8. #
  9. APPEND=no # Default: Create new config file
  10. while [ $# -gt 0 ] ; do
  11. case "$1" in
  12. --) shift ; break ;;
  13. -a) shift ; APPEND=yes ;;
  14. *) break ;;
  15. esac
  16. done
  17. [ $# -lt 4 ] && exit 1
  18. [ $# -gt 6 ] && exit 1
  19. echo "Configuring for $1 board..."
  20. cd ./include
  21. #
  22. # Create link to architecture specific headers
  23. #
  24. rm -f asm
  25. ln -s asm-$2 asm
  26. rm -f asm-$2/arch
  27. ln -s arch-$3 asm-$2/arch
  28. if [ "$2" = "arm" ] ; then
  29. rm -f asm-$2/proc
  30. ln -s proc-armv asm-$2/proc
  31. fi
  32. #
  33. # Create include file for Make
  34. #
  35. echo "ARCH = $2" > config.mk
  36. echo "CPU = $3" >> config.mk
  37. echo "BOARD = $4" >> config.mk
  38. [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
  39. [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
  40. #
  41. # Create board specific header file
  42. #
  43. if [ "$APPEND" = "yes" ] # Append to existing config file
  44. then
  45. echo >> config.h
  46. else
  47. > config.h # Create new config file
  48. fi
  49. echo "/* Automatically generated - do not edit */" >>config.h
  50. echo "#include <configs/$1.h>" >>config.h
  51. exit 0