mkconfig 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. 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" ] && echo "VENDOR = $5" >> config.mk
  39. #
  40. # Create board specific header file
  41. #
  42. if [ "$APPEND" = "yes" ] # Append to existing config file
  43. then
  44. echo >> config.h
  45. else
  46. > config.h # Create new config file
  47. fi
  48. echo "/* Automatically generated - do not edit */" >>config.h
  49. echo "#include <configs/$1.h>" >>config.h
  50. exit 0