Statistics
| Branch: | Revision:

streamers / Makefile @ d662c7ff

History | View | Annotate | Download (5.06 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 ?= grapes
99
ifeq ($(IO), grapes)
100
OBJS += input-grapes.o output-grapes.o
101
ifdef FFMPEG_DIR
102
CPPFLAGS += -I$(FFMPEG_DIR)
103
LDFLAGS += -L$(FFMPEG_DIR)/libavcodec -L$(FFMPEG_DIR)/libavformat -L$(FFMPEG_DIR)/libavutil -L$(FFMPEG_DIR)/libavcore
104
CFLAGS += -pthread
105
LDFLAGS += -pthread
106
LDLIBS += -lavformat -lavcodec -lavutil
107
LDLIBS += $(call ld-option, -lavcore)
108
LDLIBS += -lm
109
LDLIBS += $(call ld-option, -lz)
110
LDLIBS += $(call ld-option, -lbz2)
111
endif
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
CPPFLAGS += -I$(LOCAL_MHD)/include
125
LDFLAGS += -L$(LOCAL_MHD)/lib
126
LDLIBS += $(LOCAL_MHD)/lib/libmicrohttpd.a
127

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

    
143
CPPFLAGS += -I$(LOCAL_CURL)/include
144
LDFLAGS += -L$(LOCAL_CURL)/lib
145
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
146
endif
147

    
148
EXECTARGET = offerstreamer
149
ifdef ML
150
EXECTARGET := $(EXECTARGET)-ml
151
endif
152
ifdef MONL
153
EXECTARGET := $(EXECTARGET)-monl
154
endif
155
ifdef ALTO
156
EXECTARGET := $(EXECTARGET)-alto
157
endif
158
ifdef THREADS
159
EXECTARGET := $(EXECTARGET)-threads
160
endif
161
ifdef IO
162
EXECTARGET := $(EXECTARGET)-$(IO)
163
endif
164

    
165
ifeq ($(STATIC), 1)
166
EXECTARGET := $(EXECTARGET)-halfstatic
167
LDFLAGS += -Wl,-static
168
LDFLAGSPOST += -Wl,-Bdynamic
169
endif
170
ifeq ($(STATIC), 2)
171
EXECTARGET := $(EXECTARGET)-static
172
LDFLAGS += -static
173
endif
174

    
175
ifdef DEBUG
176
EXECTARGET := $(EXECTARGET)-debug
177
endif
178

    
179
ifdef RELEASE
180
EXECTARGET := $(EXECTARGET)-$(RELEASE)
181
endif
182

    
183
all: $(EXECTARGET)
184

    
185
ifndef ML
186
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
187
else
188
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
189
endif
190
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
191

    
192
$(EXECTARGET).o: streamer.o
193
	ln -sf streamer.o $(EXECTARGET).o
194

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

    
197
GRAPES:
198
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
199
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
200

    
201
ffmpeg:
202
	(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
203
	cd ffmpeg; ./configure
204

    
205
prepare: $(GRAPES) $(FFSRC)
206
	$(MAKE) -C $(GRAPES) -f Makefile
207
ifdef ML
208
	cd $(NAPA); ./autogen.sh; $(MAKE)
209
endif
210
	$(MAKE) -C $(FFSRC)
211

    
212
clean:
213
	rm -f $(EXECTARGET)
214
	rm -f $(GRAPES)/src/net_helper-ml.o
215
	rm -f $(GRAPES)/src/net_helper.o
216
	rm -f *.o
217
	rm -f Chunkiser/*.o
218
	rm -f $(ULPLAYER)/chunker_player/chunk_puller.o
219
	rm -f $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
220
	rm -f $(ULPLAYER)/event_http/event_http_server.o