autogen.sh 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. #qtmake="/opt/Qt5.10.1/5.10.1/gcc_64/bin/qmake"
  2. #qtmake=/usr/bin/qmake
  3. #qtmake="/usr/lib/aarch64-linux-gnu/qt5/bin/qmake"
  4. if [ ! $qtmake ];then
  5. echo -e "\e[33m qtmake not set, auto find it\e[0m"
  6. qtmake=`find /opt -name "qmake" 2>/dev/null | grep 'gcc_64'`
  7. fi
  8. if [ ! $qtmake ];then
  9. echo -e "\e[33m qtmake not ,may be agx, auto find it\e[0m"
  10. if [ -d '/usr/lib/aarch64-linux-gnu/qt5' ]; then
  11. qtmake='/usr/lib/aarch64-linux-gnu/qt5/bin/qmake'
  12. else
  13. echo "if NVIDIA,please sudo apt install qt"
  14. fi
  15. fi
  16. if [ ! $qtmake ];then
  17. echo -e "\e[33m can't find qmake \e[0m"
  18. exit 1
  19. fi
  20. echo -e "\e[33m qtmake: $qtmake \e[0m"
  21. show_error=$1
  22. check_result()
  23. {
  24. if [ "$1" != 0 -a "$show_error" == "s" ];then
  25. echo -e "\e[33m*************************************************\e[0m"
  26. echo -e "\e[31m Please modify build error first,Exit!\e[0m"
  27. echo -e "\e[33m*************************************************\e[0m"
  28. exit 1
  29. fi
  30. }
  31. function checkOS_TYPE(){
  32. if [[ ! -z "`uname | grep Darwin`" ]];then
  33. OS_TYPE=osx
  34. install_path=/Applications
  35. elif [[ ! -z "`uname | grep Linux`" ]];then
  36. OS_TYPE=linux
  37. install_path=/usr/lib
  38. else
  39. echo "Unsupported operating systems!"
  40. exit 1
  41. fi
  42. echo "The current operating system is"
  43. echo $OS_TYPE
  44. }
  45. function checkos(){
  46. if [[ -f /etc/redhat-release ]];then
  47. OS=Centos
  48. elif [[ ! -z "`cat /etc/issue | grep bian`" ]];then
  49. OS=Debian
  50. elif [[ ! -z "`cat /etc/issue | grep Ubuntu`" ]];then
  51. OS=Ubuntu
  52. else
  53. echo "Unknow!!!"
  54. fi
  55. echo $OS
  56. }
  57. checkOS_TYPE
  58. checkos
  59. MAKEOPT=-j8
  60. mkdir bin
  61. cd src/include/proto
  62. sh ./protomake.sh
  63. cd ../../../
  64. cd src/common/modulecomm/
  65. $qtmake modulecomm.pro
  66. make $MAKEOPT
  67. check_result $?
  68. make clean
  69. cp libmodulecomm.so ./../../../bin/
  70. rm Makefile
  71. rm .qmake.stash
  72. cd ../../../
  73. cd src/common/xmlparam/
  74. $qtmake xmlparam.pro
  75. make $MAKEOPT
  76. check_result $?
  77. make clean
  78. cp libxmlparam.so ./../../../bin/
  79. rm Makefile
  80. rm .qmake.stash
  81. cd ../../../
  82. cd src/common/ndt_cpu/
  83. $qtmake ndt_cpu.pro
  84. make $MAKEOPT
  85. check_result $?
  86. make clean
  87. cp libndt_cpu.so ./../../../bin/
  88. rm Makefile
  89. rm .qmake.stash
  90. cd ../../../
  91. cd src/common/ivlog/
  92. $qtmake ivlog.pro
  93. make $MAKEOPT
  94. check_result $?
  95. make clean
  96. cp libivlog.so ./../../../bin/
  97. rm Makefile
  98. rm .qmake.stash
  99. cd ../../../
  100. cd src/common/ivfault/
  101. $qtmake ivfault.pro
  102. make $MAKEOPT
  103. check_result $?
  104. make clean
  105. cp libivfault.so ./../../../bin/
  106. rm Makefile
  107. rm .qmake.stash
  108. cd ../../../
  109. cd src/common/platformif/
  110. $qtmake platformif.pro
  111. make $MAKEOPT
  112. check_result $?
  113. make clean
  114. cp libplatformif.so ./../../../bin/
  115. rm Makefile
  116. rm .qmake.stash
  117. cd ../../../
  118. cd src/common/ivexit/
  119. $qtmake ivexit.pro
  120. make $MAKEOPT
  121. check_result $?
  122. make clean
  123. cp libivexit.so ./../../../bin/
  124. rm Makefile
  125. rm .qmake.stash
  126. cd ../../../
  127. cd src/common/ivbacktrace/
  128. $qtmake ivbacktrace.pro
  129. make $MAKEOPT
  130. check_result $?
  131. make clean
  132. cp libivbacktrace.so ./../../../bin/
  133. rm Makefile
  134. rm .qmake.stash
  135. cd ../../../
  136. controller_app_name=(
  137. controller_midcar
  138. )
  139. for x in ${controller_app_name[@]}
  140. do
  141. cd src/controller/${x}/
  142. $qtmake ${x}.pro
  143. make $MAKEOPT
  144. check_result $?
  145. make clean
  146. cp ${x} ./../../../bin/
  147. rm Makefile
  148. rm .qmake.stash
  149. rm ${x}
  150. cd ../../../
  151. done
  152. decition_app_name=(
  153. decition_brain
  154. #decition_brain_ge3
  155. #decition_brain_qingyuan
  156. #decition_brain_vv7
  157. )
  158. for x in ${decition_app_name[@]}
  159. do
  160. cd src/decition/${x}/
  161. $qtmake ${x}.pro
  162. make $MAKEOPT
  163. check_result $?
  164. make clean
  165. cp ${x} ./../../../bin/
  166. rm Makefile
  167. rm .qmake.stash
  168. rm ${x}
  169. cd ../../../
  170. done
  171. driver_app_name=(
  172. driver_lidar_rs16
  173. driver_gps_hcp2
  174. driver_can_nvidia_agx
  175. driver_map_trace
  176. driver_map_xodrload
  177. driver_rpc_server
  178. driver_cloud_grpc_client
  179. )
  180. for x in ${driver_app_name[@]}
  181. do
  182. cd src/driver/${x}/
  183. $qtmake ${x}.pro
  184. make $MAKEOPT
  185. check_result $?
  186. make clean
  187. cp ${x} ./../../../bin/
  188. rm Makefile
  189. rm .qmake.stash
  190. rm ${x}
  191. cd ../../../
  192. done
  193. detect_app_name=(
  194. detection_lidar_cnn_segmentation
  195. detection_radar_delphi_esr
  196. detection_gps_hcp2
  197. detection_chassis
  198. )
  199. for x in ${detect_app_name[@]}
  200. do
  201. cd src/detection/${x}/
  202. $qtmake ${x}.pro
  203. make $MAKEOPT
  204. check_result $?
  205. make clean
  206. cp ${x} ./../../../bin/
  207. rm Makefile
  208. rm .qmake.stash
  209. rm ${x}
  210. cd ../../../
  211. done
  212. tool_app_name=(
  213. view_pointcloud
  214. view_gps
  215. view_rawcan
  216. view_radar
  217. IVSysMan
  218. ivmapmake
  219. view_ivlog
  220. tool_querymsg
  221. tool_xodrobj
  222. ivlog_record
  223. adciv_record
  224. )
  225. for x in ${tool_app_name[@]}
  226. do
  227. cd src/tool/${x}/
  228. $qtmake ${x}.pro
  229. make $MAKEOPT
  230. check_result $?
  231. make clean
  232. cp ${x} ./../../../bin/
  233. rm Makefile
  234. rm .qmake.stash
  235. rm ${x}
  236. cd ../../../
  237. done
  238. ui_app_name=(
  239. ui_ads_hmi
  240. )
  241. for x in ${ui_app_name[@]}
  242. do
  243. cd src/ui/${x}/
  244. $qtmake ${x}.pro
  245. make $MAKEOPT
  246. check_result $?
  247. make clean
  248. cp ${x} ./../../../bin/
  249. rm Makefile
  250. rm .qmake.stash
  251. rm ${x}
  252. cd ../../../
  253. done