Statistics
| Branch: | Revision:

streamers / Makefile @ 03dca3bf

History | View | Annotate | Download (3.87 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
NAPA ?= ../../NAPA-BASELIBS
18
GRAPES ?= ../../GRAPES
19
ULPLAYER ?= ../StreamerPlayerChunker
20
ULPLAYER_EXTERNAL_LIBS ?= external_libs
21

    
22
CPPFLAGS = -I$(NAPA)/include
23
CPPFLAGS += -I$(GRAPES)/include
24

    
25
ifdef DEBUG
26
CFLAGS += -O0
27
CPPFLAGS += -DDEBUG
28
OBJS += dbg.o
29
endif
30

    
31

    
32
ifdef DEBUGOUT
33
CPPFLAGS += -DDEBUGOUT
34
endif
35

    
36
LDFLAGS += -L$(GRAPES)
37
LDLIBS += -lgrapes
38
ifdef ML
39
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
40
LDLIBS += -lml
41
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
42
ifdef MONL
43
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
44
LDLIBS += -lmon -lrep -ldclog -lcommon
45
CPPFLAGS += -DMONL
46
ifdef STATIC
47
CC=g++
48
else
49
LDLIBS_EXTRA = -lm -lstdc++
50
endif
51
endif
52
LDLIBS += -Wl,-static -levent $(if $(STATIC), , -Wl,-Bdynamic) -lrt
53
#LDLIBS += -levent -lrt
54
endif
55

    
56
OBJS += streaming.o
57
ifndef HTTPIO
58
OBJS += input.o
59
OBJS += output.o 
60
else
61
OBJS += input-http.o
62
OBJS += output-http.o
63
endif
64
OBJS += net_helpers.o 
65
OBJS += topology.o
66
OBJS += chunk_signaling.o
67
OBJS += chunklock.o
68
OBJS += channel.o
69
ifdef THREADS
70
OBJS += loop-mt.o
71
CFLAGS += -pthread
72
LDFLAGS += -pthread
73
else
74
OBJS += loop.o
75
endif
76

    
77
ifdef MONL
78
OBJS += measures-monl.o
79
else
80
OBJS += measures.o
81
endif
82

    
83
ifndef DUMMY
84
ifndef HTTPIO
85
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
86
CPPFLAGS += -I$(FFMPEG_DIR)/include
87
LDFLAGS += -L$(FFMPEG_DIR)/lib
88
LDLIBS += -lavformat -lavcodec -lavutil
89
LDLIBS_EXTRA += -lm
90
LDLIBS += $(call ld-option, -lz)
91
LDLIBS += $(call ld-option, -lbz2)
92
else
93
CPPFLAGS += -DHTTPIO
94
OBJS += $(ULPLAYER)/chunker_player/chunk_puller.o
95
OBJS += $(ULPLAYER)/chunker_streamer/chunk_pusher_curl.o
96
CPPFLAGS += -I$(ULPLAYER) -I$(ULPLAYER)/chunk_transcoding
97
CFLAGS += -pthread
98
LDFLAGS += -pthread
99

    
100
LOCAL_MHD=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/libmicrohttpd
101
CPPFLAGS += -I$(LOCAL_MHD) -I$(LOCAL_MHD)/src/daemon -I$(LOCAL_MHD)/src/include
102
LDFLAGS += -L$(LOCAL_MHD)/src/daemon
103
LDLIBS += $(LOCAL_MHD)/src/daemon/.libs/libmicrohttpd.a
104

    
105
LOCAL_CURL=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/curl-7.21.0/temp_curl_install
106
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a -lrt
107
endif
108
else
109
OBJS += input-stream-dummy.o out-stream-dummy.o
110
endif
111

    
112
LDLIBS += $(LDLIBS_EXTRA)
113

    
114
EXECTARGET = offerstreamer
115
ifdef ML
116
EXECTARGET := $(EXECTARGET)-ml
117
endif
118
ifdef MONL
119
EXECTARGET := $(EXECTARGET)-monl
120
endif
121
ifdef THREADS
122
EXECTARGET := $(EXECTARGET)-threads
123
endif
124
ifdef HTTPIO
125
EXECTARGET := $(EXECTARGET)-http
126
endif
127

    
128
ifdef STATIC
129
LDFLAGS += -static -v
130
EXECTARGET := $(EXECTARGET)-static
131
endif
132

    
133
ifdef RELEASE
134
EXECTARGET := $(EXECTARGET)-$(RELEASE)
135
endif
136

    
137
all: $(EXECTARGET)
138

    
139
ifndef ML
140
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper.o
141
else
142
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper-ml.o
143
endif
144

    
145
$(EXECTARGET).o: streamer.o
146
	ln -sf streamer.o $(EXECTARGET).o
147

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

    
150
GRAPES:
151
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
152
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
153

    
154
ffmpeg:
155
	(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
156
	cd ffmpeg; ./configure
157

    
158
prepare: $(GRAPES) $(FFSRC)
159
	$(MAKE) -C $(GRAPES) -f Makefile
160
ifdef ML
161
	cd $(NAPA); ./autogen.sh; $(MAKE)
162
endif
163
	$(MAKE) -C $(FFSRC)
164

    
165
clean:
166
	rm -f $(EXECTARGET)
167
	rm -f $(GRAPES)/net_helper-ml.o
168
	rm -f $(GRAPES)/net_helper.o
169
	rm -f *.o
170
	rm -f Chunkiser/*.o