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.

60 lines
1.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. # MediaMtx (C++) - make CFG=Release (default) or make CFG=Debug
  2. #
  3. # Needs: live555 (pkg-config live555, as for la_mojo), libdatachannel (>= 0.20, installed in /usr/local),
  4. # OpenSSL, nlohmann-json (header only).
  5. # Other locations: make LIVE555_CFLAGS=... LIVE555_LIBS=... DATACHANNEL_CFLAGS=-I... DATACHANNEL_LIBS="-L... -ldatachannel"
  6. CFG ?= Release
  7. ifeq ($(CFG),Debug)
  8. OUTDIR = Debug
  9. OPT = -O0 -g -DDEBUG
  10. else
  11. OUTDIR = Release
  12. OPT = -O2
  13. endif
  14. LIVE555_CFLAGS ?= $(shell pkg-config --cflags live555 2>/dev/null)
  15. LIVE555_LIBS ?= $(shell pkg-config --libs live555 2>/dev/null || echo -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment)
  16. DATACHANNEL_CFLAGS ?=
  17. DATACHANNEL_LIBS ?= -ldatachannel
  18. CXX ?= g++
  19. CXXFLAGS += -std=c++17 -Wall -Wextra -Wno-unused-parameter $(OPT) $(LIVE555_CFLAGS) $(DATACHANNEL_CFLAGS)
  20. LIBS = $(DATACHANNEL_LIBS) $(LIVE555_LIBS) -lssl -lcrypto -lpthread
  21. TARGET = $(OUTDIR)/mediamtx
  22. SRCS = main.cpp \
  23. internal/logger/logger.cpp \
  24. internal/conf/conf.cpp \
  25. internal/codecs/h264/h264.cpp \
  26. internal/stream/stream.cpp \
  27. internal/staticsources/rtsp/rtspSource.cpp \
  28. internal/protocols/httpp/httpServer.cpp \
  29. internal/core/path.cpp \
  30. internal/core/pathManager.cpp \
  31. internal/core/core.cpp \
  32. internal/recorder/fmp4Writer.cpp \
  33. internal/recorder/recorder.cpp \
  34. internal/servers/webrtc/session.cpp \
  35. internal/servers/webrtc/webrtcServer.cpp \
  36. internal/api/api.cpp
  37. OBJS = $(patsubst %.cpp,$(OUTDIR)/obj/%.o,$(SRCS))
  38. DEPS = $(OBJS:.o=.d)
  39. all: $(TARGET)
  40. $(TARGET): $(OBJS)
  41. $(CXX) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
  42. $(OUTDIR)/obj/%.o: %.cpp
  43. @mkdir -p $(dir $@)
  44. $(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
  45. clean:
  46. rm -rf $(OUTDIR)
  47. -include $(DEPS)
  48. .PHONY: all clean