Blame view

trunk/research/librtmp/Makefile 3.9 KB
winlin authored
1 2
GCC = gcc
3 4 5
ifeq ($(HANDSHAKE),)
    ST_ALL      = help
else
winlin authored
6
    ST_ALL      = srs_flv_parser srs_flv_injecter srs_publish srs_play srs_ingest_flv srs_ingest_rtmp srs_detect_rtmp
7 8
endif
9
.PHONY: default clean help ssl nossl
winlin authored
10
11
default: $(ST_ALL)
12 13

help:
winlin authored
14
	@echo "Usage: make <help>|<clean>|<ssl>|<nossl>"
15 16
	@echo "     help                    display this help"
	@echo "     clean                   cleanup build"
17 18
	@echo "     ssl                     all tools link ssl"
	@echo "     nossl                   all tools never link ssl"
winlin authored
19
	@echo "ssl/nossl will build the following tools:"
20
	@echo "     srs_flv_parser          parse flv file, print detail info."
21
	@echo "     srs_flv_injecter        inject keyframes information to metadata."
22 23 24 25
	@echo "     srs_publish             publish program using srs-librtmp"
	@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
26
	@echo "     srs_detect_rtmp         detect RTMP stream info."
27 28 29 30 31 32
	@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"
winlin authored
33 34
    
clean:
winlin authored
35
	@rm -f srs_flv_parser srs_flv_injecter srs_publish srs_play srs_ingest_flv srs_ingest_rtmp srs_detect_rtmp
36 37 38 39 40 41 42

# 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.
43
SRS_LIBSSL_L =
44 45
# the research public headers
SRS_RESEARCH_DEPS = Makefile srs_research_public.h
46
47 48
# for x86/x64 platform
ifeq ($(GCC), gcc)
49
    EXTRA_CXX_FLAG = -g -O0 -ldl -lstdc++
winlin authored
50
endif
51
# for arm.
winlin authored
52
ifeq ($(GCC), arm-linux-gnueabi-gcc)
53
    EXTRA_CXX_FLAG = -g -O0 -ldl -static -lstdc++
54
endif
winlin authored
55 56 57 58
# 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
59 60 61 62
# for ssl or nossl
ifeq ($(HANDSHAKE), SSL)
    SRS_LIBSSL_L = $(SRS_OBJS)/openssl/lib/libssl.a $(SRS_OBJS)/openssl/lib/libcrypto.a
endif
63
64 65 66 67
ssl:
	$(MAKE) HANDSHAKE="SSL"
nossl:
	$(MAKE) HANDSHAKE="NOSSL"
68
69 70
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 srs_flv_parser
71
72 73 74
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 srs_flv_injecter
75 76
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 srs_publish
77
78 79
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 srs_play
80
81 82
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 srs_ingest_flv
83
84 85
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 srs_ingest_rtmp
winlin authored
86 87 88

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 srs_detect_rtmp