2014-03-17 03:32:16 +00:00
GCC = gcc
2014-03-02 03:31:31 +00:00
.PHONY : default clean help ssl nossl
2014-03-01 15:24:53 +00:00
2014-03-02 03:31:31 +00:00
default : help
help :
2014-04-19 03:40:46 +00:00
@echo "Usage: make <help>|<clean>|<srs_publish_nossl>|<srs_play_nossl>|<srs_ingest_flv_nossl>|<srs_ingest_rtmp_nossl>|<srs_publish_ssl>|<srs_play_ssl>|<srs_ingest_flv_ssl>|<srs_ingest_rtmp_ssl>"
@echo " help display this help"
@echo " clean cleanup build"
@echo " ssl srs_publish_ssl, srs_play_ssl, srs_ingest_flv, srs_ingest_rtmp"
@echo " nossl srs_publish_nossl, srs_play_nossl, srs_ingest_flv, srs_ingest_rtmp"
@echo " srs_publish_nossl publish program using srs-librtmp, without ssl(simple handshake)"
@echo " srs_play_nossl play program using srs-librtmp, without ssl(simple handshake)"
@echo " srs_publish_ssl publish program using srs-librtmp, with ssl(complex handshake)"
@echo " srs_play_ssl play program using srs-librtmp, with ssl(complex handshake)"
@echo " srs_ingest_flv_nossl ingest flv file and publish to RTMP server. (simple handshake)"
@echo " srs_ingest_rtmp_nossl ingest RTMP and publish to RTMP server. (simple handshake)"
@echo " srs_ingest_flv_ssl ingest flv file and publish to RTMP server. (complex handshake)"
@echo " srs_ingest_rtmp_ssl ingest RTMP and publish to RTMP server. (complex handshake)"
2014-03-02 03:31:31 +00:00
@echo "Remark: about simple/complex handshake, see: http://blog.csdn.net/win_lin/article/details/13006803"
@echo "Remark: srs Makefile will auto invoke this by --with/without-ssl, "
@echo " that is, if user specified ssl(by --with-ssl), srs will make this by 'make ssl'"
@echo " that is, if user not use ssl(by --without-ssl), use 'make nossl'"
@echo " see: https://github.com/winlinvip/simple-rtmp-server/wiki/Build"
@echo "Remark: before make this sample, user must make the srs, with/without ssl"
2014-03-01 15:24:53 +00:00
clean :
2014-04-19 04:47:16 +00:00
@rm -f srs_publish_nossl srs_play_nossl srs_publish_ssl srs_play_ssl srs_ingest_flv_ssl srs_ingest_rtmp_ssl srs_ingest_flv_nossl srs_ingest_rtmp_nossl
2014-03-02 03:31:31 +00:00
# srs library root
SRS_OBJS = ../../objs
# srs-librtmp for publish/play, built by srs.
SRS_LIBRTMP_I = $( SRS_OBJS) /include/srs_librtmp.h
SRS_LIBRTMP_L = $( SRS_OBJS) /lib/srs_librtmp.a
# openssl for complex handshake, built by srs.
SRS_LIBSSL_L = $( SRS_OBJS) /openssl/lib/libssl.a $( SRS_OBJS) /openssl/lib/libcrypto.a
2014-04-19 04:47:16 +00:00
# the research public headers
SRS_RESEARCH_DEPS = Makefile srs_research_public.h
2014-03-02 03:31:31 +00:00
2014-03-17 04:06:58 +00:00
# for x86/x64 platform
i f e q ( $( GCC ) , g c c )
2014-04-19 01:47:47 +00:00
EXTRA_CXX_FLAG = -g -O0 -ldl -lstdc++
2014-05-04 11:13:21 +00:00
e n d i f
2014-03-17 04:06:58 +00:00
# for arm.
2014-05-04 11:13:21 +00:00
i f e q ( $( GCC ) , a r m - l i n u x - g n u e a b i - g c c )
2014-04-28 11:05:24 +00:00
EXTRA_CXX_FLAG = -g -O0 -ldl -static -lstdc++
2014-04-19 01:47:47 +00:00
e n d i f
2014-05-04 11:13:21 +00:00
# for mips, add -lgcc_eh, or stl compile failed.
i f e q ( $( GCC ) , m i p s e l - o p e n w r t - l i n u x - g c c )
EXTRA_CXX_FLAG = -g -O0 -ldl -lstdc++ -lgcc_eh
e n d i f
2014-04-19 01:47:47 +00:00
2014-04-19 04:47:16 +00:00
srs_publish_nossl : srs_publish .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L )
2014-04-19 01:47:47 +00:00
$( GCC) srs_publish.c $( SRS_LIBRTMP_L) $( EXTRA_CXX_FLAG) -o srs_publish_nossl
2014-03-02 03:31:31 +00:00
2014-04-19 04:47:16 +00:00
srs_play_nossl : srs_play .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L )
2014-04-19 01:47:47 +00:00
$( GCC) srs_play.c $( SRS_LIBRTMP_L) $( EXTRA_CXX_FLAG) -o srs_play_nossl
2014-04-19 04:47:16 +00:00
srs_ingest_flv_nossl : srs_ingest_flv .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L )
2014-04-19 03:40:46 +00:00
$( GCC) srs_ingest_flv.c $( SRS_LIBRTMP_L) $( EXTRA_CXX_FLAG) -o srs_ingest_flv_nossl
2014-04-19 01:47:47 +00:00
2014-04-19 04:47:16 +00:00
srs_ingest_rtmp_nossl : srs_ingest_rtmp .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L )
2014-04-19 03:40:46 +00:00
$( GCC) srs_ingest_rtmp.c $( SRS_LIBRTMP_L) $( EXTRA_CXX_FLAG) -o srs_ingest_rtmp_nossl
2014-03-02 03:31:31 +00:00
2014-04-19 04:47:16 +00:00
srs_publish_ssl : srs_publish .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L ) $( SRS_LIBSSL_L )
2014-04-19 01:47:47 +00:00
$( GCC) srs_publish.c $( SRS_LIBRTMP_L) $( SRS_LIBSSL_L) $( EXTRA_CXX_FLAG) -o srs_publish_ssl
2014-03-01 15:31:52 +00:00
2014-04-19 04:47:16 +00:00
srs_play_ssl : srs_play .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L ) $( SRS_LIBSSL_L )
2014-04-19 01:47:47 +00:00
$( GCC) srs_play.c $( SRS_LIBRTMP_L) $( SRS_LIBSSL_L) $( EXTRA_CXX_FLAG) -o srs_play_ssl
2014-03-01 15:31:52 +00:00
2014-04-19 04:47:16 +00:00
srs_ingest_flv_ssl : srs_ingest_flv .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L ) $( SRS_LIBSSL_L )
2014-04-19 03:40:46 +00:00
$( GCC) srs_ingest_flv.c $( SRS_LIBRTMP_L) $( SRS_LIBSSL_L) $( EXTRA_CXX_FLAG) -o srs_ingest_flv_ssl
2014-04-19 04:47:16 +00:00
srs_ingest_rtmp_ssl : srs_ingest_rtmp .c $( SRS_RESEARCH_DEPS ) $( SRS_LIBRTMP_I ) $( SRS_LIBRTMP_L ) $( SRS_LIBSSL_L )
2014-04-19 03:40:46 +00:00
$( GCC) srs_ingest_rtmp.c $( SRS_LIBRTMP_L) $( SRS_LIBSSL_L) $( EXTRA_CXX_FLAG) -o srs_ingest_rtmp_ssl
2014-03-02 03:31:31 +00:00
# alias for publish/play with/without ssl
2014-04-19 03:40:46 +00:00
ssl : srs_publish_ssl srs_play_ssl srs_ingest_flv_ssl srs_ingest_rtmp_ssl
nossl : srs_publish_nossl srs_play_nossl srs_ingest_flv_nossl srs_ingest_rtmp_nossl