-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
115 lines (96 loc) · 4.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
LIVE555_DIR = live
DEPDIR = .deps
PREFIX = out/usr/local
FF_INCLUDES = $(shell pkg-config --cflags libavformat)
INCLUDES = -I$(LIVE555_DIR)/UsageEnvironment/include -I$(LIVE555_DIR)/groupsock/include -I$(LIVE555_DIR)/liveMedia/include -I$(LIVE555_DIR)/BasicUsageEnvironment/include $(FF_INCLUDES) -Ilibev
# Default library filename suffixes for each library that we link with. The "config.*" file might redefine these later.
libliveMedia_LIB_SUFFIX = $(LIB_SUFFIX)
libBasicUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX)
libUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX)
libgroupsock_LIB_SUFFIX = $(LIB_SUFFIX)
##### Change the following for your environment:
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d
EASYLOGGING_FLAGS = -DELPP_THREAD_SAFE
LIBEV_FLAGS = -DEV_STANDALONE=1
COMPILE_OPTS = -g $(LIBEV_FLAGS) $(EASYLOGGING_FLAGS) $(DEPFLAGS) $(INCLUDES) -m64 -fPIC -I/usr/local/include -I. -O0 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
C = c
C_COMPILER = cc
C_FLAGS = $(COMPILE_OPTS) -fsanitize=address -fno-omit-frame-pointer
CPP = cpp
CPLUSPLUS_COMPILER = c++
CPLUSPLUS_FLAGS = -std=c++11 $(COMPILE_OPTS) -Wall -DBSD=1 -Wno-range-loop-construct -fsanitize=address -fno-omit-frame-pointer
OBJ = o
LINK = c++ -o
LINK_OPTS = -L. -fsanitize=address -fno-omit-frame-pointer
CONSOLE_LINK_OPTS = $(LINK_OPTS)
LIBRARY_LINK = ar cr
LIBRARY_LINK_OPTS =
LIB_SUFFIX = a
LIBS_FOR_CONSOLE_APPLICATION = -lavcodec -lavutil -lavformat -lavdevice -lswscale
LIBS_FOR_GUI_APPLICATION =
EXE =
##### End of variables to change
MEDIA_SERVER = LiveRTSP
ALL = live555 $(MEDIA_SERVER)
all: $(ALL)
.PHONY: live555
live555:
cd $(LIVE555_DIR); ./genMakefiles linux-no-openssl-asan
make -C $(LIVE555_DIR)/BasicUsageEnvironment
make -C $(LIVE555_DIR)/groupsock
make -C $(LIVE555_DIR)/liveMedia
make -C $(LIVE555_DIR)/UsageEnvironment
make -C $(LIVE555_DIR)/mediaServer
EASYLOGGING_CC_SRCS = easyloggingpp/easylogging++.cc
MEDIA_SERVER_CC_SRCS = Main.cc \
LiveRTSPServer.cc \
H264LiveMediaSubsession.cc \
H265LiveMediaSubsession.cc \
SimpleLiveMediaSubsession.cc \
ADTSLiveMediaSubsession.cc \
LiveMediaFactory.cc \
LiveMediaSubsession.cc \
LiveMediaInputSource.cc \
FFH264InputSource.cc
LIBEV_C_SRCS = libev/ev.c
MEDIA_SERVER_OBJS = $(MEDIA_SERVER_C_SRCS:%.c=%.o) \
$(MEDIA_SERVER_CC_SRCS:%.cc=%.o) \
$(EASYLOGGING_CC_SRCS:.cc=.o) \
$(LIBEV_C_SRCS:%.c=%.o)
DEPFILES := $(MEDIA_SERVER_C_SRCS:%.c=$(DESTDIR)/%.d) $(MEDIA_SERVER_CC_SRCS:%.cc=$(DEPDIR)/%.d)
#$(info $(DEPFILES))
USAGE_ENVIRONMENT_DIR = $(LIVE555_DIR)/UsageEnvironment
USAGE_ENVIRONMENT_LIB = $(USAGE_ENVIRONMENT_DIR)/libUsageEnvironment.$(libUsageEnvironment_LIB_SUFFIX)
BASIC_USAGE_ENVIRONMENT_DIR = $(LIVE555_DIR)/BasicUsageEnvironment
BASIC_USAGE_ENVIRONMENT_LIB = $(BASIC_USAGE_ENVIRONMENT_DIR)/libBasicUsageEnvironment.$(libBasicUsageEnvironment_LIB_SUFFIX)
LIVEMEDIA_DIR = $(LIVE555_DIR)/liveMedia
LIVEMEDIA_LIB = $(LIVEMEDIA_DIR)/libliveMedia.$(libliveMedia_LIB_SUFFIX)
GROUPSOCK_DIR = $(LIVE555_DIR)/groupsock
GROUPSOCK_LIB = $(GROUPSOCK_DIR)/libgroupsock.$(libgroupsock_LIB_SUFFIX)
LOCAL_LIBS = $(LIVEMEDIA_LIB) $(GROUPSOCK_LIB) \
$(BASIC_USAGE_ENVIRONMENT_LIB) $(USAGE_ENVIRONMENT_LIB)
LIBS = $(LOCAL_LIBS) $(LIBS_FOR_CONSOLE_APPLICATION)
$(MEDIA_SERVER): $(MEDIA_SERVER_OBJS) $(LOCAL_LIBS)
$(LINK)$@ $(CONSOLE_LINK_OPTS) $(MEDIA_SERVER_OBJS) $(LIBS)
clean:
-make -C live clean
-rm -rf *.$(OBJ) $(ALL) core *.core *~ include/*~
install: $(MEDIA_SERVER)
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $(MEDIA_SERVER) $(DESTDIR)$(PREFIX)/bin
%.o : %.c
%.o : %.c $(DEPDIR)/%.d | $(DEPDIR)
$(C_COMPILER) -c $(C_FLAGS) $< -o $@
%.o : %.cc
%.o : %.cc $(DEPDIR)/%.d | $(DEPDIR)
$(info $@ $<)
$(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< -o $@
easyloggingpp/%.o : easyloggingpp/%.cc
$(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< -o $@
libev/%.o : libev/%.c
$(C_COMPILER) -c $(C_FLAGS) $< -o $@
$(DEPDIR): ; @mkdir -p $@
$(DEPFILES):
$(info depfiles: $@)
include $(wildcard $(DEPFILES))
##### Any additional, platform-specific rules come here: