You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.1 KiB
70 lines
2.1 KiB
# MediaMtx (C++) - make CFG=Release (default) or make CFG=Debug
|
|
#
|
|
# Needs: live555 (pkg-config live555, as for la_mojo), libdatachannel (>= 0.20, installed in /usr/local),
|
|
# OpenSSL. JSON: JsonCpp of dr_frucht (../../lib/include/json, ../../lib/data/json).
|
|
# Other locations: make LIVE555_CFLAGS=... LIVE555_LIBS=... DATACHANNEL_CFLAGS=-I... DATACHANNEL_LIBS="-L... -ldatachannel"
|
|
|
|
CFG ?= Release
|
|
ifeq ($(CFG),Debug)
|
|
OUTDIR = Debug
|
|
OPT = -O0 -g -DDEBUG
|
|
else
|
|
OUTDIR = Release
|
|
OPT = -O2
|
|
endif
|
|
|
|
LIVE555_CFLAGS ?= $(shell pkg-config --cflags live555 2>/dev/null)
|
|
LIVE555_LIBS ?= $(shell pkg-config --libs live555 2>/dev/null || echo -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment)
|
|
DATACHANNEL_CFLAGS ?=
|
|
DATACHANNEL_LIBS ?= -ldatachannel
|
|
|
|
CXX ?= g++
|
|
DFSL = ../..
|
|
CXXFLAGS += -std=c++17 -Wall -Wextra -Wno-unused-parameter $(OPT) $(LIVE555_CFLAGS) $(DATACHANNEL_CFLAGS) -I$(DFSL)/lib/include
|
|
LIBS = $(DATACHANNEL_LIBS) $(LIVE555_LIBS) -lssl -lcrypto -lpthread
|
|
|
|
TARGET = $(OUTDIR)/mediamtx
|
|
|
|
SRCS = main.cpp \
|
|
internal/logger/logger.cpp \
|
|
internal/conf/conf.cpp \
|
|
internal/codecs/h264/h264.cpp \
|
|
internal/stream/stream.cpp \
|
|
internal/staticsources/rtsp/rtspSource.cpp \
|
|
internal/protocols/httpp/httpServer.cpp \
|
|
internal/core/path.cpp \
|
|
internal/core/pathManager.cpp \
|
|
internal/core/core.cpp \
|
|
internal/recorder/fmp4Writer.cpp \
|
|
internal/recorder/recorder.cpp \
|
|
internal/servers/webrtc/session.cpp \
|
|
internal/servers/webrtc/webrtcServer.cpp \
|
|
internal/api/api.cpp
|
|
|
|
# JsonCpp from dr_frucht
|
|
JSON_SRCS = $(DFSL)/lib/data/json/json_reader.cpp \
|
|
$(DFSL)/lib/data/json/json_value.cpp \
|
|
$(DFSL)/lib/data/json/json_writer.cpp
|
|
|
|
OBJS = $(patsubst %.cpp,$(OUTDIR)/obj/%.o,$(SRCS)) $(patsubst $(DFSL)/lib/data/json/%.cpp,$(OUTDIR)/obj/jsoncpp/%.o,$(JSON_SRCS))
|
|
DEPS = $(OBJS:.o=.d)
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CXX) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
|
|
|
|
$(OUTDIR)/obj/%.o: %.cpp
|
|
@mkdir -p $(dir $@)
|
|
$(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
|
|
|
|
$(OUTDIR)/obj/jsoncpp/%.o: $(DFSL)/lib/data/json/%.cpp
|
|
@mkdir -p $(dir $@)
|
|
$(CXX) $(CXXFLAGS) -w -MMD -MP -c $< -o $@
|
|
|
|
clean:
|
|
rm -rf $(OUTDIR)
|
|
|
|
-include $(DEPS)
|
|
|
|
.PHONY: all clean
|