-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (34 loc) · 1.71 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
# Folder of the Janus installation prefix (we add /include/janus for the headers)
JANUSP ?= /opt/janus
CFGDIR = conf
BLDDIR = build
SOURCE = src/janus_ndi.c
TARGET = janus_ndi.so
CFGFILE = janus.plugin.ndi.jcfg.sample
CFLAGS += -I$(JANUSP)/include/janus $(shell pkg-config --cflags glib-2.0 jansson opus libcurl) -D_GNU_SOURCE -DHAVE_SRTP_2
LDFLAGS += $(shell pkg-config --libs glib-2.0 jansson opus libcurl)
JCFLAGS = -g -O2 -fstack-protector -Wall -Wextra -Wformat=2 -Wpointer-arith \
-Wstrict-prototypes -Wredundant-decls -Wwrite-strings \
-Waggregate-return -Wlarger-than=65536 -Winline -Wpacked \
-Winit-self -Wno-unused-parameter -Wno-missing-field-initializers \
-Wno-override-init
# Uncomment if you want to build with libasan (for debugging leaks)
ASAN = -O1 -g3 -ggdb3 -fno-omit-frame-pointer -fsanitize=address -fno-sanitize-recover=all -fsanitize-address-use-after-scope
ASAN_LIBS = -fsanitize=address
# Copy the NDI includes and shared objects to the right place
NDI = -I/usr/include/NDI
NDI_LIBS = -lndi
LIBAV = $(shell pkg-config --cflags libavutil libavcodec libavformat libswscale libswresample)
LIBAV_LIBS = $(shell pkg-config --libs libavutil libavcodec libavformat libswscale libswresample)
all: $(BLDDIR)/$(TARGET) $(BLDDIR)/$(TOOL)
demo: $(BLDDIR)/$(DEMO)
$(BLDDIR)/$(TARGET): $(SOURCE)
@mkdir -p $(dir $@)
$(CC) -fPIC -shared -o $@ $< $(JCFLAGS) $(CFLAGS) $(ASAN) $(NDI) $(LIBAV) $(LDFLAGS) -ldl -rdynamic $(ASAN_LIBS) $(NDI_LIBS) $(LIBAV_LIBS)
clean:
rm -rf $(BLDDIR)
install: all
rm -f $(JANUSP)/lib/janus/plugins/janus_ndi.so
install $(BLDDIR)/$(TARGET) $(JANUSP)/lib/janus/plugins/
install -m 0644 $(CFGDIR)/$(CFGFILE) $(JANUSP)/etc/janus/
.PHONY: all install clean