Statistics
| Branch: | Revision:

chunker-player / chunker_player / Makefile @ d0f7ce06

History | View | Annotate | Download (4.25 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
100
LDLIBS += $(DYNAMIC_LDLIBS) -lmingw32 $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.a -lwinmm -lgdi32
101
LDLIBS += $(call ld-option, -ldxguid)
102
else
103
LDLIBS += $(DYNAMIC_LDLIBS)
104
LDLIBS += $(call ld-option, -lrt)
105
LDLIBS += $(call ld-option, -lX11)
106
endif
107

    
108
LINKER = $(CC)
109

    
110
all: $(OUTPUTFILE)
111

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

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

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

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

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

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

    
141
%.o: %.d
142

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