Statistics
| Branch: | Revision:

streamers / Makefile @ a2d8e810

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

    
20
CPPFLAGS = -I$(NAPA)/include
21
CPPFLAGS += -I$(GRAPES)/include
22

    
23
ifdef DEBUG
24
CFLAGS += -O0
25
CPPFLAGS += -DDEBUG
26
OBJS += dbg.o
27
endif
28

    
29

    
30
ifdef DEBUGOUT
31
CPPFLAGS += -DDEBUGOUT
32
endif
33

    
34
LDFLAGS += -L$(GRAPES)
35
LDLIBS += -lgrapes
36
ifdef ML
37
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT_DIR)/lib
38
LDLIBS += -lml -lm
39
CPPFLAGS += -I$(NAPA)/ml/include -I$(LIBEVENT_DIR)/include
40
ifdef MONL
41
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
42
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
43
CPPFLAGS += -DMONL
44
ifdef STATIC
45
CC=g++
46
endif
47
endif
48
LDLIBS += -levent -lrt
49
endif
50

    
51
OBJS += streaming.o
52
OBJS += input.o
53
OBJS += output.o 
54
OBJS += net_helpers.o 
55
OBJS += topology.o
56
OBJS += chunk_signaling.o
57
OBJS += chunklock.o
58
OBJS += channel.o
59
ifdef THREADS
60
OBJS += loop-mt.o
61
CFLAGS += -pthread
62
LDFLAGS += -pthread
63
else
64
OBJS += loop.o
65
endif
66

    
67
ifdef MONL
68
OBJS += measures-monl.o
69
else
70
OBJS += measures.o
71
endif
72

    
73
ifndef DUMMY
74
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
75
CPPFLAGS += -I$(FFMPEG_DIR)/include
76
LDFLAGS += -L$(FFMPEG_DIR)/lib
77
LDLIBS += -lavformat -lavcodec -lavutil
78
LDLIBS += -lm
79
LDLIBS += $(call ld-option, -lz)
80
LDLIBS += $(call ld-option, -lbz2)
81
else
82
OBJS += input-stream-dummy.o out-stream-dummy.o
83
endif
84

    
85
EXECTARGET = offerstreamer
86
ifdef ML
87
EXECTARGET := $(EXECTARGET)-ml
88
endif
89
ifdef MONL
90
EXECTARGET := $(EXECTARGET)-monl
91
endif
92
ifdef THREADS
93
EXECTARGET := $(EXECTARGET)-threads
94
endif
95

    
96
ifdef STATIC
97
LDFLAGS += -static -v
98
EXECTARGET := $(EXECTARGET)-static
99
endif
100

    
101
ifdef RELEASE
102
EXECTARGET := $(EXECTARGET)-$(RELEASE)
103
endif
104

    
105
all: $(EXECTARGET)
106

    
107
ifndef ML
108
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper.o
109
else
110
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper-ml.o
111
endif
112

    
113
$(EXECTARGET).o: streamer.o
114
	ln -sf streamer.o $(EXECTARGET).o
115

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

    
118
GRAPES:
119
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
120
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
121

    
122
ffmpeg:
123
	(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
124
	cd ffmpeg; ./configure
125

    
126
prepare: $(GRAPES) $(FFSRC)
127
	$(MAKE) -C $(GRAPES) -f Makefile
128
ifdef ML
129
	cd $(NAPA); ./autogen.sh; $(MAKE)
130
endif
131
	$(MAKE) -C $(FFSRC)
132

    
133
clean:
134
	rm -f $(EXECTARGET)
135
	rm -f $(GRAPES)/net_helper-ml.o
136
	rm -f $(GRAPES)/net_helper.o
137
	rm -f *.o
138
	rm -f Chunkiser/*.o