Statistics
| Branch: | Revision:

streamers / Makefile @ 16ae4927

History | View | Annotate | Download (5.21 KB)

1 ecf6e64a Luca Abeni
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 c3b092a0 CsabaKiraly
LINKER = $(CC)
18 d2c7b084 MarcoBiazzini
STATIC ?= 0
19 c3b092a0 CsabaKiraly
20 89adc95a ArpadBakay
NAPA ?= ../../NAPA-BASELIBS
21
GRAPES ?= ../../GRAPES
22 03dca3bf ArpadBakay
ULPLAYER ?= ../StreamerPlayerChunker
23
ULPLAYER_EXTERNAL_LIBS ?= external_libs
24 89e893e2 Luca
25 a537d172 Csaba Kiraly
CPPFLAGS = -I$(NAPA)/include
26
CPPFLAGS += -I$(GRAPES)/include
27 7c933932 Csaba Kiraly
CPPFLAGS += -Itransition
28 89e893e2 Luca
29 a5a8f021 CsabaKiraly
ifdef GPROF
30 71b13457 Csaba Kiraly
CFLAGS += -pg -O0
31 a5a8f021 CsabaKiraly
LDFLAGS += -pg
32
endif
33
34 e64fc7e5 Luca
ifdef DEBUG
35 130de9fe Csaba Kiraly
CFLAGS += -O0
36 e64fc7e5 Luca
CPPFLAGS += -DDEBUG
37
endif
38 d8e83543 Csaba Kiraly
OBJS += dbg.o
39 e64fc7e5 Luca
40 89adc95a ArpadBakay
41 bb95b0c9 Csaba Kiraly
ifdef DEBUGOUT
42
CPPFLAGS += -DDEBUGOUT
43
endif
44
45 d6e5cee8 CsabaKiraly
LDFLAGS += -L$(GRAPES)/src
46 a537d172 Csaba Kiraly
LDLIBS += -lgrapes
47 b27e5c1b MarcoBiazzini
ifdef ALTO
48
LDFLAGS += -L$(NAPA)/ALTOclient
49 4815b48c CsabaKiraly
LDFLAGS += -L$(LIBXML2_DIR)/lib
50 b27e5c1b MarcoBiazzini
LDLIBS += -lALTO -lxml2
51 ea5857ec CsabaKiraly
CFLAGS += -pthread
52
LDFLAGS += -pthread
53 487fe1b5 CsabaKiraly
LDLIBS += $(call ld-option, -lz)
54 b27e5c1b MarcoBiazzini
endif
55 bb95b0c9 Csaba Kiraly
ifdef ML
56 89adc95a ArpadBakay
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
57 74a5d4ae CsabaKiraly
LDLIBS += -lml -lm
58 a2d8e810 ArpadBakay
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
59 a874d5ac Csaba Kiraly
ifdef MONL
60 a537d172 Csaba Kiraly
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
61 74a5d4ae CsabaKiraly
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
62 a874d5ac Csaba Kiraly
CPPFLAGS += -DMONL
63 d2c7b084 MarcoBiazzini
ifneq ($(STATIC), 0)
64 c3b092a0 CsabaKiraly
LINKER=g++
65 f5783ec4 Csaba Kiraly
endif
66 a874d5ac Csaba Kiraly
endif
67 018af19b TivadarSzemethy
LDLIBS += -levent -lrt
68 bb95b0c9 Csaba Kiraly
endif
69 89e893e2 Luca
70 b58cb76a Csaba Kiraly
OBJS += streaming.o
71 8e14c74c Csaba Kiraly
OBJS += net_helpers.o 
72 b27e5c1b MarcoBiazzini
73
ifdef ALTO
74
OBJS += topology-ALTO.o
75
OBJS += config.o
76
else
77 16ae4927 Csaba Kiraly
OBJS += topology.o nodeid_set.o
78 b27e5c1b MarcoBiazzini
endif
79
80 7d624a77 Csaba Kiraly
OBJS += chunk_signaling.o
81 5bc2469e Csaba Kiraly
OBJS += chunklock.o
82 581339c4 Csaba Kiraly
OBJS += channel.o
83 d92a24a6 Luca Abeni
ifdef THREADS
84 85e3443f GiuseppeTropea
CPPFLAGS += -DTHREADS
85 d92a24a6 Luca Abeni
OBJS += loop-mt.o
86
CFLAGS += -pthread
87
LDFLAGS += -pthread
88
else
89
OBJS += loop.o
90
endif
91
92 a874d5ac Csaba Kiraly
ifdef MONL
93 9c4f8e7e Csaba Kiraly
OBJS += measures-monl.o
94 473a00b3 Csaba Kiraly
else
95
OBJS += measures.o
96 a874d5ac Csaba Kiraly
endif
97
98 feaa6e2c Luca Abeni
IO ?= grapes
99 327fc1a6 Luca Abeni
ifeq ($(IO), grapes)
100
OBJS += input-grapes.o output-grapes.o
101 23748bc9 Luca Abeni
ifdef FFMPEG_DIR
102 327fc1a6 Luca Abeni
CPPFLAGS += -I$(FFMPEG_DIR)
103 1494311a Csaba Kiraly
LDFLAGS += -L$(FFMPEG_DIR)/libavcodec -L$(FFMPEG_DIR)/libavformat -L$(FFMPEG_DIR)/libavutil -L$(FFMPEG_DIR)/libavcore -L$(FFMPEG_DIR)/lib
104 327fc1a6 Luca Abeni
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 b3cd616d Csaba Kiraly
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 327fc1a6 Luca Abeni
endif
117 23748bc9 Luca Abeni
endif
118 5805c339 GiuseppeTropea
ifeq ($(IO), httpmhd)
119
CPPFLAGS += -DHTTPIO_MHD
120 03dca3bf ArpadBakay
CPPFLAGS += -DHTTPIO
121
OBJS += $(ULPLAYER)/chunker_player/chunk_puller.o
122
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
123 8612d586 CsabaKiraly
CPPFLAGS += -DCRAP -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding
124 03dca3bf ArpadBakay
CFLAGS += -pthread
125
LDFLAGS += -pthread
126 6d85fd9d CsabaKiraly
OBJS += input-http.o
127 8612d586 CsabaKiraly
OBJS += output-http.o output.o
128 03dca3bf ArpadBakay
129 37203792 GiuseppeTropea
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 03dca3bf ArpadBakay
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
136
endif
137 5805c339 GiuseppeTropea
ifeq ($(IO), httpevent)
138
CPPFLAGS += -DHTTPIO_EVENT
139
CPPFLAGS += -DHTTPIO
140
OBJS += $(ULPLAYER)/event_http/event_http_server.o
141 c0014e78 CsabaKiraly
LDFLAGS += -L$(NAPA)/dclog
142
LDLIBS += -ldclog
143 5805c339 GiuseppeTropea
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
144 8612d586 CsabaKiraly
CPPFLAGS += -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding -I$(ULPLAYER)/event_http -DCRAP
145 5805c339 GiuseppeTropea
OBJS += input-http.o
146 8612d586 CsabaKiraly
OBJS += output-http.o output.o
147 5805c339 GiuseppeTropea
148
CPPFLAGS += -I$(LOCAL_CURL)/include
149
LDFLAGS += -L$(LOCAL_CURL)/lib
150
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
151
endif
152 89e893e2 Luca
153 cbd3919d Csaba Kiraly
EXECTARGET = streamer
154 bb95b0c9 Csaba Kiraly
ifdef ML
155
EXECTARGET := $(EXECTARGET)-ml
156
endif
157 18b3d383 Csaba Kiraly
ifdef MONL
158
EXECTARGET := $(EXECTARGET)-monl
159
endif
160 b27e5c1b MarcoBiazzini
ifdef ALTO
161
EXECTARGET := $(EXECTARGET)-alto
162
endif
163 6bcb761d Csaba Kiraly
ifdef THREADS
164
EXECTARGET := $(EXECTARGET)-threads
165
endif
166 6d85fd9d CsabaKiraly
ifdef IO
167
EXECTARGET := $(EXECTARGET)-$(IO)
168 03dca3bf ArpadBakay
endif
169 89e893e2 Luca
170 d2c7b084 MarcoBiazzini
ifeq ($(STATIC), 1)
171
EXECTARGET := $(EXECTARGET)-halfstatic
172
LDFLAGS += -Wl,-static
173
LDFLAGSPOST += -Wl,-Bdynamic
174
endif
175
ifeq ($(STATIC), 2)
176 ae7b251e Csaba Kiraly
EXECTARGET := $(EXECTARGET)-static
177 d2c7b084 MarcoBiazzini
LDFLAGS += -static
178 ae7b251e Csaba Kiraly
endif
179
180 c7a8be3d CsabaKiraly
ifdef DEBUG
181
EXECTARGET := $(EXECTARGET)-debug
182
endif
183
184 b36d3310 Csaba Kiraly
ifdef RELEASE
185
EXECTARGET := $(EXECTARGET)-$(RELEASE)
186
endif
187
188 6dcf5ec0 Csaba Kiraly
all: $(EXECTARGET)
189 89e893e2 Luca
190 bb95b0c9 Csaba Kiraly
ifndef ML
191 d6e5cee8 CsabaKiraly
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
192 bb95b0c9 Csaba Kiraly
else
193 d6e5cee8 CsabaKiraly
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
194 bb95b0c9 Csaba Kiraly
endif
195 d2c7b084 MarcoBiazzini
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
196 89e893e2 Luca
197 f211f409 Csaba Kiraly
$(EXECTARGET).o: streamer.o
198 984f5a9b Csaba Kiraly
	ln -sf streamer.o $(EXECTARGET).o
199 89e893e2 Luca
200 89adc95a ArpadBakay
out-stream-avf.o Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFMPEG_DIR)/include 
201 709f774c Luca
202 42ae36af Luca Abeni
GRAPES:
203 aefc7450 Csaba Kiraly
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
204 d67ef29a Csaba Kiraly
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
205 42ae36af Luca Abeni
206 63b2e58c Luca Abeni
ffmpeg:
207 8f8bd3b6 Csaba Kiraly
	(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 63b2e58c Luca Abeni
	cd ffmpeg; ./configure
209
210
prepare: $(GRAPES) $(FFSRC)
211 0e66f272 Csaba Kiraly
	$(MAKE) -C $(GRAPES) -f Makefile
212 a537d172 Csaba Kiraly
ifdef ML
213
	cd $(NAPA); ./autogen.sh; $(MAKE)
214 0573c5f4 Csaba Kiraly
endif
215 63b2e58c Luca Abeni
	$(MAKE) -C $(FFSRC)
216 42ae36af Luca Abeni
217 89e893e2 Luca
clean:
218 6dcf5ec0 Csaba Kiraly
	rm -f $(EXECTARGET)
219 d6e5cee8 CsabaKiraly
	rm -f $(GRAPES)/src/net_helper-ml.o
220
	rm -f $(GRAPES)/src/net_helper.o
221 89e893e2 Luca
	rm -f *.o
222 0e7105fe Csaba Kiraly
	rm -f Chunkiser/*.o
223 5805c339 GiuseppeTropea
	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