Statistics
| Branch: | Revision:

streamers / Makefile @ a5a8f021

History | View | Annotate | Download (4.03 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)
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
ifndef HTTPIO
64
OBJS += input.o
65
OBJS += output.o 
66
else
67
OBJS += input-http.o
68
OBJS += output-http.o
69
endif
70
OBJS += net_helpers.o 
71
OBJS += topology.o
72
OBJS += chunk_signaling.o
73
OBJS += chunklock.o
74
OBJS += channel.o
75
ifdef THREADS
76
OBJS += loop-mt.o
77
CFLAGS += -pthread
78
LDFLAGS += -pthread
79
else
80
OBJS += loop.o
81
endif
82

    
83
ifdef MONL
84
OBJS += measures-monl.o
85
else
86
OBJS += measures.o
87
endif
88

    
89
ifndef DUMMY
90
ifndef HTTPIO
91
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
92
CPPFLAGS += -I$(FFMPEG_DIR)/include
93
LDFLAGS += -L$(FFMPEG_DIR)/lib
94
LDLIBS += -lavformat -lavcodec -lavutil
95
LDLIBS += -lm
96
LDLIBS += $(call ld-option, -lz)
97
LDLIBS += $(call ld-option, -lbz2)
98
else
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

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

    
111
LOCAL_CURL=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/curl/temp_curl_install
112
CPPFLAGS += -I$(LOCAL_CURL)/include
113
LDFLAGS += -L$(LOCAL_CURL)/lib
114
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
115
endif
116
else
117
OBJS += input-stream-dummy.o out-stream-dummy.o
118
endif
119

    
120
EXECTARGET = offerstreamer
121
ifdef ML
122
EXECTARGET := $(EXECTARGET)-ml
123
endif
124
ifdef MONL
125
EXECTARGET := $(EXECTARGET)-monl
126
endif
127
ifdef THREADS
128
EXECTARGET := $(EXECTARGET)-threads
129
endif
130
ifdef HTTPIO
131
EXECTARGET := $(EXECTARGET)-http
132
endif
133

    
134
ifdef STATIC
135
LDFLAGS += -static -v
136
EXECTARGET := $(EXECTARGET)-static
137
endif
138

    
139
ifdef RELEASE
140
EXECTARGET := $(EXECTARGET)-$(RELEASE)
141
endif
142

    
143
all: $(EXECTARGET)
144

    
145
ifndef ML
146
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper.o $(EXECTARGET).o
147
else
148
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper-ml.o $(EXECTARGET).o
149
endif
150
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
151

    
152
$(EXECTARGET).o: streamer.o
153
	ln -sf streamer.o $(EXECTARGET).o
154

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

    
157
GRAPES:
158
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
159
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
160

    
161
ffmpeg:
162
	(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
163
	cd ffmpeg; ./configure
164

    
165
prepare: $(GRAPES) $(FFSRC)
166
	$(MAKE) -C $(GRAPES) -f Makefile
167
ifdef ML
168
	cd $(NAPA); ./autogen.sh; $(MAKE)
169
endif
170
	$(MAKE) -C $(FFSRC)
171

    
172
clean:
173
	rm -f $(EXECTARGET)
174
	rm -f $(GRAPES)/net_helper-ml.o
175
	rm -f $(GRAPES)/net_helper.o
176
	rm -f *.o
177
	rm -f Chunkiser/*.o