Statistics
| Branch: | Revision:

streamers / Makefile @ 145763e2

History | View | Annotate | Download (5.24 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 -L$(FFMPEG_DIR)/lib
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
LDLIBS += $(call ld-option, -lva)
112
ifdef X264_DIR
113
CPPFLAGS += -I$(X264_DIR) -I$(X264_DIR)/include
114
LDFLAGS += -L$(X264_DIR) -L$(X264_DIR)/lib
115
LDLIBS += -lx264
116
endif
117
endif
118
endif
119
ifeq ($(IO), httpmhd)
120
CPPFLAGS += -DHTTPIO_MHD
121
CPPFLAGS += -DHTTPIO
122
OBJS += $(ULPLAYER)/chunker_player/chunk_puller.o
123
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
124
CPPFLAGS += -DCRAP -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding
125
CFLAGS += -pthread
126
LDFLAGS += -pthread
127
OBJS += input-http.o
128
OBJS += output-http.o output.o
129

    
130
CPPFLAGS += -I$(LOCAL_MHD)/include
131
LDFLAGS += -L$(LOCAL_MHD)/lib
132
LDLIBS += $(LOCAL_MHD)/lib/libmicrohttpd.a
133

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

    
149
CPPFLAGS += -I$(LOCAL_CURL)/include
150
LDFLAGS += -L$(LOCAL_CURL)/lib
151
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
152
endif
153

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

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

    
181
ifdef DEBUG
182
EXECTARGET := $(EXECTARGET)-debug
183
endif
184

    
185
ifdef RELEASE
186
EXECTARGET := $(EXECTARGET)-$(RELEASE)
187
endif
188

    
189
all: $(EXECTARGET)
190

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

    
198
$(EXECTARGET).o: streamer.o
199
	ln -sf streamer.o $(EXECTARGET).o
200

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

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

    
207
ffmpeg:
208
	(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
209
	cd ffmpeg; ./configure
210

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

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