Statistics
| Branch: | Revision:

streamers / Makefile @ 1435546b

History | View | Annotate | Download (2.58 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
GRAPES ?= GRAPES
18

    
19
CPPFLAGS = -I$(GRAPES)/include
20
CPPFLAGS += -I$(GRAPES)/som
21

    
22
ifdef DEBUG
23
CFLAGS += -O0
24
CPPFLAGS += -DDEBUG
25
endif
26

    
27
ifdef DEBUGOUT
28
CPPFLAGS += -DDEBUGOUT
29
endif
30

    
31
ifdef ML
32
LDFLAGS += -L$(GRAPES)/som -L$(GRAPES)/ml -L$(LIBEVENT)/lib
33
LDLIBS += -lsom -lml -levent -lm
34
CPPFLAGS += -I$(LIBEVENT)/include
35
else
36
LDFLAGS = -L$(GRAPES)/som/TopologyManager -L$(GRAPES)/som/ChunkTrading -L$(GRAPES)/som/ChunkBuffer
37
LDLIBS = -ltrading -lcb -ltopman
38
endif
39

    
40
OBJS = streaming.o 
41
OBJS += input.o
42
OBJS += output.o 
43
OBJS += net_helpers.o 
44
ifdef THREADS
45
OBJS += loop-mt.o
46
CFLAGS += -pthread
47
LDFLAGS += -pthread
48
else
49
OBJS += loop.o
50
endif
51

    
52
ifndef DUMMY
53
FFDIR ?= ffmpeg
54
FFSRC ?= $(FFDIR)
55
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
56
LDFLAGS += -L$(FFDIR)/libavcodec -L$(FFDIR)/libavformat -L$(FFDIR)/libavutil
57
LDLIBS += -lavformat -lavcodec -lavutil
58
LDLIBS += -lm
59
LDLIBS += $(call ld-option, -lz)
60
LDLIBS += $(call ld-option, -lbz2)
61
else
62
OBJS += input-stream-dummy.o out-stream-dummy.o
63
endif
64

    
65
EXECTARGET = dumbstreamer
66
ifdef ML
67
EXECTARGET := $(EXECTARGET)-ml
68
endif
69
ifdef THREADS
70
EXECTARGET := $(EXECTARGET)-threads
71
endif
72

    
73
ifdef STATIC
74
LDFLAGS += -static
75
EXECTARGET := $(EXECTARGET)-static
76
endif
77

    
78
ifdef RELEASE
79
EXECTARGET := $(EXECTARGET)-$(RELEASE)
80
endif
81

    
82
all: $(EXECTARGET)
83

    
84
ifndef ML
85
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper.o
86
else
87
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper-ml.o
88
endif
89

    
90
$(EXECTARGET).o: streamer.o
91
	ln -sf streamer.o $(EXECTARGET).o
92

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

    
95
GRAPES:
96
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
97
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3
98

    
99
ffmpeg:
100
	(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
101
	cd ffmpeg; ./configure
102

    
103
prepare: $(GRAPES) $(FFSRC)
104
ifndef ML
105
	$(MAKE) -C $(GRAPES)/som -f Makefile.som
106
else
107
	cd $(GRAPES); ./autogen.sh; $(MAKE)
108
endif
109
	$(MAKE) -C $(FFSRC)
110

    
111
clean:
112
	rm -f $(EXECTARGET)
113
	rm -f *.o