-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
163 lines (149 loc) · 7.81 KB
/
Makefile
File metadata and controls
163 lines (149 loc) · 7.81 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
DEFS= -DWEBRTC_SVNREVISION="2272" \
-DLARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64 \
-DWEBRTC_TARGET_PC \
-DWEBRTC_LINUX \
-DWEBRTC_THREAD_RR \
-DEXPAT_RELATIVE_PATH \
-DGTEST_RELATIVE_PATH \
-DJSONCPP_RELATIVE_PATH \
-DWEBRTC_RELATIVE_PATH \
-DLINUX \
-DPOSIX \
-D__STDC_FORMAT_MACROS \
-DDYNAMIC_ANNOTATIONS_ENABLED=0 \
# Flags passed to all source files.
# -fvisibility=hidden NodeJS Does not like it
CFLAGS= -pthread \
-fno-exceptions \
-fno-strict-aliasing \
-Wall \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wextra \
-pipe \
-fPIC \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-I/usr/include/atk-1.0 \
-I/usr/include/pango-1.0 \
-I/usr/include/gio-unix-2.0/ \
-I/usr/include/glib-2.0 \
-I/usr/lib/i386-linux-gnu/glib-2.0/include \
-I/usr/lib/x86_64-linux-gnu \
-I/usr/include/freetype2 \
-I/usr/include/libpng12 \
-I/usr/include/gtk-2.0 \
-I/usr/lib/gtk-2.0/include \
-I/usr/include/cairo \
-I/usr/include/gdk-pixbuf-2.0 \
-I/usr/include/pixman-1 \
-fno-ident \
-fdata-sections \
-ffunction-sections \
-g
CCFLAGS = -fno-rtti \
-fno-threadsafe-statics \
-fvisibility-inlines-hidden \
-Wsign-compare \
-D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64
INCLUDE_DIRS = -I/usr/include/nodejs/ \
-I$(WEBRTC_ROOT_PATH)/third_party/webrtc \
-I$(WEBRTC_ROOT_PATH)/third_party/webrtc/modules/interface \
-I$(WEBRTC_ROOT_PATH)/third_party/ \
-I$(WEBRTC_ROOT_PATH)/third_party/libjingle/source \
-I$(WEBRTC_ROOT_PATH)/third_party/libjingle/overrides \
-I$(WEBRTC_ROOT_PATH)/testing/gtest/include \
-I/home/santiago/Projects/node-peerconnection/src
BUILD_DIR = build/
NODE_MODULE = webrtc.node
NODE_FLAGS = -o$(BUILD_DIR)/$(NODE_MODULE)
FLAGS = -obin/sample
NODE_OBJS = $(WEBRTC_OBJS) $(BUILD_DIR)/*.o
SAMPLE_OBJS = $(WEBRTC_OBJS) $(BUILD_DIR)/main.o
WEBRTC_LIB = lib/webrtc.a
WEBRTC_LIB_BUILD = $(WEBRTC_ROOT_PATH)/out/Debug/obj
WEBRTC_LIBS_TRUNK := $(WEBRTC_LIB_BUILD).target/third_party/libjingle/libjingle_peerconnection.a \
$(WEBRTC_LIB_BUILD).target/third_party/libsrtp/libsrtp.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libvideo_capture_module.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libwebrtc_utility.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaudio_coding_module.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libCNG.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/common_audio/libsignal_processing.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libG711.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libG722.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libiLBC.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libiSAC.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libiSACFix.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libPCM16B.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libNetEq.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/common_audio/libresampler.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/common_audio/libvad.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/system_wrappers/source/libsystem_wrappers.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libwebrtc_video_coding.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libwebrtc_i420.a \
$(WEBRTC_LIB_BUILD).target/third_party/libjingle/libjingle.a \
$(WEBRTC_LIB_BUILD).target/third_party/jsoncpp/libjsoncpp.a \
$(WEBRTC_LIB_BUILD).target/third_party/libjingle/libjingle_p2p.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/video_coding/codecs/vp8/libwebrtc_vp8.a \
$(WEBRTC_LIB_BUILD).target/third_party/libyuv/libyuv.a \
$(WEBRTC_LIB_BUILD).target/third_party/libjpeg_turbo/libjpeg_turbo.a \
#$(WEBRTC_LIB_BUILD).target/third_party/libvpx/libvpx.a \
/usr/lib/x86_64-linux-gnu/libvpx.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libvideo_render_module.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/video_engine/libvideo_engine_core.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libmedia_file.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/librtp_rtcp.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libudp_transport.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libbitrate_controller.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libvideo_processing.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libvideo_processing_sse2.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/voice_engine/libvoice_engine_core.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaudio_conference_mixer.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaudio_processing.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaudioproc_debug_proto.a \
$(WEBRTC_LIB_BUILD).target/third_party/protobuf/libprotobuf_lite.a \
$(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaudio_device.a \
$(WEBRTC_LIB_BUILD).target/third_party/libjingle/libjingle.a \
$(WEBRTC_LIB_BUILD).target/third_party/jsoncpp/libjsoncpp.a \
$(WEBRTC_LIB_BUILD).target/third_party/libjingle/libjingle_p2p.a
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/common_video/libwebrtc_libyuv.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/common_video/libwebrtc_jpeg.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaec.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libapm_util.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaec_sse2.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libaecm.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libagc.a \
# $(WEBRTC_LIB_BUILD).target/third_party/webrtc/modules/libns.a \
NODE_WEBRTC_LDFLAGS = -pthread -Wl,-z,noexecstack -fPIC -L/usr/lib/x86_64-linux-gnu -mmmx -march=pentium4 -msse2 -mfpmath=sse -O0 $(NODE_FLAGS) -Wl,--start-group $(NODE_OBJS) $(WEBRTC_LIBS_TRUNK) -Wl,--end-group -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lX11 -lXext -lexpat -ldl -lasound -lpulse -shared
#-m32
WEBRTC_LDFLAGS = -pthread -Wl,-z,noexecstack -fPIC -L/usr/lib/x86_64-linux-gnu $(FLAGS) -Wl,--start-group $(SAMPLE_OBJS) $(WEBRTC_LIBS_TRUNK) -Wl,--end-group -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lX11 -lXext -lexpat -ldl -lasound -lpulse
#-m32
all: clean node_module
node_module_edge: clean
ifndef WEBRTC_ROOT_PATH
$(error WEBRTC_ROOT_PATH is undefined)
endif
mkdir -p build
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/peerconnectionwrapper.cc -c -o $(BUILD_DIR)/peerconnectionwrapper.o
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/peerconnectionfactory.cc -c -o $(BUILD_DIR)/peerconnectionfactory.o
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/peerconnectionwrapperproxy.cc -c -o $(BUILD_DIR)/peerconnectionwrapperproxy.o
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/gtk_video_renderer.cc -c -o $(BUILD_DIR)/gtk_video_renderer.o
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/binding.cc -c -o $(BUILD_DIR)/binding.o
g++ $(NODE_WEBRTC_LDFLAGS)
#strip build/webrtc.node
unlink webrtc.node; ln -s build/webrtc.node webrtc.node
node_module:
ifndef WEBRTC_ROOT_PATH
$(error WEBRTC_ROOT_PATH is undefined)
endif
mkdir -p build
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/bindings.cc -c -o $(BUILD_DIR)/bindings.o
g++ $(DEFS) $(CFLAGS) $(CCFLAGS) $(INCLUDE_DIRS) src/PeerConnection.cc -c -o $(BUILD_DIR)/PeerConnection.o
g++ $(NODE_WEBRTC_LDFLAGS)
strip build/webrtc.node
unlink webrtc.node; ln -s build/webrtc.node webrtc.node
clean:
rm -rf build/*
.PHONY: sample node_module