Statistics
| Branch: | Revision:

streamers / Makefile @ 581339c4

History | View | Annotate | Download (2.91 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
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
ifdef DEBUGOUT
30
CPPFLAGS += -DDEBUGOUT
31
endif
32

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

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

    
66
ifdef MONL
67
OBJS += measures.o
68
endif
69

    
70
ifndef DUMMY
71
FFDIR ?= ffmpeg
72
FFSRC ?= $(FFDIR)
73
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
74
LDFLAGS += -L$(FFDIR)/libavcodec -L$(FFDIR)/libavformat -L$(FFDIR)/libavutil
75
LDLIBS += -lavformat -lavcodec -lavutil
76
LDLIBS += -lm
77
LDLIBS += $(call ld-option, -lz)
78
LDLIBS += $(call ld-option, -lbz2)
79
else
80
OBJS += input-stream-dummy.o out-stream-dummy.o
81
endif
82

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

    
94
ifdef STATIC
95
LDFLAGS += -static
96
EXECTARGET := $(EXECTARGET)-static
97
endif
98

    
99
ifdef RELEASE
100
EXECTARGET := $(EXECTARGET)-$(RELEASE)
101
endif
102

    
103
all: $(EXECTARGET)
104

    
105
ifndef ML
106
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper.o
107
else
108
$(EXECTARGET): $(OBJS) $(NAPA)/som/net_helper-ml.o
109
endif
110

    
111
$(EXECTARGET).o: streamer.o
112
	ln -sf streamer.o $(EXECTARGET).o
113

    
114
out-stream-avf.o Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFSRC) 
115

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

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

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

    
131
clean:
132
	rm -f $(EXECTARGET)
133
	rm -f $(NAPA)/som/net_helper-ml.o
134
	rm -f $(GRAPES)/som/net_helper.o
135
	rm -f *.o