Statistics
| Branch: | Revision:

streamers / Makefile @ d8e83543

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

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

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

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

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

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

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

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

    
188
all: $(EXECTARGET)
189

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

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

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

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

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

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

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