Statistics
| Branch: | Revision:

streamers / Makefile @ e816f3de

History | View | Annotate | Download (4.33 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
STATIC ?= 0
19

    
20
NAPA ?= ../../NAPA-BASELIBS
21
GRAPES ?= ../../GRAPES
22

    
23
CPPFLAGS = -I$(NAPA)/include
24
CPPFLAGS += -I$(GRAPES)/include
25
CPPFLAGS += -Itransition
26

    
27
ifdef GPROF
28
CFLAGS += -pg -O0
29
LDFLAGS += -pg
30
endif
31

    
32
ifdef DEBUG
33
CFLAGS += -O0
34
CPPFLAGS += -DDEBUG
35
endif
36
OBJS += dbg.o
37

    
38

    
39
ifdef DEBUGOUT
40
CPPFLAGS += -DDEBUGOUT
41
endif
42

    
43
LDFLAGS += -L$(GRAPES)/src
44
LDLIBS += -lgrapes
45
ifdef ALTO
46
LDFLAGS += -L$(NAPA)/ALTOclient
47
LDFLAGS += -L$(LIBXML2_DIR)/lib
48
LDLIBS += -lALTO -lxml2
49
CFLAGS += -pthread
50
LDFLAGS += -pthread
51
LDLIBS += $(call ld-option, -lz)
52
endif
53
ifdef ML
54
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
55
LDLIBS += -lml -lm
56
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
57
ifdef MONL
58
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
59
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
60
CPPFLAGS += -DMONL
61
ifneq ($(STATIC), 0)
62
LINKER=$(CXX)
63
endif
64
endif
65
LDLIBS += -levent
66
LDLIBS += $(call ld-option, -lrt)
67
endif
68

    
69
OBJS += streaming.o
70
OBJS += net_helpers.o 
71

    
72
ifdef ALTO
73
OBJS += topology-ALTO.o
74
OBJS += config.o
75
else
76
OBJS += topology.o nodeid_set.o
77
endif
78

    
79
OBJS += chunk_signaling.o
80
OBJS += chunklock.o
81
OBJS += transaction.o
82
OBJS += ratecontrol.o
83
OBJS += channel.o
84
ifdef THREADS
85
CPPFLAGS += -DTHREADS
86
OBJS += loop-mt.o
87
CFLAGS += -pthread
88
LDFLAGS += -pthread
89
else
90
OBJS += loop.o
91
endif
92

    
93
ifdef MONL
94
OBJS += measures-monl.o
95
else
96
OBJS += measures.o
97
endif
98

    
99
OBJS += output-grapes.o
100
IO ?= grapes
101
ifeq ($(IO), grapes)
102
CFLAGS += -DIO_GRAPES
103
CFLAGS += -DOUTPUT_REORDER=true
104
OBJS += input-grapes.o
105
ifdef FFMPEG_DIR
106
CPPFLAGS += -I$(FFMPEG_DIR)
107
LDFLAGS += -L$(FFMPEG_DIR)/libavcodec -L$(FFMPEG_DIR)/libavformat -L$(FFMPEG_DIR)/libavutil -L$(FFMPEG_DIR)/libavcore -L$(FFMPEG_DIR)/lib
108
CFLAGS += -pthread
109
LDFLAGS += -pthread
110
LDLIBS += -lavformat -lavcodec -lavutil
111
LDLIBS += $(call ld-option, -lavcore)
112
LDLIBS += -lm
113
LDLIBS += $(call ld-option, -lz)
114
LDLIBS += $(call ld-option, -lbz2)
115
LDLIBS += $(call ld-option, -lva)
116
ifdef X264_DIR
117
CPPFLAGS += -I$(X264_DIR) -I$(X264_DIR)/include
118
LDFLAGS += -L$(X264_DIR) -L$(X264_DIR)/lib
119
LDLIBS += -lx264
120
endif
121
endif
122
endif
123
ifeq ($(IO), chunkstream)
124
CFLAGS += -DIO_CHUNKSTREAM
125
CFLAGS += -DOUTPUT_REORDER=false
126
OBJS += input-chunkstream.o output-chunkstream.o
127
endif
128

    
129
EXECTARGET = streamer
130
ifdef ML
131
EXECTARGET := $(EXECTARGET)-ml
132
endif
133
ifdef MONL
134
EXECTARGET := $(EXECTARGET)-monl
135
endif
136
ifdef ALTO
137
EXECTARGET := $(EXECTARGET)-alto
138
endif
139
ifdef THREADS
140
EXECTARGET := $(EXECTARGET)-threads
141
endif
142
ifdef IO
143
EXECTARGET := $(EXECTARGET)-$(IO)
144
endif
145

    
146
ifeq ($(STATIC), 1)
147
EXECTARGET := $(EXECTARGET)-halfstatic
148
LDFLAGS += -Wl,-static
149
LDFLAGSPOST += -Wl,-Bdynamic
150
endif
151
ifeq ($(STATIC), 2)
152
EXECTARGET := $(EXECTARGET)-static
153
LDFLAGS += -static
154
endif
155

    
156
ifdef DEBUG
157
EXECTARGET := $(EXECTARGET)-debug
158
endif
159

    
160
ifdef RELEASE
161
EXECTARGET := $(EXECTARGET)-$(RELEASE)
162
endif
163

    
164
ifeq ($(HOSTARCH), mingw32)
165
LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
166
EXECTARGET := $(EXECTARGET).exe
167
else
168
LDLIBS += $(LIBRT)
169
endif
170

    
171
all: $(EXECTARGET)
172

    
173
ifndef ML
174
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
175
else
176
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
177
endif
178
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
179

    
180
$(EXECTARGET).o: streamer.o
181
	ln -sf streamer.o $(EXECTARGET).o
182

    
183
GRAPES:
184
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
185
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
186

    
187
ffmpeg:
188
	(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
189
	cd ffmpeg; ./configure
190

    
191
prepare: $(GRAPES) $(FFSRC)
192
	$(MAKE) -C $(GRAPES) -f Makefile
193
ifdef ML
194
	cd $(NAPA); ./autogen.sh; $(MAKE)
195
endif
196
	$(MAKE) -C $(FFSRC)
197

    
198
clean:
199
	rm -f streamer-*
200
	rm -f $(GRAPES)/src/net_helper-ml.o
201
	rm -f $(GRAPES)/src/net_helper.o
202
	rm -f *.o
203
	rm -f Chunkiser/*.o