Statistics
| Branch: | Revision:

streamers / Makefile @ e816f3de

History | View | Annotate | Download (4.33 KB)

1 ecf6e64a Luca Abeni
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 c3b092a0 CsabaKiraly
LINKER = $(CC)
18 d2c7b084 MarcoBiazzini
STATIC ?= 0
19 c3b092a0 CsabaKiraly
20 89adc95a ArpadBakay
NAPA ?= ../../NAPA-BASELIBS
21
GRAPES ?= ../../GRAPES
22 89e893e2 Luca
23 a537d172 Csaba Kiraly
CPPFLAGS = -I$(NAPA)/include
24
CPPFLAGS += -I$(GRAPES)/include
25 7c933932 Csaba Kiraly
CPPFLAGS += -Itransition
26 89e893e2 Luca
27 a5a8f021 CsabaKiraly
ifdef GPROF
28 71b13457 Csaba Kiraly
CFLAGS += -pg -O0
29 a5a8f021 CsabaKiraly
LDFLAGS += -pg
30
endif
31
32 e64fc7e5 Luca
ifdef DEBUG
33 130de9fe Csaba Kiraly
CFLAGS += -O0
34 e64fc7e5 Luca
CPPFLAGS += -DDEBUG
35
endif
36 d8e83543 Csaba Kiraly
OBJS += dbg.o
37 e64fc7e5 Luca
38 89adc95a ArpadBakay
39 bb95b0c9 Csaba Kiraly
ifdef DEBUGOUT
40
CPPFLAGS += -DDEBUGOUT
41
endif
42
43 d6e5cee8 CsabaKiraly
LDFLAGS += -L$(GRAPES)/src
44 a537d172 Csaba Kiraly
LDLIBS += -lgrapes
45 b27e5c1b MarcoBiazzini
ifdef ALTO
46
LDFLAGS += -L$(NAPA)/ALTOclient
47 4815b48c CsabaKiraly
LDFLAGS += -L$(LIBXML2_DIR)/lib
48 b27e5c1b MarcoBiazzini
LDLIBS += -lALTO -lxml2
49 ea5857ec CsabaKiraly
CFLAGS += -pthread
50
LDFLAGS += -pthread
51 487fe1b5 CsabaKiraly
LDLIBS += $(call ld-option, -lz)
52 b27e5c1b MarcoBiazzini
endif
53 bb95b0c9 Csaba Kiraly
ifdef ML
54 89adc95a ArpadBakay
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
55 74a5d4ae CsabaKiraly
LDLIBS += -lml -lm
56 a2d8e810 ArpadBakay
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
57 a874d5ac Csaba Kiraly
ifdef MONL
58 a537d172 Csaba Kiraly
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
59 74a5d4ae CsabaKiraly
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
60 a874d5ac Csaba Kiraly
CPPFLAGS += -DMONL
61 d2c7b084 MarcoBiazzini
ifneq ($(STATIC), 0)
62 0974fe72 Csaba Kiraly
LINKER=$(CXX)
63 f5783ec4 Csaba Kiraly
endif
64 a874d5ac Csaba Kiraly
endif
65 eced9acf Csaba Kiraly
LDLIBS += -levent
66
LDLIBS += $(call ld-option, -lrt)
67 bb95b0c9 Csaba Kiraly
endif
68 89e893e2 Luca
69 b58cb76a Csaba Kiraly
OBJS += streaming.o
70 8e14c74c Csaba Kiraly
OBJS += net_helpers.o 
71 b27e5c1b MarcoBiazzini
72
ifdef ALTO
73
OBJS += topology-ALTO.o
74
OBJS += config.o
75
else
76 16ae4927 Csaba Kiraly
OBJS += topology.o nodeid_set.o
77 b27e5c1b MarcoBiazzini
endif
78
79 7d624a77 Csaba Kiraly
OBJS += chunk_signaling.o
80 5bc2469e Csaba Kiraly
OBJS += chunklock.o
81 84ec8c3a Csaba Kiraly
OBJS += transaction.o
82 9f7f21a6 Csaba Kiraly
OBJS += ratecontrol.o
83 581339c4 Csaba Kiraly
OBJS += channel.o
84 d92a24a6 Luca Abeni
ifdef THREADS
85 85e3443f GiuseppeTropea
CPPFLAGS += -DTHREADS
86 d92a24a6 Luca Abeni
OBJS += loop-mt.o
87
CFLAGS += -pthread
88
LDFLAGS += -pthread
89
else
90
OBJS += loop.o
91
endif
92
93 a874d5ac Csaba Kiraly
ifdef MONL
94 9c4f8e7e Csaba Kiraly
OBJS += measures-monl.o
95 473a00b3 Csaba Kiraly
else
96
OBJS += measures.o
97 a874d5ac Csaba Kiraly
endif
98
99 e816f3de CsabaKiraly
OBJS += output-grapes.o
100 feaa6e2c Luca Abeni
IO ?= grapes
101 327fc1a6 Luca Abeni
ifeq ($(IO), grapes)
102 af9d9248 Csaba Kiraly
CFLAGS += -DIO_GRAPES
103 e816f3de CsabaKiraly
CFLAGS += -DOUTPUT_REORDER=true
104
OBJS += input-grapes.o
105 23748bc9 Luca Abeni
ifdef FFMPEG_DIR
106 327fc1a6 Luca Abeni
CPPFLAGS += -I$(FFMPEG_DIR)
107 1494311a Csaba Kiraly
LDFLAGS += -L$(FFMPEG_DIR)/libavcodec -L$(FFMPEG_DIR)/libavformat -L$(FFMPEG_DIR)/libavutil -L$(FFMPEG_DIR)/libavcore -L$(FFMPEG_DIR)/lib
108 327fc1a6 Luca Abeni
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 3fcca057 Csaba Kiraly
LDLIBS += $(call ld-option, -lva)
116 b3cd616d Csaba Kiraly
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 327fc1a6 Luca Abeni
endif
122 23748bc9 Luca Abeni
endif
123 d0225f2c Csaba Kiraly
ifeq ($(IO), chunkstream)
124 af9d9248 Csaba Kiraly
CFLAGS += -DIO_CHUNKSTREAM
125 e816f3de CsabaKiraly
CFLAGS += -DOUTPUT_REORDER=false
126 d0225f2c Csaba Kiraly
OBJS += input-chunkstream.o output-chunkstream.o
127
endif
128 89e893e2 Luca
129 cbd3919d Csaba Kiraly
EXECTARGET = streamer
130 bb95b0c9 Csaba Kiraly
ifdef ML
131
EXECTARGET := $(EXECTARGET)-ml
132
endif
133 18b3d383 Csaba Kiraly
ifdef MONL
134
EXECTARGET := $(EXECTARGET)-monl
135
endif
136 b27e5c1b MarcoBiazzini
ifdef ALTO
137
EXECTARGET := $(EXECTARGET)-alto
138
endif
139 6bcb761d Csaba Kiraly
ifdef THREADS
140
EXECTARGET := $(EXECTARGET)-threads
141
endif
142 6d85fd9d CsabaKiraly
ifdef IO
143
EXECTARGET := $(EXECTARGET)-$(IO)
144 03dca3bf ArpadBakay
endif
145 89e893e2 Luca
146 d2c7b084 MarcoBiazzini
ifeq ($(STATIC), 1)
147
EXECTARGET := $(EXECTARGET)-halfstatic
148
LDFLAGS += -Wl,-static
149
LDFLAGSPOST += -Wl,-Bdynamic
150
endif
151
ifeq ($(STATIC), 2)
152 ae7b251e Csaba Kiraly
EXECTARGET := $(EXECTARGET)-static
153 d2c7b084 MarcoBiazzini
LDFLAGS += -static
154 ae7b251e Csaba Kiraly
endif
155
156 c7a8be3d CsabaKiraly
ifdef DEBUG
157
EXECTARGET := $(EXECTARGET)-debug
158
endif
159
160 b36d3310 Csaba Kiraly
ifdef RELEASE
161
EXECTARGET := $(EXECTARGET)-$(RELEASE)
162
endif
163
164 3e5b40f5 Csaba Kiraly
ifeq ($(HOSTARCH), mingw32)
165
LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
166
EXECTARGET := $(EXECTARGET).exe
167
else
168
LDLIBS += $(LIBRT)
169
endif
170
171 6dcf5ec0 Csaba Kiraly
all: $(EXECTARGET)
172 89e893e2 Luca
173 bb95b0c9 Csaba Kiraly
ifndef ML
174 d6e5cee8 CsabaKiraly
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
175 bb95b0c9 Csaba Kiraly
else
176 d6e5cee8 CsabaKiraly
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
177 bb95b0c9 Csaba Kiraly
endif
178 d2c7b084 MarcoBiazzini
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
179 89e893e2 Luca
180 f211f409 Csaba Kiraly
$(EXECTARGET).o: streamer.o
181 984f5a9b Csaba Kiraly
	ln -sf streamer.o $(EXECTARGET).o
182 89e893e2 Luca
183 42ae36af Luca Abeni
GRAPES:
184 aefc7450 Csaba Kiraly
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
185 d67ef29a Csaba Kiraly
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
186 42ae36af Luca Abeni
187 63b2e58c Luca Abeni
ffmpeg:
188 8f8bd3b6 Csaba Kiraly
	(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 63b2e58c Luca Abeni
	cd ffmpeg; ./configure
190
191
prepare: $(GRAPES) $(FFSRC)
192 0e66f272 Csaba Kiraly
	$(MAKE) -C $(GRAPES) -f Makefile
193 a537d172 Csaba Kiraly
ifdef ML
194
	cd $(NAPA); ./autogen.sh; $(MAKE)
195 0573c5f4 Csaba Kiraly
endif
196 63b2e58c Luca Abeni
	$(MAKE) -C $(FFSRC)
197 42ae36af Luca Abeni
198 89e893e2 Luca
clean:
199 7491be48 GiuseppeTropea
	rm -f streamer-*
200 d6e5cee8 CsabaKiraly
	rm -f $(GRAPES)/src/net_helper-ml.o
201
	rm -f $(GRAPES)/src/net_helper.o
202 89e893e2 Luca
	rm -f *.o
203 0e7105fe Csaba Kiraly
	rm -f Chunkiser/*.o