Statistics
| Branch: | Revision:

chunker-player / chunker_player / Makefile @ a4ea896a

History | View | Annotate | Download (4.22 KB)

1
include ../common.mak
2

    
3
ifdef MAC_OS
4
CPPFLAGS += -DMAC_OS
5
endif
6

    
7
ifdef WINDOWS
8
OUTPUTFILE = chunker_player.exe
9
#LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
10
else
11
OUTPUTFILE = chunker_player
12
endif
13

    
14
ifeq ($(IO), httpevent)
15
#TODO add: or equals httpmhd
16
CPPFLAGS += -DHTTPIO
17
endif
18

    
19
ifeq ($(IO), tcp)
20
CPPFLAGS += -DTCPIO
21
ifdef WINDOWS
22
CPPFLAGS += -I$(LOCAL_PTHREAD)/include
23
LDLIBS += $(LOCAL_PTHREAD)/lib/libpthread.a
24
endif
25
endif
26

    
27
#SDL config here
28
LOCAL_SDL_CPPFLAGS = -I$(LOCAL_ABS_SDL)/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
29
ifdef MAC_OS
30
#force static linking to .a SDL libraries
31
LOCAL_SDL_LDFLAGS =  -framework OpenGL $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.a  -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit
32
else
33
LOCAL_SDL_LDFLAGS = -L$(LOCAL_ABS_SDL)/lib  
34
endif
35
ifndef WINDOWS
36
ifdef MAC_OS
37
LOCAL_SDL_LDLIBS =
38
else
39
LOCAL_SDL_LDLIBS = $(LOCAL_ABS_SDL)/lib/libSDL.a  -ldl $(LOCAL_ABS_SDL)/lib/libSDLmain.a
40
endif
41
endif
42

    
43
LOCAL_SDLIMAGE_CPPFLAGS = -I$(LOCAL_SDLIMAGE)/include/SDL
44
ifdef WINDOWS
45
LOCAL_SDLIMAGE_LDLIBS = $(LOCAL_SDLIMAGE)/lib/libSDL_image.a $(LOCAL_LIBPNG)/lib/libpng.a $(LOCAL_LIBINTL)/lib/libintl.*.a $(LOCAL_LIBICONV)/lib/libiconv.a
46
else
47
LOCAL_SDLIMAGE_LDLIBS = $(LOCAL_SDLIMAGE)/lib/libSDL_image.a $(LOCAL_LIBPNG)/lib/libpng.a
48
endif
49

    
50
LOCAL_FREETYPE_CPPFLAGS = -I$(LOCAL_FREETYPE)/include/ -I$(LOCAL_FREETYPE)/include/freetype2
51
LOCAL_FREETYPE_LDFLAGS = -Wl,-rpath -Wl,$(LOCAL_FREETYPE)/lib
52
#LOCAL_FREETYPE_LDFLAGS = -Wl,$(LOCAL_FREETYPE)/lib
53
LOCAL_FREETYPE_LDLIBS = $(LOCAL_FREETYPE)/lib/libfreetype.a
54

    
55
LOCAL_SDLTTF_CPPFLAGS = -I$(LOCAL_SDLTTF)/include/SDL
56
LOCAL_SDLTTF_LDLIBS = $(LOCAL_SDLTTF)/lib/libSDL_ttf.a
57

    
58
#microhttpd config here
59
ifdef MHD
60
LOCAL_MHD_CPPFLAGS = -I$(LOCAL_MHD)/include
61
ifdef WINDOWS
62
LOCAL_MHD_LDLIBS = $(LOCAL_MHD)/lib/libmicrohttpd.a $(LOCAL_PLIBC)/lib/libplibc.dll.a $(LOCAL_PTHREAD)/lib/libpthread.a
63
else
64
LOCAL_MHD_LDLIBS = $(LOCAL_MHD)/lib/libmicrohttpd.a
65
endif
66
endif
67

    
68
LOCAL_CONFUSE_CPPFLAGS = -I$(LOCAL_CONFUSE)/include
69
LOCAL_CONFUSE_LDLIBS = $(LOCAL_CONFUSE)/lib/libconfuse.a
70

    
71
ifdef PSNR_PUBLICATION
72
CPPFLAGS += -DPSNR_PUBLICATION
73
LOCAL_PSNR_CPPFLAGS = -I$(LIBEVENT_DIR)/include -I$(NAPA)/include
74
LOCAL_PSNR_LDLIBS = $(NAPA)/rep/librep.a $(NAPA)/dclog/libdclog.a $(NAPA)/common/libcommon.a $(NAPA)/ml/libml.a $(LIBEVENT_DIR)/lib/libevent.a
75
endif
76

    
77
#endif
78

    
79
#put them in the correct order
80
CPPFLAGS += $(LOCAL_SDLTTF_CPPFLAGS) $(LOCAL_SDLIMAGE_CPPFLAGS) $(LOCAL_SDL_CPPFLAGS)
81
CPPFLAGS += $(LOCAL_MHD_CPPFLAGS) $(LOCAL_CONFUSE_CPPFLAGS) $(LOCAL_FREETYPE_CPPFLAGS)
82
CPPFLAGS += $(LOCAL_FFMPEG_CPPFLAGS) $(LOCAL_COMMON_CPPFLAGS)
83
CPPFLAGS += $(LOCAL_PSNR_CPPFLAGS)
84

    
85
LDFLAGS += $(LOCAL_SDLTTF_LDFLAGS) $(LOCAL_SDLIMAGE_LDFLAGS) $(LOCAL_SDL_LDFLAGS)
86
LDFLAGS += $(LOCAL_MHD_LDFLAGS) $(LOCAL_CONFUSE_LDFLAGS) $(LOCAL_FREETYPE_LDFLAGS)
87
LDFLAGS += $(LOCAL_FFMPEG_LDFLAGS) $(LOCAL_COMMON_LDFLAGS)
88

    
89
LDLIBS += $(LOCAL_SDLTTF_LDLIBS) $(LOCAL_SDLIMAGE_LDLIBS) $(LOCAL_SDL_LDLIBS)
90
LDLIBS += $(LOCAL_MHD_LDLIBS) $(LOCAL_CONFUSE_LDLIBS) $(LOCAL_FREETYPE_LDLIBS)
91
LDLIBS += $(LOCAL_FFMPEG_LDLIBS) $(LOCAL_COMMON_LDLIBS)
92
LDLIBS += $(LOCAL_PSNR_LDLIBS)
93

    
94
ifdef LOCAL_CURL
95
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a
96
endif
97

    
98
ifdef WINDOWS
99
LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
100
LDLIBS += $(DYNAMIC_LDLIBS) -lmingw32 $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.a -lwinmm -lgdi32
101
else
102
LDLIBS += $(DYNAMIC_LDLIBS)
103
LDLIBS += $(call ld-option, -lrt)
104
LDLIBS += $(call ld-option, -lX11)
105
endif
106

    
107
LINKER = $(CC)
108

    
109
all: $(OUTPUTFILE)
110

    
111
OBJS = ../chunk_transcoding/external_chunk_transcoding.o
112
ifeq ($(IO), httpevent)
113
#TODO add: or equals httpmhd
114
OBJS += http_chunk_puller.o
115
endif
116

    
117
ifeq ($(IO), tcp)
118
OBJS += tcp_chunk_puller.o
119
endif
120
OBJS += chunker_player.o QoE_Estimator.o player_stats.o player_core.o player_gui.o
121

    
122
ifdef LOCAL_CURL
123
CPPFLAGS += -I$(LOCAL_CURL)/include
124
OBJS += http.o
125
CPPFLAGS += -DCHANNELS_DOWNLOAD
126
CFLAGS += -DCURL_STATICLIB	#required by MinGW; based on http://curl.haxx.se/docs/faq.html#Link_errors_when_building_libcur
127
endif
128

    
129
$(OUTPUTFILE): $(OBJS)
130
	$(LINKER) $(LDFLAGS) $^ $(LDLIBS) -o $@
131

    
132
clean:
133
	rm -f $(OUTPUTFILE)
134
	rm -f *.o
135

    
136
### Automatic generation of headers dependencies ###
137
%.d: %.c
138
	$(CC) $(CPPFLAGS) -MM -MF $@ $<
139

    
140
%.o: %.d
141

    
142
-include $(OBJS:.o=.d)