Statistics
| Branch: | Revision:

streamers / Makefile @ 6bcb761d

History | View | Annotate | Download (2.56 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 output.o net_helpers.o input.o out-stream.o
41
ifdef THREADS
42
OBJS += loop-mt.o
43
CFLAGS += -pthread
44
LDFLAGS += -pthread
45
else
46
OBJS += loop.o
47
endif
48

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

    
62
EXECTARGET = dumbstreamer
63
ifdef ML
64
EXECTARGET := $(EXECTARGET)-ml
65
endif
66
ifdef THREADS
67
EXECTARGET := $(EXECTARGET)-threads
68
endif
69

    
70
ifdef STATIC
71
LDFLAGS += -static
72
EXECTARGET := $(EXECTARGET)-static
73
endif
74

    
75
ifdef RELEASE
76
EXECTARGET := $(EXECTARGET)-$(RELEASE)
77
endif
78

    
79
all: $(EXECTARGET)
80

    
81
ifndef ML
82
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper.o
83
else
84
$(EXECTARGET): $(OBJS) $(GRAPES)/som/Tests/net_helper-ml.o $(GRAPES)/som/Tests/ml_helpers.o
85
endif
86

    
87
$(EXECTARGET).o: streamer.o
88
	ln -sf streamer.o $(EXECTARGET).o
89

    
90
Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFSRC) 
91

    
92
GRAPES:
93
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
94
	cd GRAPES; git checkout -b for-streamer-0.7.6 origin/for-streamer-0.7.6
95

    
96
ffmpeg:
97
	(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
98
	cd ffmpeg; ./configure
99

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

    
108
clean:
109
	rm -f $(EXECTARGET)
110
	rm -f *.o