Statistics
| Branch: | Revision:

streamers / Makefile @ 74a5d4ae

History | View | Annotate | Download (3.88 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 -lm
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 += -lstdc++ -lmon -lrep -ldclog -lcommon
45
CPPFLAGS += -DMONL
46
ifdef STATIC
47
CC=g++
48
endif
49
endif
50
LDLIBS += -Wl,-static -levent $(if $(STATIC), , -Wl,-Bdynamic) -lrt
51
#LDLIBS += -levent -lrt
52
LDLIBS += $(LIBEVENT_DIR)/lib/libevent.a -lrt
53
endif
54

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

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

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

    
99
LOCAL_MHD=$(ULPLAYER)/$(ULPLAYER_EXTERNAL_LIBS)/libmicrohttpd/temp_mhd_install
100
CPPFLAGS += -I$(LOCAL_MHD)/include
101
LDFLAGS += -L$(LOCAL_MHD)/lib
102
LDLIBS += $(LOCAL_MHD)/lib/libmicrohttpd.a
103

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

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

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

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

    
136
all: $(EXECTARGET)
137

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

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

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

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

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

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

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