Statistics
| Branch: | Revision:

streamers / Makefile @ d0225f2c

History | View | Annotate | Download (4 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=g++
63
endif
64
endif
65
LDLIBS += -levent -lrt
66
endif
67

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

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

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

    
90
ifdef MONL
91
OBJS += measures-monl.o
92
else
93
OBJS += measures.o
94
endif
95

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

    
121
EXECTARGET = streamer
122
ifdef ML
123
EXECTARGET := $(EXECTARGET)-ml
124
endif
125
ifdef MONL
126
EXECTARGET := $(EXECTARGET)-monl
127
endif
128
ifdef ALTO
129
EXECTARGET := $(EXECTARGET)-alto
130
endif
131
ifdef THREADS
132
EXECTARGET := $(EXECTARGET)-threads
133
endif
134
ifdef IO
135
EXECTARGET := $(EXECTARGET)-$(IO)
136
endif
137

    
138
ifeq ($(STATIC), 1)
139
EXECTARGET := $(EXECTARGET)-halfstatic
140
LDFLAGS += -Wl,-static
141
LDFLAGSPOST += -Wl,-Bdynamic
142
endif
143
ifeq ($(STATIC), 2)
144
EXECTARGET := $(EXECTARGET)-static
145
LDFLAGS += -static
146
endif
147

    
148
ifdef DEBUG
149
EXECTARGET := $(EXECTARGET)-debug
150
endif
151

    
152
ifdef RELEASE
153
EXECTARGET := $(EXECTARGET)-$(RELEASE)
154
endif
155

    
156
all: $(EXECTARGET)
157

    
158
ifndef ML
159
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper.o $(EXECTARGET).o
160
else
161
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
162
endif
163
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
164

    
165
$(EXECTARGET).o: streamer.o
166
	ln -sf streamer.o $(EXECTARGET).o
167

    
168
GRAPES:
169
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
170
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
171

    
172
ffmpeg:
173
	(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
174
	cd ffmpeg; ./configure
175

    
176
prepare: $(GRAPES) $(FFSRC)
177
	$(MAKE) -C $(GRAPES) -f Makefile
178
ifdef ML
179
	cd $(NAPA); ./autogen.sh; $(MAKE)
180
endif
181
	$(MAKE) -C $(FFSRC)
182

    
183
clean:
184
	rm -f $(EXECTARGET)
185
	rm -f $(GRAPES)/src/net_helper-ml.o
186
	rm -f $(GRAPES)/src/net_helper.o
187
	rm -f *.o
188
	rm -f Chunkiser/*.o