generate-srs-librtmp-project.sh 1.5 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # when export srs-librtmp project
  3. # set the SRS_WORKDIR and SRS_OBJS,
  4. # then copy the srs-librtmp needed files.
  5. #
  6. # params:
  7. # $SRS_WORKDIR the work dir. ie. .
  8. # $SRS_OBJS the objs directory to store the Makefile. ie. ./objs
  9. # $SRS_OBJS_DIR the objs directory for Makefile. ie. objs
  10. # $SRS_EXPORT_LIBRTMP_PROJECT the export srs-librtmp project path. ie. srs-librtmp
  11. #
  12. if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then
  13. if [[ -d ${SRS_EXPORT_LIBRTMP_PROJECT} ]]; then
  14. echo -e "${RED}srs-librtmp target dir exists: ${SRS_EXPORT_LIBRTMP_PROJECT}. ${BLACK}"
  15. exit 1
  16. fi
  17. # create target
  18. SRS_WORKDIR=${SRS_EXPORT_LIBRTMP_PROJECT} && SRS_OBJS=${SRS_WORKDIR}/${SRS_OBJS_DIR} && mkdir -p ${SRS_OBJS} &&
  19. # copy src to target
  20. _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/research/librtmp && mkdir -p ${_CPT} && cp research/librtmp/*.c research/librtmp/Makefile ${_CPT} &&
  21. _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/auto && mkdir -p ${_CPT} && cp auto/generate_header.sh auto/generate-srs-librtmp-single.sh ${_CPT} &&
  22. _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/core && mkdir -p ${_CPT} && cp src/core/* ${_CPT} &&
  23. _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/kernel && mkdir -p ${_CPT} && cp src/kernel/* ${_CPT} &&
  24. _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/protocol && mkdir -p ${_CPT} && cp src/protocol/* ${_CPT} &&
  25. _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/libs && mkdir -p ${_CPT} && cp src/libs/* ${_CPT}
  26. # check ret
  27. ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi
  28. fi