mkconfig 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. if [ -z "$6" -o "$6" = "NULL" ] ; then
  28. ln -s arch-$3 asm-$2/arch
  29. else
  30. ln -s arch-$6 asm-$2/arch
  31. fi
  32. if [ "$2" = "arm" ] ; then
  33. rm -f asm-$2/proc
  34. ln -s proc-armv asm-$2/proc
  35. fi
  36. #
  37. # Create include file for Make
  38. #
  39. echo "ARCH = $2" > config.mk
  40. echo "CPU = $3" >> config.mk
  41. echo "BOARD = $4" >> config.mk
  42. [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
  43. [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
  44. #
  45. # Create board specific header file
  46. #
  47. if [ "$APPEND" = "yes" ] # Append to existing config file
  48. then
  49. echo >> config.h
  50. else
  51. > config.h # Create new config file
  52. fi
  53. echo "/* Automatically generated - do not edit */" >>config.h
  54. echo "#include <configs/$1.h>" >>config.h
  55. exit 0