Statistics
| Branch: | Revision:

streamers / Makefile @ 7c933932

History | View | Annotate | Download (5.4 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
CPPFLAGS += -Itransition
28

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

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

    
40

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
197
all: $(EXECTARGET)
198

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

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

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

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

    
215
ffmpeg:
216
	(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
217
	cd ffmpeg; ./configure
218

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

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