Statistics
| Branch: | Revision:

streamers / Makefile @ c65c058e

History | View | Annotate | Download (4.29 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

    
26
CPPFLAGS += -Itransition
27
OBJS += transition/node_addr.o
28

    
29
ifdef GPROF
30
CFLAGS += -pg -O0
31
LDFLAGS += -pg
32
endif
33

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

    
40

    
41
ifdef DEBUGOUT
42
CPPFLAGS += -DDEBUGOUT
43
endif
44

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

    
71
OBJS += streaming.o
72
OBJS += net_helpers.o 
73

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

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

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

    
101
IO ?= grapes
102
ifeq ($(IO), grapes)
103
CFLAGS += -DIO_GRAPES
104
OBJS += input-grapes.o output-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
OBJS += input-chunkstream.o output-chunkstream.o
126
endif
127

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

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

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

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

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

    
170
all: $(EXECTARGET)
171

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

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

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

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

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

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