Statistics
| Branch: | Revision:

chunker-player / chunker_player / Makefile @ 47943338

History | View | Annotate | Download (3.62 KB)

1
include ../common.mak
2

    
3
ifdef WINDOWS
4
OUTPUTFILE = chunker_player.exe
5
else
6
OUTPUTFILE = chunker_player
7
endif
8

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

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

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

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

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

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

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

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

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

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

    
76
LDFLAGS += $(LOCAL_SDLTTF_LDFLAGS) $(LOCAL_SDLIMAGE_LDFLAGS) $(LOCAL_SDL_LDFLAGS)
77
LDFLAGS += $(LOCAL_MHD_LDFLAGS) $(LOCAL_CONFUSE_LDFLAGS) $(LOCAL_FREETYPE_LDFLAGS)
78
LDFLAGS += $(LOCAL_FFMPEG_LDFLAGS) $(LOCAL_COMMON_LDFLAGS)
79

    
80
LDLIBS += $(LOCAL_SDLTTF_LDLIBS) $(LOCAL_SDLIMAGE_LDLIBS) $(LOCAL_SDL_LDLIBS)
81
LDLIBS += $(LOCAL_MHD_LDLIBS) $(LOCAL_CONFUSE_LDLIBS) $(LOCAL_FREETYPE_LDLIBS)
82
LDLIBS += $(LOCAL_FFMPEG_LDLIBS) $(LOCAL_COMMON_LDLIBS)
83
LDLIBS += $(LOCAL_PSNR_LDLIBS)
84

    
85
ifdef WINDOWS
86
LDLIBS += $(DYNAMIC_LDLIBS) -lmingw32 $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.a -lwinmm -lgdi32
87
else
88
LDLIBS += $(DYNAMIC_LDLIBS)
89
LDLIBS += $(call ld-option, -lrt)
90
endif
91

    
92
LINKER = $(CC)
93

    
94
all: $(OUTPUTFILE)
95

    
96
OBJS = ../chunk_transcoding/external_chunk_transcoding.o
97
ifeq ($(IO), httpevent)
98
#TODO add: or equals httpmhd
99
OBJS += http_chunk_puller.o
100
endif
101

    
102
ifeq ($(IO), tcp)
103
OBJS += tcp_chunk_puller.o
104
endif
105
OBJS += chunker_player.o QoE_Estimator.o player_stats.o player_core.o player_gui.o
106

    
107
$(OUTPUTFILE): $(OBJS)
108
	$(LINKER) $(LDFLAGS) $^ $(LDLIBS) -o $@
109

    
110
clean:
111
	rm -f $(OUTPUTFILE)
112
	rm -f *.o