Statistics
| Branch: | Revision:

streamers / Makefile @ 5805c339

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

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

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

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

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

    
38

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

    
43
LDFLAGS += -L$(GRAPES)/src
44
LDLIBS += -lgrapes
45
ifdef ML
46
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
47
LDLIBS += -lml -lm
48
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
49
ifdef MONL
50
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
51
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
52
CPPFLAGS += -DMONL
53
ifdef STATIC
54
LINKER=g++
55
endif
56
endif
57
LDLIBS += -Wl,-static -levent $(if $(STATIC), , -Wl,-Bdynamic) -lrt
58
LDLIBS += -levent -lrt
59
#LDLIBS += $(LIBEVENT_DIR)/lib/libevent.a -lrt
60
endif
61

    
62
OBJS += streaming.o
63
OBJS += net_helpers.o 
64
OBJS += topology.o
65
OBJS += chunk_signaling.o
66
OBJS += chunklock.o
67
OBJS += channel.o
68
ifdef THREADS
69
CPPFLAGS += -DTHREADS
70
OBJS += loop-mt.o
71
CFLAGS += -pthread
72
LDFLAGS += -pthread
73
else
74
OBJS += loop.o
75
endif
76

    
77
ifdef MONL
78
OBJS += measures-monl.o
79
else
80
OBJS += measures.o
81
endif
82

    
83
IO ?= ffmpeg
84
ifeq ($(IO), ffmpeg)
85
OBJS += input.o
86
OBJS += Chunkiser/input-stream-avs.o 
87
OBJS += output.o 
88
OBJS += out-stream-avf.o
89
CPPFLAGS += -I$(FFMPEG_DIR)/include
90
LDFLAGS += -L$(FFMPEG_DIR)/lib
91
LDLIBS += -lavformat -lavcodec -lavutil
92
LDLIBS += -lm
93
LDLIBS += -lpthread
94
LDLIBS += $(call ld-option, -lz)
95
LDLIBS += $(call ld-option, -lbz2)
96
endif
97
ifeq ($(IO), httpmhd)
98
CPPFLAGS += -DHTTPIO_MHD
99
CPPFLAGS += -DHTTPIO
100
OBJS += $(ULPLAYER)/chunker_player/chunk_puller.o
101
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
102
CPPFLAGS += -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding
103
CFLAGS += -pthread
104
LDFLAGS += -pthread
105
OBJS += input-http.o
106
OBJS += output-http.o
107

    
108
LOCAL_MHD=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/libmicrohttpd/temp_mhd_install
109
CPPFLAGS += -I$(LOCAL_MHD)/include
110
LDFLAGS += -L$(LOCAL_MHD)/lib
111
LDLIBS += $(LOCAL_MHD)/lib/libmicrohttpd.a
112

    
113
LOCAL_CURL=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/curl/temp_curl_install
114
CPPFLAGS += -I$(LOCAL_CURL)/include
115
LDFLAGS += -L$(LOCAL_CURL)/lib
116
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
117
endif
118
ifeq ($(IO), httpevent)
119
CPPFLAGS += -DHTTPIO_EVENT
120
CPPFLAGS += -DHTTPIO
121
OBJS += $(ULPLAYER)/event_http/event_http_server.o
122
#LDFLAGS += -L$(NAPA)/dclog
123
#LDLIBS += -ldclog
124
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
125
CPPFLAGS += -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding -I$(ULPLAYER)/event_http
126
OBJS += input-http.o
127
OBJS += output-http.o
128

    
129
#LDFLAGS += -L$(LIBEVENT_DIR)/lib
130
#CPPFLAGS += -I$(LIBEVENT_DIR)/include
131
#LDLIBS += -Wl,-static -levent
132
#LDLIBS += -levent
133

    
134
LOCAL_CURL=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/curl/temp_curl_install
135
CPPFLAGS += -I$(LOCAL_CURL)/include
136
LDFLAGS += -L$(LOCAL_CURL)/lib
137
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
138
endif
139
ifeq ($(IO), dummy)
140
OBJS += input.o
141
OBJS += input-stream-dummy.o 
142
OBJS += output.o 
143
OBJS += out-stream-dummy.o
144
endif
145
ifeq ($(IO), udp)
146
OBJS += input-udp.o
147
OBJS += output.o
148
OBJS += out-stream-udp.o
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 THREADS
159
EXECTARGET := $(EXECTARGET)-threads
160
endif
161
ifdef IO
162
EXECTARGET := $(EXECTARGET)-$(IO)
163
endif
164

    
165
ifdef STATIC
166
LDFLAGS += -static -v
167
EXECTARGET := $(EXECTARGET)-static
168
endif
169

    
170
ifdef DEBUG
171
EXECTARGET := $(EXECTARGET)-debug
172
endif
173

    
174
ifdef RELEASE
175
EXECTARGET := $(EXECTARGET)-$(RELEASE)
176
endif
177

    
178
all: $(EXECTARGET)
179

    
180
ifndef ML
181
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
182
else
183
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
184
endif
185
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
186

    
187
$(EXECTARGET).o: streamer.o
188
	ln -sf streamer.o $(EXECTARGET).o
189

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

    
192
GRAPES:
193
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
194
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
195

    
196
ffmpeg:
197
	(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
198
	cd ffmpeg; ./configure
199

    
200
prepare: $(GRAPES) $(FFSRC)
201
	$(MAKE) -C $(GRAPES) -f Makefile
202
ifdef ML
203
	cd $(NAPA); ./autogen.sh; $(MAKE)
204
endif
205
	$(MAKE) -C $(FFSRC)
206

    
207
clean:
208
	rm -f $(EXECTARGET)
209
	rm -f $(GRAPES)/src/net_helper-ml.o
210
	rm -f $(GRAPES)/src/net_helper.o
211
	rm -f *.o
212
	rm -f Chunkiser/*.o
213
	rm -f $(ULPLAYER)/chunker_player/chunk_puller.o
214
	rm -f $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
215
	rm -f $(ULPLAYER)/event_http/event_http_server.o