-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
90 lines (72 loc) · 2.19 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
CXXFLAGS=-c -std=c++11 -Wall -DLOG_SYSLOG -I external/yaml-cpp/include
LDFLAGS=
SOURCES=src/Amf.cpp \
src/Connection.cpp \
src/main.cpp \
src/Relay.cpp \
src/Server.cpp \
src/RTMP.cpp \
src/Status.cpp \
src/StatusSender.cpp \
src/Stream.cpp \
src/Utils.cpp \
src/Log.cpp \
src/Network.cpp \
src/Socket.cpp \
external/yaml-cpp/src/binary.cpp \
external/yaml-cpp/src/convert.cpp \
external/yaml-cpp/src/directives.cpp \
external/yaml-cpp/src/emit.cpp \
external/yaml-cpp/src/emitfromevents.cpp \
external/yaml-cpp/src/emitter.cpp \
external/yaml-cpp/src/emitterstate.cpp \
external/yaml-cpp/src/emitterutils.cpp \
external/yaml-cpp/src/exp.cpp \
external/yaml-cpp/src/memory.cpp \
external/yaml-cpp/src/node_data.cpp \
external/yaml-cpp/src/node.cpp \
external/yaml-cpp/src/nodebuilder.cpp \
external/yaml-cpp/src/nodeevents.cpp \
external/yaml-cpp/src/null.cpp \
external/yaml-cpp/src/ostream_wrapper.cpp \
external/yaml-cpp/src/parse.cpp \
external/yaml-cpp/src/parser.cpp \
external/yaml-cpp/src/regex_yaml.cpp \
external/yaml-cpp/src/scanner.cpp \
external/yaml-cpp/src/scanscalar.cpp \
external/yaml-cpp/src/scantag.cpp \
external/yaml-cpp/src/scantoken.cpp \
external/yaml-cpp/src/simplekey.cpp \
external/yaml-cpp/src/singledocparser.cpp \
external/yaml-cpp/src/stream.cpp \
external/yaml-cpp/src/tag.cpp
OBJECTS=$(SOURCES:.cpp=.o)
BINDIR=./bin
EXECUTABLE=rtmp_relay
all: CXXFLAGS+=-Os
all: directories $(SOURCES) $(EXECUTABLE)
debug: CXXFLAGS+=-DDEBUG -g -O0
debug: directories $(SOURCES) $(EXECUTABLE)
sanitize: CXXFLAGS+=-DDEBUG -g -O0 -fsanitize=address
sanitize: LDFLAGS=-fsanitize=address
sanitize: directories $(SOURCES) $(EXECUTABLE)
$(shell vsn=$(git describe) && echo "#define VERSION \"$vsn\"" > src/Version.hpp)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $(BINDIR)/$@
%.o: %.cpp
$(CXX) $(CXXFLAGS) $< -o $@
prefix=/usr/bin
install:
mkdir -p $(prefix)
install -m 0755 $(BINDIR)/$(EXECUTABLE) $(prefix)
.PHONY: install
uninstall:
rm -f $(prefix)/$(EXECUTABLE)
.PHONY: uninstall
clean:
rm -rf src/*.o external/yaml-cpp/src/*.o $(BINDIR)/$(EXECUTABLE) $(BINDIR)
.PHONY: clean
directories: ${BINDIR}
.PHONY: directories
${BINDIR}:
mkdir -p ${BINDIR}