Statistics
| Branch: | Revision:

streamers / Makefile @ f7c16b43

History | View | Annotate | Download (2.53 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 -L$(GRAPES)/dclog
33
LDLIBS += -lsom -lml -levent -ldclog -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

    
67
ifdef STATIC
68
LDFLAGS += -static
69
EXECTARGET := $(EXECTARGET)-static
70
endif
71

    
72
ifdef RELEASE
73
EXECTARGET := $(EXECTARGET)-$(RELEASE)
74
endif
75

    
76
all: $(EXECTARGET)
77

    
78
ifndef ML
79
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper.o
80
else
81
$(EXECTARGET): $(OBJS) $(GRAPES)/som/Tests/net_helper-ml.o $(GRAPES)/som/Tests/ml_helpers.o
82
endif
83

    
84
$(EXECTARGET).o: streamer.o
85
	ln -s streamer.o $(EXECTARGET).o
86

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

    
89
GRAPES:
90
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
91
	cd GRAPES; git checkout -b for-streamer-0.7.4 origin/for-streamer-0.7.4
92

    
93
ffmpeg:
94
	(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
95
	cd ffmpeg; ./configure
96

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

    
105
clean:
106
	rm -f $(EXECTARGET)
107
	rm -f *.o