mkconfig 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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
  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 5 ] && 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. #
  29. # Create include file for Make
  30. #
  31. echo "ARCH = $2" > config.mk
  32. echo "CPU = $3" >> config.mk
  33. echo "BOARD = $4" >> config.mk
  34. [ "$5" ] && echo "VENDOR = $5" >> config.mk
  35. #
  36. # Create board specific header file
  37. #
  38. if [ "$APPEND" = "yes" ] # Append to existing config file
  39. then
  40. echo >> config.h
  41. else
  42. > config.h # Create new config file
  43. fi
  44. echo "/* Automatically generated - do not edit */" >>config.h
  45. echo "#include <configs/$1.h>" >>config.h
  46. exit 0