Statistics
| Branch: | Revision:

chunker-player / chunker_player / Makefile @ 76c297b4

History | View | Annotate | Download (4.13 KB)

1
include ../common.mak
2

    
3
ifdef WINDOWS
4
OUTPUTFILE = chunker_player.exe
5
#LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
6
else
7
OUTPUTFILE = chunker_player
8
endif
9

    
10
ifeq ($(IO), httpevent)
11
#TODO add: or equals httpmhd
12
CPPFLAGS += -DHTTPIO
13
endif
14

    
15
ifeq ($(IO), tcp)
16
CPPFLAGS += -DTCPIO
17
ifdef WINDOWS
18
CPPFLAGS += -I$(LOCAL_PTHREAD)/include
19
LDLIBS += $(LOCAL_PTHREAD)/lib/libpthread.a
20
endif
21
endif
22

    
23
#SDL config here
24
LOCAL_SDL_CPPFLAGS = -I$(LOCAL_ABS_SDL)/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
25
ifdef MAC_OS
26
#force static linking to .a SDL libraries
27
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
28
else
29
LOCAL_SDL_LDFLAGS = -L$(LOCAL_ABS_SDL)/lib  
30
endif
31
ifndef WINDOWS
32
ifdef MAC_OS
33
LOCAL_SDL_LDLIBS =
34
else
35
LOCAL_SDL_LDLIBS = $(LOCAL_ABS_SDL)/lib/libSDL.a  -ldl $(LOCAL_ABS_SDL)/lib/libSDLmain.a
36
endif
37
endif
38

    
39
LOCAL_SDLIMAGE_CPPFLAGS = -I$(LOCAL_SDLIMAGE)/include/SDL
40
ifdef WINDOWS
41
LOCAL_SDLIMAGE_LDLIBS = $(LOCAL_SDLIMAGE)/lib/libSDL_image.a $(LOCAL_LIBPNG)/lib/libpng.a $(LOCAL_LIBINTL)/lib/libintl.*.a $(LOCAL_LIBICONV)/lib/libiconv.a
42
else
43
LOCAL_SDLIMAGE_LDLIBS = $(LOCAL_SDLIMAGE)/lib/libSDL_image.a $(LOCAL_LIBPNG)/lib/libpng.a
44
endif
45

    
46
LOCAL_FREETYPE_CPPFLAGS = -I$(LOCAL_FREETYPE)/include/ -I$(LOCAL_FREETYPE)/include/freetype2
47
LOCAL_FREETYPE_LDFLAGS = -Wl,-rpath -Wl,$(LOCAL_FREETYPE)/lib
48
#LOCAL_FREETYPE_LDFLAGS = -Wl,$(LOCAL_FREETYPE)/lib
49
LOCAL_FREETYPE_LDLIBS = $(LOCAL_FREETYPE)/lib/libfreetype.a
50

    
51
LOCAL_SDLTTF_CPPFLAGS = -I$(LOCAL_SDLTTF)/include/SDL
52
LOCAL_SDLTTF_LDLIBS = $(LOCAL_SDLTTF)/lib/libSDL_ttf.a
53

    
54
#microhttpd config here
55
LOCAL_MHD_CPPFLAGS = -I$(LOCAL_MHD)/include
56
ifdef WINDOWS
57
LOCAL_MHD_LDLIBS = $(LOCAL_MHD)/lib/libmicrohttpd.a $(LOCAL_PLIBC)/lib/libplibc.dll.a $(LOCAL_PTHREAD)/lib/libpthread.a
58
else
59
LOCAL_MHD_LDLIBS = $(LOCAL_MHD)/lib/libmicrohttpd.a
60
endif
61

    
62
LOCAL_CONFUSE_CPPFLAGS = -I$(LOCAL_CONFUSE)/include
63
LOCAL_CONFUSE_LDLIBS = $(LOCAL_CONFUSE)/lib/libconfuse.a
64

    
65
ifdef PSNR_PUBLICATION
66
CPPFLAGS += -DPSNR_PUBLICATION
67
LOCAL_PSNR_CPPFLAGS = -I$(LIBEVENT_DIR)/include -I$(NAPA)/include
68
LOCAL_PSNR_LDLIBS = $(NAPA)/rep/librep.a $(NAPA)/dclog/libdclog.a $(NAPA)/common/libcommon.a $(NAPA)/ml/libml.a $(LIBEVENT_DIR)/lib/libevent.a
69
endif
70

    
71
#endif
72

    
73
#put them in the correct order
74
CPPFLAGS += $(LOCAL_SDLTTF_CPPFLAGS) $(LOCAL_SDLIMAGE_CPPFLAGS) $(LOCAL_SDL_CPPFLAGS)
75
CPPFLAGS += $(LOCAL_MHD_CPPFLAGS) $(LOCAL_CONFUSE_CPPFLAGS) $(LOCAL_FREETYPE_CPPFLAGS)
76
CPPFLAGS += $(LOCAL_FFMPEG_CPPFLAGS) $(LOCAL_COMMON_CPPFLAGS)
77
CPPFLAGS += $(LOCAL_PSNR_CPPFLAGS)
78

    
79
LDFLAGS += $(LOCAL_SDLTTF_LDFLAGS) $(LOCAL_SDLIMAGE_LDFLAGS) $(LOCAL_SDL_LDFLAGS)
80
LDFLAGS += $(LOCAL_MHD_LDFLAGS) $(LOCAL_CONFUSE_LDFLAGS) $(LOCAL_FREETYPE_LDFLAGS)
81
LDFLAGS += $(LOCAL_FFMPEG_LDFLAGS) $(LOCAL_COMMON_LDFLAGS)
82

    
83
LDLIBS += $(LOCAL_SDLTTF_LDLIBS) $(LOCAL_SDLIMAGE_LDLIBS) $(LOCAL_SDL_LDLIBS)
84
LDLIBS += $(LOCAL_MHD_LDLIBS) $(LOCAL_CONFUSE_LDLIBS) $(LOCAL_FREETYPE_LDLIBS)
85
LDLIBS += $(LOCAL_FFMPEG_LDLIBS) $(LOCAL_COMMON_LDLIBS)
86
LDLIBS += $(LOCAL_PSNR_LDLIBS)
87

    
88
ifdef LOCAL_CURL
89
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a
90
endif
91

    
92
ifdef WINDOWS
93
LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
94
LDLIBS += $(DYNAMIC_LDLIBS) -lmingw32 $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.a -lwinmm -lgdi32
95
else
96
LDLIBS += $(DYNAMIC_LDLIBS)
97
LDLIBS += $(call ld-option, -lrt)
98
endif
99

    
100
LINKER = $(CC)
101

    
102
all: $(OUTPUTFILE)
103

    
104
OBJS = ../chunk_transcoding/external_chunk_transcoding.o
105
ifeq ($(IO), httpevent)
106
#TODO add: or equals httpmhd
107
OBJS += http_chunk_puller.o
108
endif
109

    
110
ifeq ($(IO), tcp)
111
OBJS += tcp_chunk_puller.o
112
endif
113
OBJS += chunker_player.o QoE_Estimator.o player_stats.o player_core.o player_gui.o
114

    
115
ifdef LOCAL_CURL
116
CPPFLAGS += -I$(LOCAL_CURL)/include
117
OBJS += http.o
118
CPPFLAGS += -DCHANNELS_DOWNLOAD
119
CFLAGS += -DCURL_STATICLIB	#required by MinGW; based on http://curl.haxx.se/docs/faq.html#Link_errors_when_building_libcur
120
endif
121

    
122
$(OUTPUTFILE): $(OBJS)
123
	$(LINKER) $(LDFLAGS) $^ $(LDLIBS) -o $@
124

    
125
clean:
126
	rm -f $(OUTPUTFILE)
127
	rm -f *.o
128

    
129
### Automatic generation of headers dependencies ###
130
%.d: %.c
131
	$(CC) $(CPPFLAGS) -MM -MF $@ $<
132

    
133
%.o: %.d
134

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