7 LIB_INSTALL="/usr/local/lib/x86_64-linux-gnu/"
8 MAKE_STATUS_FILE="./000_make_status_config_build.log"
10 BUILD_TYPE="Relwithdebinfo"
13 if [ -e ./buildvars.dat ] ; then
16 case ${BUILD_TOOLCHAIN} in
17 "LLVM" | "llvm" | "CLANG" | "clang" )
18 #TOOLCHAIN_SCRIPT="../../cmake/toolchain_win32_cross_linux_llvm.cmake"
19 . ./params/buildvars_linux_params_llvm.dat
22 "GCC" | "gcc" | "GNU" )
23 #TOOLCHAIN_SCRIPT="../../cmake/toolchain_mingw_cross_linux.cmake"
24 . ./params/buildvars_linux_params_gcc.dat
28 #TOOLCHAIN_SCRIPT="../../cmake/toolchain_mingw_cross_linux.cmake"
29 . ./params/buildvars_linux_params_gcc.dat
34 case ${STRIP_SYMBOLS} in
35 "Yes" | "yes" | "YES" )
36 MAKEFLAGS_BASE2="-s ${MAKEFLAGS_BASE2}"
37 MAKEFLAGS_LINK_BASE="-s ${MAKEFLAGS_LINK_BASE2}"
38 MAKEFLAGS_DLL_LINK_BASE="-s ${MAKEFLAGS_DLL_LINK_BASE}"
39 MAKEFLAGS_DLL_BASE="${MAKEFLAGS_DLL_LINK_BASE}"
41 "No" | "no" | "NO" | * )
42 MAKEFLAGS_BASE2="-g -ggdb ${COMPRESS_CFLAGS} ${MAKEFLAGS_BASE2}"
43 MAKEFLAGS_LINK_BASE="-g -ggdb ${COMPRESS_CFLAGS} ${MAKEFLAGS_LINK_BASE2}"
44 MAKEFLAGS_DLL_LINK_BASE="-g -ggdb ${COMPRESS_CFLAGS} ${MAKEFLAGS_DLL_LINK_BASE}"
45 MAKEFLAGS_DLL_BASE="${MAKEFLAGS_DLL_LINK_BASE}"
51 MAKEFLAGS_CXX="${MAKEFLAGS_BASE2}"
52 MAKEFLAGS_CC="${MAKEFLAGS_BASE2}"
53 MAKEFLAGS_LIB_CXX="${MAKEFLAGS_DLL_BASE}"
54 MAKEFLAGS_LIB_CC="${MAKEFLAGS_DLL_BASE}"
59 if [ -n "${FFMPEG_DIR}" ]; then \
60 CMAKE_APPENDFLAG="${CMAKE_APPENDFLAG} -DLIBAV_ROOT_DIR=${FFMPEG_DIR}"
62 if [ -n "${QT5_DIR}" ]; then \
63 CMAKE_APPENDFLAG="${CMAKE_APPENDFLAG} -DQT5_ROOT_PATH=${QT5_DIR}"
66 #################################
69 function build_dll() {
73 echo ${CMAKE_FLAGS1} ${CMAKE_FLAGS2}
74 ${CMAKE} -DCMAKE_C_COMPILER:STRING=${CCMAKE_CC} \
75 -DCMAKE_CXX_COMPILER:STRING=${CCMAKE_CXX} \
76 "-DLIBCSP_INSTALL_DIR:STRING=${LIB_INSTALL}" \
78 "${CMAKE_FLAGS2}=${MAKEFLAGS_LIB_CXX}" \
79 "${CMAKE_FLAGS3}=${MAKEFLAGS_LIB_CC}" \
84 ${CMAKE} -DCMAKE_C_COMPILER:STRING=${CCMAKE_CC} \
85 -DCMAKE_CXX_COMPILER:STRING=${CCMAKE_CXX} \
86 "-DLIBCSP_INSTALL_DIR:STRING=${LIB_INSTALL}" \
88 "${CMAKE_FLAGS2}=${MAKEFLAGS_LIB_CXX}" \
89 "${CMAKE_FLAGS3}=${MAKEFLAGS_LIB_CC}" \
95 make ${MAKEFLAGS_GENERAL} 2>&1 | tee -a ./make.log
96 _STATUS=${PIPESTATUS[0]}
97 echo -e "$1 at `date --rfc-2822`:" "${_STATUS}" >> ../../${MAKE_STATUS_FILE}
99 0 ) sudo make install 2>&1 | tee -a ./make.log ;;
101 echo -e "Abort at `date --rfc-2822`." >> ../../${MAKE_STATUS_FILE}
110 case ${BUILD_TYPE} in
111 "Debug" | "DEBUG" | "debug" )
112 CMAKE_FLAGS1="-DCMAKE_BUILD_TYPE:STRING=debug"
113 CMAKE_FLAGS2="-DCMAKE_CXX_FLAGS_DEBUG:STRING"
114 CMAKE_FLAGS3="-DCMAKE_C_FLAGS_DEBUG:STRING"
116 "Release" | "RELEASE" | "release" )
117 CMAKE_FLAGS1="-DCMAKE_BUILD_TYPE:STRING=Release"
118 CMAKE_FLAGS2="-DCMAKE_CXX_FLAGS_RELEASE:STRING"
119 CMAKE_FLAGS3="-DCMAKE_C_FLAGS_RELEASE:STRING"
121 "Relwithdebinfo" | "RELWITHDEBINFO" | "relwithdebinfo" )
122 CMAKE_FLAGS1="-DCMAKE_BUILD_TYPE:STRING=Relwithdebinfo"
123 CMAKE_FLAGS2="-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING"
124 CMAKE_FLAGS3="-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING"
127 echo "Specify BUILD_TYPE in buildvars.dat to Debug, Release, Relwithdebinfo."
133 echo "Make status." > ${MAKE_STATUS_FILE}
134 echo "Started at `date --rfc-2822`:" >> ${MAKE_STATUS_FILE}
135 case ${USE_COMMON_DEVICE_LIB} in
136 "Yes" | "yes" | "YES" )
137 CMAKE_FLAGS4="-DUSE_DEVICES_SHARED_LIB=ON"
138 build_dll libCSPcommon_vm
145 case ${USE_COMMON_DEVICE_LIB} in
146 "Yes" | "yes" | "YES" )
147 build_dll libCSPfmgen
151 build_dll libCSPemu_utils
153 "No" | "no" | "NO" | * )
160 for SRCDATA in $@ ; do\
162 mkdir -p ${SRCDATA}/build
165 echo ${CMAKE_FLAGS1} ${CMAKE_FLAGS2}
166 ${CMAKE} -D CMAKE_C_COMPILER:STRING=${CCMAKE_CC} \
167 -D CMAKE_CXX_COMPILER:STRING=${CCMAKE_CXX} \
169 "${CMAKE_FLAGS2}=${MAKEFLAGS_CXX}" \
170 "${CMAKE_FLAGS3}=${MAKEFLAGS_CC}" \
172 ${CMAKE_APPENDFLAG} \
173 "-DCMAKE_EXE_LINKER_FLAGS:STRING=${MAKEFLAGS_LINK_BASE}" \
175 ${CMAKE} -D CMAKE_C_COMPILER:STRING=${CCMAKE_CC} \
176 -D CMAKE_CXX_COMPILER:STRING=${CCMAKE_CXX} \
178 "${CMAKE_FLAGS2}=${MAKEFLAGS_CXX}" \
179 "${CMAKE_FLAGS3}=${MAKEFLAGS_CC}" \
181 ${CMAKE_APPENDFLAG} \
182 "-DCMAKE_EXE_LINKER_FLAGS:STRING=${MAKEFLAGS_LINK_BASE}" \
188 make ${MAKEFLAGS_GENERAL} 2>&1 | tee -a ./make.log
189 _STATUS=${PIPESTATUS[0]}
190 echo -e "${SRCDATA} at `date --rfc-2822`:" "${_STATUS}" >> ../../${MAKE_STATUS_FILE}
193 0 ) sudo make install 2>&1 | tee -a ./make.log ;;
195 echo -e "Abort at `date --rfc-2822`." >> ../../${MAKE_STATUS_FILE}
203 echo -e "End at `date --rfc-2822`." >> ../../${MAKE_STATUS_FILE}