Statistics
| Branch: | Revision:

peerstreamer-src / Makefile @ 2b3d6257

History | View | Annotate | Download (2.31 KB)

1
SRC=$(wildcard src/*.c)
2
OBJS=$(SRC:.c=.o)
3

    
4
EXE=peerstreamer-ng
5
GRAPES=Libs/GRAPES
6
NET_HELPER=Libs/pstreamer/Lib/net_helper
7

    
8
CFLAGS+=-Isrc/ -ILibs/mongoose/ -ILibs/pstreamer/include -I$(NET_HELPER)/include -I$(GRAPES)/include -L$(GRAPES)/src -L$(NET_HELPER)/  -LLibs/pstreamer/src 
9
ifdef DEBUG
10
CFLAGS+=-g -W -Wall -Wno-unused-function -Wno-unused-parameter -O0
11
else
12
CFLAGS+=-O6
13
endif
14

    
15
LIBS+=Libs/mongoose/mongoose.o $(GRAPES)/src/libgrapes.a Libs/pstreamer/src/libpstreamer.a
16
MONGOOSE_OPTS+=-DMG_DISABLE_MQTT -DMG_DISABLE_JSON_RPC -DMG_DISABLE_SOCKETPAIR  -DMG_DISABLE_CGI # -DMG_DISABLE_HTTP_WEBSOCKET
17
LDFLAGS+=  -lpstreamer -lgrapes -lnethelper -lm
18

    
19
all: $(EXE) Tools/janus/bin/janus
20

    
21
$(EXE): $(LIBS) $(OBJS) peerstreamer-ng.c
22
	$(CC) -o peerstreamer-ng  peerstreamer-ng.c $(OBJS) Libs/mongoose/mongoose.o $(CFLAGS) $(LDFLAGS)
23

    
24
%.o: %.c 
25
	$(CC) $< -o $@ -c $(CFLAGS) 
26

    
27
Libs/mongoose/mongoose.o:
28
	git submodule init Libs/mongoose/
29
	git submodule update Libs/mongoose/
30
	make -C Libs/mongoose/ CFLAGS="$(CFLAGS)" MONGOOSE_OPTS="$(MONGOOSE_OPTS)"
31

    
32
$(GRAPES)/src/libgrapes.a:
33
	git submodule init $(GRAPES)/
34
	git submodule update $(GRAPES)/
35
	make -C $(GRAPES)/ 
36

    
37
Libs/pstreamer/src/libpstreamer.a:
38
	git submodule init Libs/pstreamer/
39
	git submodule update Libs/pstreamer/
40
	NET_HELPER=$(PWD)/$(NET_HELPER) GRAPES=$(PWD)/$(GRAPES) make -C Libs/pstreamer/ 
41

    
42
Tools/janus/bin/janus:
43
	git submodule init Libs/janus-gateway/
44
	git submodule update Libs/janus-gateway/
45
	cd $(PWD)/Libs/janus-gateway/ && ./autogen.sh
46
	cd $(PWD)/Libs/janus-gateway/ && SRTP15X_CFLAGS="-I$(PWD)/Libs/janus-gateway/Libs/libsrtp/include" SRTP15X_LIBS="-L$(PWD)/Libs/janus-gateway/Libs/libsrtp" PKG_CONFIG_PATH=$(PWD)/Libs/janus-gateway/Libs/libsrtp ./configure --disable-all-plugins --disable-all-transports --disable-all-handlers --enable-rest --disable-turn-rest-api --enable-static --prefix=$(PWD)/Tools/janus --enable-plugin-streaming --enable-plugin-videoroom #--enable-libsrtp2
47
	make -C Libs/janus-gateway/ install
48

    
49
tests:
50
	NET_HELPER=$(PWD)/$(NET_HELPER) GRAPES=$(PWD)/$(GRAPES) make -C Test/  # CFLAGS="$(CFLAGS)"
51
	Test/run_tests.sh
52

    
53
clean:
54
	rm -rf Tools/janus
55
	rm -f *.o $(EXE) $(OBJS) $(LIBS)
56
	make -C Test/ clean
57
	make -C Libs/mongoose clean
58
	make -C $(GRAPES) clean
59
	NET_HELPER=$(PWD)/$(NET_HELPER) make -C Libs/pstreamer clean
60
	make -C Libs/janus-gateway distclean
61

    
62
.PHONY: all clean
63