videohubctrl can be used to control Blackmagic Design Videohub SDI router device over the network.
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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. CC = cc
  2. STRIP = strip
  3. CROSS := $(TARGET)
  4. MKDEP = $(CROSS)$(CC) -MP -MM -o $*.d $<
  5. RM = rm -f
  6. MV = mv -f
  7. # Setup quiet build
  8. Q =
  9. SAY = @true
  10. ifndef V
  11. Q = @
  12. SAY = @echo
  13. endif
  14. CFLAGS ?= -O2 -ggdb -pipe -ffunction-sections -fdata-sections \
  15. -W -Wall -Wextra \
  16. -Wshadow -Wformat-security -Wstrict-prototypes -Wno-unused-parameter \
  17. -Wredundant-decls -Wold-style-definition
  18. uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
  19. LDFLAGS ?= -Wl,--gc-sections
  20. ifeq ($(uname_S),Darwin)
  21. LDFLAGS :=
  22. endif
  23. DEFS += -D_FILE_OFFSET_BITS=64
  24. PREFIX ?= /usr/local
  25. INSTALL_PRG = videohubctrl
  26. INSTALL_PRG_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
  27. INSTALL_DOC = videohubctrl.1
  28. INSTALL_DOC_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/share/man/man1)
  29. FUNCS_DIR = libfuncs
  30. FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a
  31. videohubctrl_SRC = \
  32. cmd.c \
  33. net.c \
  34. util.c \
  35. display.c \
  36. videohubctrl.c
  37. videohubctrl_LIBS = -lpthread
  38. videohubctrl_OBJS = $(FUNCS_LIB) $(videohubctrl_SRC:.c=.o)
  39. CLEAN_OBJS = videohubctrl $(videohubctrl_SRC:.c=.o) $(videohubctrl_SRC:.c=.d) test/*.out
  40. DISTCLEAN_OBJS = version.h
  41. .PHONY: distclean clean version install uninstall test
  42. PROGS=videohubctrl
  43. version:
  44. $(shell ./version.sh >/dev/null)
  45. @$(MAKE) --no-print-directory videohubctrl
  46. videohubctrl: $(videohubctrl_OBJS)
  47. $(SAY) " LINK videohubctrl"
  48. $(Q)$(CROSS)$(CC) $(CFLAGS) $(DEFS) $(videohubctrl_OBJS) $(videohubctrl_LIBS) $(LDFLAGS) -o videohubctrl
  49. all: version
  50. test:
  51. test/run
  52. $(FUNCS_LIB): $(FUNCS_DIR)/libfuncs.h
  53. $(SAY) " MAKE $(FUNCS_LIB)"
  54. $(Q)$(MAKE) -s -C $(FUNCS_DIR)
  55. %.o: %.c Makefile RELEASE
  56. @$(MKDEP)
  57. $(SAY) " CC videohubctrl $<"
  58. $(Q)$(CROSS)$(CC) $(CFLAGS) $(DEFS) -c $<
  59. -include $(videohubctrl_SRC:.c=.d)
  60. strip:
  61. $(SAY) " STRIP $(PROGS)"
  62. $(Q)$(CROSS)$(STRIP) $(PROGS)
  63. clean:
  64. $(SAY) " RM $(CLEAN_OBJS)"
  65. $(Q)$(RM) $(CLEAN_OBJS)
  66. distclean: clean
  67. $(SAY) " RM $(DISTCLEAN_OBJS)"
  68. $(Q)$(RM) $(DISTCLEAN_OBJS)
  69. $(Q)$(MAKE) -s -C $(FUNCS_DIR) clean
  70. install: all
  71. $(Q)install -d "$(INSTALL_PRG_DIR)"
  72. $(Q)install -d "$(INSTALL_DOC_DIR)"
  73. $(SAY) "INSTALL $(INSTALL_PRG) -> $(INSTALL_PRG_DIR)"
  74. $(Q)-install $(INSTALL_PRG) "$(INSTALL_PRG_DIR)"
  75. $(SAY) "INSTALL $(INSTALL_DOC) -> $(INSTALL_DOC_DIR)"
  76. $(Q)-install -m 0644 $(INSTALL_DOC) "$(INSTALL_DOC_DIR)"
  77. uninstall:
  78. @-for FILE in $(INSTALL_PRG); do \
  79. echo "RM $(INSTALL_PRG_DIR)/$$FILE"; \
  80. rm "$(INSTALL_PRG_DIR)/$$FILE"; \
  81. done
  82. @-for FILE in $(INSTALL_DOC); do \
  83. echo "RM $(INSTALL_DOC_DIR)/$$FILE"; \
  84. rm "$(INSTALL_DOC_DIR)/$$FILE"; \
  85. done
  86. help:
  87. @printf "\
  88. videohubctrl build parameters\n\n\
  89. Build targets:\n\
  90. all - Build videohubctrl\n\
  91. install - Install videohubctrl in PREFIX: $(PREFIX)\n\
  92. uninstall - Uninstall videohubctrl from PREFIX\n\
  93. \n\
  94. Cleaning targets:\n\
  95. clean - Remove videohubctrl generated files.\n\
  96. distclean - Remove all generated files.\n\
  97. \n\
  98. make V=1 Enable verbose build\n\
  99. make PREFIX=dir Set install prefix\n\n"