Statistics
| Branch: | Revision:

streamers / Makefile @ 71b13457

History | View | Annotate | Download (5.37 KB)

1
include utils.mak
2

    
3
CFLAGS = -g -Wall
4
CFLAGS += $(call cc-option, -Wdeclaration-after-statement)
5
CFLAGS += $(call cc-option, -Wno-switch)
6
CFLAGS += $(call cc-option, -Wdisabled-optimization)
7
CFLAGS += $(call cc-option, -Wpointer-arith)
8
CFLAGS += $(call cc-option, -Wredundant-decls)
9
CFLAGS += $(call cc-option, -Wno-pointer-sign)
10
CFLAGS += $(call cc-option, -Wcast-qual)
11
CFLAGS += $(call cc-option, -Wwrite-strings)
12
CFLAGS += $(call cc-option, -Wtype-limits)
13
CFLAGS += $(call cc-option, -Wundef)
14

    
15
CFLAGS += $(call cc-option, -funit-at-a-time)
16

    
17
LINKER = $(CC)
18
STATIC ?= 0
19

    
20
NAPA ?= ../../NAPA-BASELIBS
21
GRAPES ?= ../../GRAPES
22
ULPLAYER ?= ../StreamerPlayerChunker
23
ULPLAYER_EXTERNAL_LIBS ?= external_libs
24

    
25
CPPFLAGS = -I$(NAPA)/include
26
CPPFLAGS += -I$(GRAPES)/include
27

    
28
ifdef GPROF
29
CFLAGS += -pg -O0
30
LDFLAGS += -pg
31
endif
32

    
33
ifdef DEBUG
34
CFLAGS += -O0
35
CPPFLAGS += -DDEBUG
36
OBJS += dbg.o
37
endif
38

    
39

    
40
ifdef DEBUGOUT
41
CPPFLAGS += -DDEBUGOUT
42
endif
43

    
44
LDFLAGS += -L$(GRAPES)/src
45
LDLIBS += -lgrapes
46
ifdef ALTO
47
LDFLAGS += -L$(NAPA)/ALTOclient
48
LDFLAGS += -L$(LIBXML2_DIR)/lib
49
LDLIBS += -lALTO -lxml2
50
CFLAGS += -pthread
51
LDFLAGS += -pthread
52
LDLIBS += $(call ld-option, -lz)
53
endif
54
ifdef ML
55
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
56
LDLIBS += -lml -lm
57
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
58
ifdef MONL
59
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
60
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
61
CPPFLAGS += -DMONL
62
ifneq ($(STATIC), 0)
63
LINKER=g++
64
endif
65
endif
66
LDLIBS += -levent -lrt
67
endif
68

    
69
OBJS += streaming.o
70
OBJS += net_helpers.o 
71

    
72
ifdef ALTO
73
OBJS += topology-ALTO.o
74
OBJS += config.o
75
else
76
OBJS += topology.o
77
endif
78

    
79
OBJS += chunk_signaling.o
80
OBJS += chunklock.o
81
OBJS += channel.o
82
ifdef THREADS
83
CPPFLAGS += -DTHREADS
84
OBJS += loop-mt.o
85
CFLAGS += -pthread
86
LDFLAGS += -pthread
87
else
88
OBJS += loop.o
89
endif
90

    
91
ifdef MONL
92
OBJS += measures-monl.o
93
else
94
OBJS += measures.o
95
endif
96

    
97
IO ?= ffmpeg
98
ifeq ($(IO), ffmpeg)
99
OBJS += input.o
100
OBJS += Chunkiser/input-stream-avs.o 
101
OBJS += output.o 
102
OBJS += out-stream-avf.o
103
CPPFLAGS += -I$(FFMPEG_DIR)/include
104
LDFLAGS += -L$(FFMPEG_DIR)/lib
105
CFLAGS += -pthread
106
LDFLAGS += -pthread
107
LDLIBS += -lavformat -lavcodec -lavutil
108
LDLIBS += -lm
109
LDLIBS += $(call ld-option, -lz)
110
LDLIBS += $(call ld-option, -lbz2)
111
endif
112
ifeq ($(IO), httpmhd)
113
CPPFLAGS += -DHTTPIO_MHD
114
CPPFLAGS += -DHTTPIO
115
OBJS += $(ULPLAYER)/chunker_player/chunk_puller.o
116
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
117
CPPFLAGS += -DCRAP -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding
118
CFLAGS += -pthread
119
LDFLAGS += -pthread
120
OBJS += input-http.o
121
OBJS += output-http.o output.o
122

    
123
LOCAL_MHD=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/libmicrohttpd/temp_mhd_install
124
CPPFLAGS += -I$(LOCAL_MHD)/include
125
LDFLAGS += -L$(LOCAL_MHD)/lib
126
LDLIBS += $(LOCAL_MHD)/lib/libmicrohttpd.a
127

    
128
LOCAL_CURL=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/curl/temp_curl_install
129
CPPFLAGS += -I$(LOCAL_CURL)/include
130
LDFLAGS += -L$(LOCAL_CURL)/lib
131
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
132
endif
133
ifeq ($(IO), httpevent)
134
CPPFLAGS += -DHTTPIO_EVENT
135
CPPFLAGS += -DHTTPIO
136
OBJS += $(ULPLAYER)/event_http/event_http_server.o
137
LDFLAGS += -L$(NAPA)/dclog
138
LDLIBS += -ldclog
139
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
140
CPPFLAGS += -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding -I$(ULPLAYER)/event_http -DCRAP
141
OBJS += input-http.o
142
OBJS += output-http.o output.o
143

    
144
LOCAL_CURL=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/curl/temp_curl_install
145
CPPFLAGS += -I$(LOCAL_CURL)/include
146
LDFLAGS += -L$(LOCAL_CURL)/lib
147
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
148
endif
149
ifeq ($(IO), dummy)
150
OBJS += input.o
151
OBJS += input-stream-dummy.o 
152
OBJS += output.o 
153
OBJS += out-stream-dummy.o
154
endif
155
ifeq ($(IO), udp)
156
OBJS += input-udp.o
157
OBJS += output.o
158
OBJS += out-stream-udp.o
159
endif
160

    
161
EXECTARGET = offerstreamer
162
ifdef ML
163
EXECTARGET := $(EXECTARGET)-ml
164
endif
165
ifdef MONL
166
EXECTARGET := $(EXECTARGET)-monl
167
endif
168
ifdef ALTO
169
EXECTARGET := $(EXECTARGET)-alto
170
endif
171
ifdef THREADS
172
EXECTARGET := $(EXECTARGET)-threads
173
endif
174
ifdef IO
175
EXECTARGET := $(EXECTARGET)-$(IO)
176
endif
177

    
178
ifeq ($(STATIC), 1)
179
EXECTARGET := $(EXECTARGET)-halfstatic
180
LDFLAGS += -Wl,-static
181
LDFLAGSPOST += -Wl,-Bdynamic
182
endif
183
ifeq ($(STATIC), 2)
184
EXECTARGET := $(EXECTARGET)-static
185
LDFLAGS += -static
186
endif
187

    
188
ifdef DEBUG
189
EXECTARGET := $(EXECTARGET)-debug
190
endif
191

    
192
ifdef RELEASE
193
EXECTARGET := $(EXECTARGET)-$(RELEASE)
194
endif
195

    
196
all: $(EXECTARGET)
197

    
198
ifndef ML
199
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
200
else
201
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
202
endif
203
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
204

    
205
$(EXECTARGET).o: streamer.o
206
	ln -sf streamer.o $(EXECTARGET).o
207

    
208
out-stream-avf.o Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFMPEG_DIR)/include 
209

    
210
GRAPES:
211
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
212
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
213

    
214
ffmpeg:
215
	(wget http://ffmpeg.org/releases/ffmpeg-checkout-snapshot.tar.bz2; tar xjf ffmpeg-checkout-snapshot.tar.bz2; mv ffmpeg-checkout-20* ffmpeg) || svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
216
	cd ffmpeg; ./configure
217

    
218
prepare: $(GRAPES) $(FFSRC)
219
	$(MAKE) -C $(GRAPES) -f Makefile
220
ifdef ML
221
	cd $(NAPA); ./autogen.sh; $(MAKE)
222
endif
223
	$(MAKE) -C $(FFSRC)
224

    
225
clean:
226
	rm -f $(EXECTARGET)
227
	rm -f $(GRAPES)/src/net_helper-ml.o
228
	rm -f $(GRAPES)/src/net_helper.o
229
	rm -f *.o
230
	rm -f Chunkiser/*.o
231
	rm -f $(ULPLAYER)/chunker_player/chunk_puller.o
232
	rm -f $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
233
	rm -f $(ULPLAYER)/event_http/event_http_server.o