tsdumper2 reads incoming mpeg transport stream over UDP/RTP and then records it to disk. The files names are generated based on preconfigured time interval. https://georgi.unixsol.org/programs/tsdumper2/
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.

Makefile 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. CC = $(CROSS)$(TARGET)cc
  2. STRIP = $(CROSS)$(TARGET)strip
  3. MKDEP = $(CC) -MP -MM -o $*.d $<
  4. RM = rm -f
  5. MV = mv -f
  6. BUILD_ID = $(shell date +%Y%m%d_%H%M%S)
  7. VERSION = $(shell cat RELEASE)
  8. GIT_VER = $(shell git describe --tags --dirty --always 2>/dev/null)
  9. ifeq "$(GIT_VER)" ""
  10. GIT_VER = "release"
  11. endif
  12. ifndef V
  13. Q = @
  14. endif
  15. CFLAGS ?= -O2 -ggdb -pipe -ffunction-sections -fdata-sections \
  16. -W -Wall -Wextra \
  17. -Wshadow -Wformat-security -Wstrict-prototypes \
  18. -Wredundant-decls -Wold-style-definition
  19. uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
  20. LDFLAGS ?= -Wl,--gc-sections
  21. ifeq ($(uname_S),Darwin)
  22. LDFLAGS :=
  23. endif
  24. DEFS = -DBUILD_ID=\"$(BUILD_ID)\" \
  25. -DVERSION=\"$(VERSION)\" -DGIT_VER=\"$(GIT_VER)\"
  26. DEFS += -D_FILE_OFFSET_BITS=64
  27. PREFIX ?= /usr/local
  28. INSTALL_PRG = tsdumper2
  29. INSTALL_PRG_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
  30. INSTALL_DOC = tsdumper2.1
  31. INSTALL_DOC_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/share/man/man1)
  32. FUNCS_DIR = libfuncs
  33. FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a
  34. tsdumper_SRC = \
  35. udp.c \
  36. util.c \
  37. process.c \
  38. tsdumper2.c
  39. tsdumper_LIBS = -lpthread
  40. tsdumper_OBJS = $(FUNCS_LIB) $(tsdumper_SRC:.c=.o)
  41. CLEAN_OBJS = tsdumper2 $(tsdumper_SRC:.c=.o) $(tsdumper_SRC:.c=.d)
  42. PROGS = tsdumper2
  43. .PHONY: help distclean clean install uninstall
  44. all: $(PROGS)
  45. $(FUNCS_LIB): $(FUNCS_DIR)/libfuncs.h
  46. $(Q)echo " MAKE $(FUNCS_LIB)"
  47. $(Q)$(MAKE) -s -C $(FUNCS_DIR)
  48. tsdumper2: $(tsdumper_OBJS)
  49. $(Q)echo " LINK tsdumper2"
  50. $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) $(tsdumper_OBJS) $(tsdumper_LIBS) -o tsdumper2
  51. %.o: %.c Makefile RELEASE
  52. @$(MKDEP)
  53. $(Q)echo " CC tsdumper2 $<"
  54. $(Q)$(CC) $(CFLAGS) $(DEFS) -c $<
  55. -include $(tsdumper_SRC:.c=.d)
  56. strip:
  57. $(Q)echo " STRIP $(PROGS)"
  58. $(Q)$(STRIP) $(PROGS)
  59. clean:
  60. $(Q)echo " RM $(CLEAN_OBJS)"
  61. $(Q)$(RM) $(CLEAN_OBJS)
  62. distclean: clean
  63. $(Q)$(MAKE) -s -C $(FUNCS_DIR) clean
  64. install: all
  65. @install -d "$(INSTALL_PRG_DIR)"
  66. @echo "INSTALL $(INSTALL_PRG) -> $(INSTALL_PRG_DIR)"
  67. $(Q)-install $(INSTALL_PRG) "$(INSTALL_PRG_DIR)"
  68. @echo "INSTALL $(INSTALL_DOC) -> $(INSTALL_DOC_DIR)"
  69. $(Q)-install --mode 0644 $(INSTALL_DOC) "$(INSTALL_DOC_DIR)"
  70. uninstall:
  71. @-for FILE in $(INSTALL_PRG); do \
  72. echo "RM $(INSTALL_PRG_DIR)/$$FILE"; \
  73. rm "$(INSTALL_PRG_DIR)/$$FILE"; \
  74. done
  75. @-for FILE in $(INSTALL_DOC); do \
  76. echo "RM $(INSTALL_DOC_DIR)/$$FILE"; \
  77. rm "$(INSTALL_DOC_DIR)/$$FILE"; \
  78. done
  79. help:
  80. $(Q)echo -e "\
  81. tsdumper2 $(VERSION) ($(GIT_VER)) build\n\n\
  82. Build targets:\n\
  83. tsdumper2|all - Build tsdumper2.\n\
  84. \n\
  85. install - Install tsdumper2 in PREFIX ($(PREFIX))\n\
  86. uninstall - Uninstall tsdumper2 from PREFIX\n\
  87. \n\
  88. Cleaning targets:\n\
  89. clean - Remove tsdumper2 build files\n\
  90. distclean - Remove all build files\n\
  91. \n\
  92. make V=1 Enable verbose build\n\
  93. make PREFIX=dir Set install prefix\n\
  94. make CROSS=prefix Cross compile\n"