cross-do 565 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. cross_log=cross_build_$$.log
  3. enabled_log=${LOG}
  4. export CROSS=${CROSS_COMPILE}
  5. export CC=${CROSS}gcc
  6. export AR=${CROSS}ar
  7. export RANLIB=${CROSS}ranlib
  8. export CFLAGS=${CROSS_CFLAGS}
  9. gcc_version=$(${CC} --version)
  10. log_filename="${cross_log%.*}"
  11. echo Using $gcc_version
  12. rm -rf build_*
  13. if [ "x$enabled_log" == "x1" ]; then
  14. echo Compiler CC: $CC > $cross_log
  15. echo Compiler CFLAGS: $CFLAGS >> $cross_log
  16. time ./do &>> $cross_log
  17. mv cjdroute ${log_filename}_cjdroute
  18. else
  19. echo Compiler CC: $CC
  20. echo Compiler CFLAGS: $CFLAGS
  21. time ./do
  22. fi