Statistics
| Branch: | Revision:

streamers / Makefile @ 145763e2

History | View | Annotate | Download (5.24 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 b58cb76a Csaba Kiraly
OBJS += dbg.o
38 e64fc7e5 Luca
endif
39
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 7d624a77 Csaba Kiraly
OBJS += topology.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 145763e2 Csaba Kiraly
LDLIBS += $(call ld-option, -lva)
112 b3cd616d Csaba Kiraly
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 327fc1a6 Luca Abeni
endif
118 23748bc9 Luca Abeni
endif
119 5805c339 GiuseppeTropea
ifeq ($(IO), httpmhd)
120
CPPFLAGS += -DHTTPIO_MHD
121 03dca3bf ArpadBakay
CPPFLAGS += -DHTTPIO
122
OBJS += $(ULPLAYER)/chunker_player/chunk_puller.o
123
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
124 8612d586 CsabaKiraly
CPPFLAGS += -DCRAP -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding
125 03dca3bf ArpadBakay
CFLAGS += -pthread
126
LDFLAGS += -pthread
127 6d85fd9d CsabaKiraly
OBJS += input-http.o
128 8612d586 CsabaKiraly
OBJS += output-http.o output.o
129 03dca3bf ArpadBakay
130 37203792 GiuseppeTropea
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 03dca3bf ArpadBakay
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
137
endif
138 5805c339 GiuseppeTropea
ifeq ($(IO), httpevent)
139
CPPFLAGS += -DHTTPIO_EVENT
140
CPPFLAGS += -DHTTPIO
141
OBJS += $(ULPLAYER)/event_http/event_http_server.o
142 c0014e78 CsabaKiraly
LDFLAGS += -L$(NAPA)/dclog
143
LDLIBS += -ldclog
144 5805c339 GiuseppeTropea
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
145 8612d586 CsabaKiraly
CPPFLAGS += -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding -I$(ULPLAYER)/event_http -DCRAP
146 5805c339 GiuseppeTropea
OBJS += input-http.o
147 8612d586 CsabaKiraly
OBJS += output-http.o output.o
148 5805c339 GiuseppeTropea
149
CPPFLAGS += -I$(LOCAL_CURL)/include
150
LDFLAGS += -L$(LOCAL_CURL)/lib
151
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
152
endif
153 89e893e2 Luca
154 cbd3919d Csaba Kiraly
EXECTARGET = streamer
155 bb95b0c9 Csaba Kiraly
ifdef ML
156
EXECTARGET := $(EXECTARGET)-ml
157
endif
158 18b3d383 Csaba Kiraly
ifdef MONL
159
EXECTARGET := $(EXECTARGET)-monl
160
endif
161 b27e5c1b MarcoBiazzini
ifdef ALTO
162
EXECTARGET := $(EXECTARGET)-alto
163
endif
164 6bcb761d Csaba Kiraly
ifdef THREADS
165
EXECTARGET := $(EXECTARGET)-threads
166
endif
167 6d85fd9d CsabaKiraly
ifdef IO
168
EXECTARGET := $(EXECTARGET)-$(IO)
169 03dca3bf ArpadBakay
endif
170 89e893e2 Luca
171 d2c7b084 MarcoBiazzini
ifeq ($(STATIC), 1)
172
EXECTARGET := $(EXECTARGET)-halfstatic
173
LDFLAGS += -Wl,-static
174
LDFLAGSPOST += -Wl,-Bdynamic
175
endif
176
ifeq ($(STATIC), 2)
177 ae7b251e Csaba Kiraly
EXECTARGET := $(EXECTARGET)-static
178 d2c7b084 MarcoBiazzini
LDFLAGS += -static
179 ae7b251e Csaba Kiraly
endif
180
181 c7a8be3d CsabaKiraly
ifdef DEBUG
182
EXECTARGET := $(EXECTARGET)-debug
183
endif
184
185 b36d3310 Csaba Kiraly
ifdef RELEASE
186
EXECTARGET := $(EXECTARGET)-$(RELEASE)
187
endif
188
189 6dcf5ec0 Csaba Kiraly
all: $(EXECTARGET)
190 89e893e2 Luca
191 bb95b0c9 Csaba Kiraly
ifndef ML
192 d6e5cee8 CsabaKiraly
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
193 bb95b0c9 Csaba Kiraly
else
194 d6e5cee8 CsabaKiraly
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
195 bb95b0c9 Csaba Kiraly
endif
196 d2c7b084 MarcoBiazzini
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
197 89e893e2 Luca
198 f211f409 Csaba Kiraly
$(EXECTARGET).o: streamer.o
199 984f5a9b Csaba Kiraly
	ln -sf streamer.o $(EXECTARGET).o
200 89e893e2 Luca
201 89adc95a ArpadBakay
out-stream-avf.o Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFMPEG_DIR)/include 
202 709f774c Luca
203 42ae36af Luca Abeni
GRAPES:
204 aefc7450 Csaba Kiraly
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
205 d67ef29a Csaba Kiraly
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
206 42ae36af Luca Abeni
207 63b2e58c Luca Abeni
ffmpeg:
208 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
209 63b2e58c Luca Abeni
	cd ffmpeg; ./configure
210
211
prepare: $(GRAPES) $(FFSRC)
212 0e66f272 Csaba Kiraly
	$(MAKE) -C $(GRAPES) -f Makefile
213 a537d172 Csaba Kiraly
ifdef ML
214
	cd $(NAPA); ./autogen.sh; $(MAKE)
215 0573c5f4 Csaba Kiraly
endif
216 63b2e58c Luca Abeni
	$(MAKE) -C $(FFSRC)
217 42ae36af Luca Abeni
218 89e893e2 Luca
clean:
219 6dcf5ec0 Csaba Kiraly
	rm -f $(EXECTARGET)
220 d6e5cee8 CsabaKiraly
	rm -f $(GRAPES)/src/net_helper-ml.o
221
	rm -f $(GRAPES)/src/net_helper.o
222 89e893e2 Luca
	rm -f *.o
223 0e7105fe Csaba Kiraly
	rm -f Chunkiser/*.o
224 5805c339 GiuseppeTropea
	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