Statistics
| Branch: | Revision:

streamers / Makefile @ 913146ae

History | View | Annotate | Download (3.08 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
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 += -lmon -lrep -ldclog -lcommon
43
CPPFLAGS += -DMONL
44
ifdef STATIC
45
CC=g++
46
else
47
LDLIBS_EXTRA = -lm -lstdc++
48
endif
49
endif
50
LDLIBS += -Wl,-static -levent $(if $(STATIC), , -Wl,-Bdynamic) -lrt
51
#LDLIBS += -levent -lrt
52
endif
53

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

    
70
ifdef MONL
71
OBJS += measures-monl.o
72
else
73
OBJS += measures.o
74
endif
75

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

    
88
LDLIBS += $(LDLIBS_EXTRA)
89

    
90
EXECTARGET = offerstreamer
91
ifdef ML
92
EXECTARGET := $(EXECTARGET)-ml
93
endif
94
ifdef MONL
95
EXECTARGET := $(EXECTARGET)-monl
96
endif
97
ifdef THREADS
98
EXECTARGET := $(EXECTARGET)-threads
99
endif
100

    
101
ifdef STATIC
102
LDFLAGS += -static -v
103
EXECTARGET := $(EXECTARGET)-static
104
endif
105

    
106
ifdef RELEASE
107
EXECTARGET := $(EXECTARGET)-$(RELEASE)
108
endif
109

    
110
all: $(EXECTARGET)
111

    
112
ifndef ML
113
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper.o
114
else
115
$(EXECTARGET): $(OBJS) $(GRAPES)/net_helper-ml.o
116
endif
117

    
118
$(EXECTARGET).o: streamer.o
119
	ln -sf streamer.o $(EXECTARGET).o
120

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

    
123
GRAPES:
124
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
125
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
126

    
127
ffmpeg:
128
	(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
129
	cd ffmpeg; ./configure
130

    
131
prepare: $(GRAPES) $(FFSRC)
132
	$(MAKE) -C $(GRAPES) -f Makefile
133
ifdef ML
134
	cd $(NAPA); ./autogen.sh; $(MAKE)
135
endif
136
	$(MAKE) -C $(FFSRC)
137

    
138
clean:
139
	rm -f $(EXECTARGET)
140
	rm -f $(GRAPES)/net_helper-ml.o
141
	rm -f $(GRAPES)/net_helper.o
142
	rm -f *.o
143
	rm -f Chunkiser/*.o