Statistics
| Branch: | Revision:

streamers / Makefile @ feaa6e2c

History | View | Annotate | Download (5.28 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
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

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

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

    
178
ifdef DEBUG
179
EXECTARGET := $(EXECTARGET)-debug
180
endif
181

    
182
ifdef RELEASE
183
EXECTARGET := $(EXECTARGET)-$(RELEASE)
184
endif
185

    
186
all: $(EXECTARGET)
187

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

    
195
$(EXECTARGET).o: streamer.o
196
	ln -sf streamer.o $(EXECTARGET).o
197

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

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

    
204
ffmpeg:
205
	(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
206
	cd ffmpeg; ./configure
207

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

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