Statistics
| Branch: | Revision:

peerstreamer-src / Makefile @ 2b3d6257

History | View | Annotate | Download (2.31 KB)

1 9eb656e7 Luca Baldesi
SRC=$(wildcard src/*.c)
2
OBJS=$(SRC:.c=.o)
3
4
EXE=peerstreamer-ng
5 eae15b28 Luca Baldesi
GRAPES=Libs/GRAPES
6
NET_HELPER=Libs/pstreamer/Lib/net_helper
7 9eb656e7 Luca Baldesi
8 eae15b28 Luca Baldesi
CFLAGS+=-Isrc/ -ILibs/mongoose/ -ILibs/pstreamer/include -I$(NET_HELPER)/include -I$(GRAPES)/include -L$(GRAPES)/src -L$(NET_HELPER)/  -LLibs/pstreamer/src 
9 9eb656e7 Luca Baldesi
ifdef DEBUG
10 94894fbe Luca Baldesi
CFLAGS+=-g -W -Wall -Wno-unused-function -Wno-unused-parameter -O0
11 9eb656e7 Luca Baldesi
else
12
CFLAGS+=-O6
13
endif
14
15 eae15b28 Luca Baldesi
LIBS+=Libs/mongoose/mongoose.o $(GRAPES)/src/libgrapes.a Libs/pstreamer/src/libpstreamer.a
16 c03fc03d Luca Baldesi
MONGOOSE_OPTS+=-DMG_DISABLE_MQTT -DMG_DISABLE_JSON_RPC -DMG_DISABLE_SOCKETPAIR  -DMG_DISABLE_CGI # -DMG_DISABLE_HTTP_WEBSOCKET
17 eae15b28 Luca Baldesi
LDFLAGS+=  -lpstreamer -lgrapes -lnethelper -lm
18 9eb656e7 Luca Baldesi
19 3af4c8d7 Luca Baldesi
all: $(EXE) Tools/janus/bin/janus
20 9eb656e7 Luca Baldesi
21 3d7e9165 Luca Baldesi
$(EXE): $(LIBS) $(OBJS) peerstreamer-ng.c
22 b87dc7a2 Luca Baldesi
	$(CC) -o peerstreamer-ng  peerstreamer-ng.c $(OBJS) Libs/mongoose/mongoose.o $(CFLAGS) $(LDFLAGS)
23 9eb656e7 Luca Baldesi
24
%.o: %.c 
25
	$(CC) $< -o $@ -c $(CFLAGS) 
26
27 3d7e9165 Luca Baldesi
Libs/mongoose/mongoose.o:
28
	git submodule init Libs/mongoose/
29
	git submodule update Libs/mongoose/
30 283f3f93 Luca Baldesi
	make -C Libs/mongoose/ CFLAGS="$(CFLAGS)" MONGOOSE_OPTS="$(MONGOOSE_OPTS)"
31 9eb656e7 Luca Baldesi
32 eae15b28 Luca Baldesi
$(GRAPES)/src/libgrapes.a:
33
	git submodule init $(GRAPES)/
34
	git submodule update $(GRAPES)/
35
	make -C $(GRAPES)/ 
36 1ddf5309 Luca Baldesi
37
Libs/pstreamer/src/libpstreamer.a:
38
	git submodule init Libs/pstreamer/
39
	git submodule update Libs/pstreamer/
40 eae15b28 Luca Baldesi
	NET_HELPER=$(PWD)/$(NET_HELPER) GRAPES=$(PWD)/$(GRAPES) make -C Libs/pstreamer/ 
41 1ddf5309 Luca Baldesi
42 3af4c8d7 Luca Baldesi
Tools/janus/bin/janus:
43 0d8b0d2f Luca Baldesi
	git submodule init Libs/janus-gateway/
44
	git submodule update Libs/janus-gateway/
45 2123cd4e Luca Baldesi
	cd $(PWD)/Libs/janus-gateway/ && ./autogen.sh
46 3af4c8d7 Luca Baldesi
	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 2123cd4e Luca Baldesi
	make -C Libs/janus-gateway/ install
48 0d8b0d2f Luca Baldesi
49 9eb656e7 Luca Baldesi
tests:
50 eae15b28 Luca Baldesi
	NET_HELPER=$(PWD)/$(NET_HELPER) GRAPES=$(PWD)/$(GRAPES) make -C Test/  # CFLAGS="$(CFLAGS)"
51 9eb656e7 Luca Baldesi
	Test/run_tests.sh
52
53
clean:
54 2123cd4e Luca Baldesi
	rm -rf Tools/janus
55
	rm -f *.o $(EXE) $(OBJS) $(LIBS)
56 9eb656e7 Luca Baldesi
	make -C Test/ clean
57 283f3f93 Luca Baldesi
	make -C Libs/mongoose clean
58 eae15b28 Luca Baldesi
	make -C $(GRAPES) clean
59 2b3d6257 Luca Baldesi
	NET_HELPER=$(PWD)/$(NET_HELPER) make -C Libs/pstreamer clean
60 2123cd4e Luca Baldesi
	make -C Libs/janus-gateway distclean
61 9eb656e7 Luca Baldesi
62
.PHONY: all clean