Blame view

trunk/research/librtmp/Makefile 5.6 KB
winlin authored
1 2
GCC = gcc
3 4 5
ifeq ($(HANDSHAKE),)
    ST_ALL      = help
else
6 7 8
    ST_ALL      = objs/srs_flv_parser \
                objs/srs_flv_injecter objs/srs_publish objs/srs_play \
                objs/srs_ingest_flv objs/srs_ingest_rtmp objs/srs_detect_rtmp \
9
                objs/srs_bandwidth_check objs/srs_h264_raw_publish \
10 11
                objs/srs_audio_raw_publish objs/srs_aac_raw_publish \
                objs/srs_rtmp_dump
12 13
endif
14
.PHONY: default clean help ssl nossl
winlin authored
15
16
default: $(ST_ALL)
17 18

help:
winlin authored
19
	@echo "Usage: make <help>|<clean>|<ssl>|<nossl>"
20 21
	@echo "     help                    display this help"
	@echo "     clean                   cleanup build"
22 23
	@echo "     ssl                     all tools link ssl"
	@echo "     nossl                   all tools never link ssl"
winlin authored
24
	@echo "ssl/nossl will build the following tools:"
25
	@echo "     srs_flv_parser          parse flv file, print detail info."
26
	@echo "     srs_flv_injecter        inject keyframes information to metadata."
27
	@echo "     srs_publish             publish program using srs-librtmp"
28
	@echo "     srs_h264_raw_publish    publish raw h.264 stream to SSR by srs-librtmp"
29
	@echo "     srs_audio_raw_publish   publish raw audio stream to SSR by srs-librtmp"
30
	@echo "     srs_aac_raw_publish     publish raw aac stream to SSR by srs-librtmp"
31 32 33
	@echo "     srs_play                play program using srs-librtmp"
	@echo "     srs_ingest_flv          ingest flv file and publish to RTMP server."
	@echo "     srs_ingest_rtmp         ingest RTMP and publish to RTMP server."
winlin authored
34
	@echo "     srs_detect_rtmp         detect RTMP stream info."
35
	@echo "     srs_bandwidth_check     bandwidth check/test tool."
36
	@echo "     srs_rtmp_dump           dump rtmp stream to flv file."
37 38 39 40
	@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'"
41
	@echo "     see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_v1_Build"
42
	@echo "Remark: before make this sample, user must make the srs, with/without ssl"
winlin authored
43 44
    
clean:
winlin authored
45
	@rm -rf objs
46 47 48 49 50 51 52

# 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.
53
SRS_LIBSSL_L =
54 55
# public depends, the Makefile or public headers.
SRS_RESEARCH_DEPS = Makefile
56
57 58
# for x86/x64 platform
ifeq ($(GCC), gcc)
59
    EXTRA_CXX_FLAG = -g -O0 -ldl -lstdc++
winlin authored
60
endif
61
# for arm.
winlin authored
62
ifeq ($(GCC), arm-linux-gnueabi-gcc)
63
    EXTRA_CXX_FLAG = -g -O0 -ldl -static -lstdc++
64
endif
winlin authored
65 66 67 68
# for mips, add -lgcc_eh, or stl compile failed.
ifeq ($(GCC), mipsel-openwrt-linux-gcc)
    EXTRA_CXX_FLAG = -g -O0 -ldl -lstdc++ -lgcc_eh
endif
69 70 71 72
# for ssl or nossl
ifeq ($(HANDSHAKE), SSL)
    SRS_LIBSSL_L = $(SRS_OBJS)/openssl/lib/libssl.a $(SRS_OBJS)/openssl/lib/libcrypto.a
endif
73
74
ssl:
winlin authored
75
	@mkdir -p objs
76 77
	$(MAKE) HANDSHAKE="SSL"
nossl:
winlin authored
78
	@mkdir -p objs
79
	$(MAKE) HANDSHAKE="NOSSL"
80
winlin authored
81 82
objs/srs_flv_parser: srs_flv_parser.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L)
	$(GCC) srs_flv_parser.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_flv_parser
83
winlin authored
84 85
objs/srs_flv_injecter: srs_flv_injecter.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L)
	$(GCC) srs_flv_injecter.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_flv_injecter
86
winlin authored
87 88
objs/srs_publish: srs_publish.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_publish.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_publish
89
90 91 92
objs/srs_h264_raw_publish: srs_h264_raw_publish.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_h264_raw_publish.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_h264_raw_publish
93 94 95
objs/srs_audio_raw_publish: srs_audio_raw_publish.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_audio_raw_publish.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_audio_raw_publish
96 97 98
objs/srs_aac_raw_publish: srs_aac_raw_publish.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_aac_raw_publish.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_aac_raw_publish
winlin authored
99 100
objs/srs_play: srs_play.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_play.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_play
101
winlin authored
102 103
objs/srs_ingest_flv: srs_ingest_flv.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_ingest_flv.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_ingest_flv
104
winlin authored
105 106
objs/srs_ingest_rtmp: srs_ingest_rtmp.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_ingest_rtmp.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_ingest_rtmp
winlin authored
107
winlin authored
108 109
objs/srs_detect_rtmp: srs_detect_rtmp.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_detect_rtmp.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_detect_rtmp
110 111 112

objs/srs_bandwidth_check: srs_bandwidth_check.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_bandwidth_check.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_bandwidth_check
113 114 115

objs/srs_rtmp_dump: srs_rtmp_dump.c $(SRS_RESEARCH_DEPS) $(SRS_LIBRTMP_I) $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L)
	$(GCC) srs_rtmp_dump.c $(SRS_LIBRTMP_L) $(SRS_LIBSSL_L) $(EXTRA_CXX_FLAG) -o objs/srs_rtmp_dump