Statistics
| Branch: | Revision:

chunker-player / chunker_player / Makefile @ d0f7ce06

History | View | Annotate | Download (4.25 KB)

1 1538a3bd GiuseppeTropea
include ../common.mak
2
3 be3ee4d2 Csaba Kiraly
ifdef MAC_OS
4
CPPFLAGS += -DMAC_OS
5
endif
6
7 e11386c0 CsabaKiraly
ifdef WINDOWS
8
OUTPUTFILE = chunker_player.exe
9 fd1af02b ArpadBakay
#LDLIBS += -lmsvcrt -lwsock32 -lws2_32 -liberty
10 e11386c0 CsabaKiraly
else
11
OUTPUTFILE = chunker_player
12
endif
13
14
ifeq ($(IO), httpevent)
15 59e008ed GiuseppeTropea
#TODO add: or equals httpmhd
16 e11386c0 CsabaKiraly
CPPFLAGS += -DHTTPIO
17
endif
18
19
ifeq ($(IO), tcp)
20
CPPFLAGS += -DTCPIO
21 d7550679 Csaba Kiraly
ifdef WINDOWS
22
CPPFLAGS += -I$(LOCAL_PTHREAD)/include
23
LDLIBS += $(LOCAL_PTHREAD)/lib/libpthread.a
24
endif
25 e11386c0 CsabaKiraly
endif
26
27 1538a3bd GiuseppeTropea
#SDL config here
28 14d0fa53 GiuseppeTropea
LOCAL_SDL_CPPFLAGS = -I$(LOCAL_ABS_SDL)/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
29 e11386c0 CsabaKiraly
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 14d0fa53 GiuseppeTropea
43
LOCAL_SDLIMAGE_CPPFLAGS = -I$(LOCAL_SDLIMAGE)/include/SDL
44 e11386c0 CsabaKiraly
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 14d0fa53 GiuseppeTropea
50
LOCAL_FREETYPE_CPPFLAGS = -I$(LOCAL_FREETYPE)/include/ -I$(LOCAL_FREETYPE)/include/freetype2
51 e11386c0 CsabaKiraly
LOCAL_FREETYPE_LDFLAGS = -Wl,-rpath -Wl,$(LOCAL_FREETYPE)/lib
52
#LOCAL_FREETYPE_LDFLAGS = -Wl,$(LOCAL_FREETYPE)/lib
53 920851bb GiuseppeTropea
LOCAL_FREETYPE_LDLIBS = $(LOCAL_FREETYPE)/lib/libfreetype.a
54 14d0fa53 GiuseppeTropea
55
LOCAL_SDLTTF_CPPFLAGS = -I$(LOCAL_SDLTTF)/include/SDL
56
LOCAL_SDLTTF_LDLIBS = $(LOCAL_SDLTTF)/lib/libSDL_ttf.a
57 1538a3bd GiuseppeTropea
58
#microhttpd config here
59 a4ea896a Csaba Kiraly
ifdef MHD
60 bf59a05f GiuseppeTropea
LOCAL_MHD_CPPFLAGS = -I$(LOCAL_MHD)/include
61 e11386c0 CsabaKiraly
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 bf59a05f GiuseppeTropea
LOCAL_MHD_LDLIBS = $(LOCAL_MHD)/lib/libmicrohttpd.a
65 e11386c0 CsabaKiraly
endif
66 a4ea896a Csaba Kiraly
endif
67 1538a3bd GiuseppeTropea
68 78068e21 GiuseppeTropea
LOCAL_CONFUSE_CPPFLAGS = -I$(LOCAL_CONFUSE)/include
69
LOCAL_CONFUSE_LDLIBS = $(LOCAL_CONFUSE)/lib/libconfuse.a
70
71 e6416337 Csaba Kiraly
ifdef PSNR_PUBLICATION
72 de21905b Csaba Kiraly
CPPFLAGS += -DPSNR_PUBLICATION
73 47943338 GiuseppeTropea
LOCAL_PSNR_CPPFLAGS = -I$(LIBEVENT_DIR)/include -I$(NAPA)/include
74 59e008ed GiuseppeTropea
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 e6416337 Csaba Kiraly
endif
76 cf919b40 ArpadBakay
77 4ad900ff GiuseppeTropea
#endif
78 b0e46569 GiuseppeTropea
79 c3ccd8f0 GiuseppeTropea
#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 af11718f CarmeloDaniele
CPPFLAGS += $(LOCAL_PSNR_CPPFLAGS)
84 c3ccd8f0 GiuseppeTropea
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 59e008ed GiuseppeTropea
LDLIBS += $(LOCAL_PSNR_LDLIBS)
93 c3ccd8f0 GiuseppeTropea
94 76c297b4 Csaba Kiraly
ifdef LOCAL_CURL
95
LDLIBS += $(LOCAL_CURL)/lib/libcurl.a
96
endif
97
98 e11386c0 CsabaKiraly
ifdef WINDOWS
99 a1b5e551 Csaba Kiraly
LDLIBS += -lmsvcrt -lwsock32 -lws2_32
100 46c4acca Csaba Kiraly
LDLIBS += $(DYNAMIC_LDLIBS) -lmingw32 $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.a -lwinmm -lgdi32
101 d0f7ce06 Csaba Kiraly
LDLIBS += $(call ld-option, -ldxguid)
102 e11386c0 CsabaKiraly
else
103 0f2e2774 Csaba Kiraly
LDLIBS += $(DYNAMIC_LDLIBS)
104
LDLIBS += $(call ld-option, -lrt)
105 bed8a68c Csaba Kiraly
LDLIBS += $(call ld-option, -lX11)
106 e11386c0 CsabaKiraly
endif
107
108
LINKER = $(CC)
109
110
all: $(OUTPUTFILE)
111
112
OBJS = ../chunk_transcoding/external_chunk_transcoding.o
113
ifeq ($(IO), httpevent)
114 59e008ed GiuseppeTropea
#TODO add: or equals httpmhd
115 e11386c0 CsabaKiraly
OBJS += http_chunk_puller.o
116
endif
117 1538a3bd GiuseppeTropea
118 e11386c0 CsabaKiraly
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 1538a3bd GiuseppeTropea
123 fac848aa Csaba Kiraly
ifdef LOCAL_CURL
124
CPPFLAGS += -I$(LOCAL_CURL)/include
125
OBJS += http.o
126
CPPFLAGS += -DCHANNELS_DOWNLOAD
127 44031ca3 Csaba Kiraly
CFLAGS += -DCURL_STATICLIB	#required by MinGW; based on http://curl.haxx.se/docs/faq.html#Link_errors_when_building_libcur
128 fac848aa Csaba Kiraly
endif
129
130 e11386c0 CsabaKiraly
$(OUTPUTFILE): $(OBJS)
131
	$(LINKER) $(LDFLAGS) $^ $(LDLIBS) -o $@
132 1538a3bd GiuseppeTropea
133
clean:
134 e11386c0 CsabaKiraly
	rm -f $(OUTPUTFILE)
135 1538a3bd GiuseppeTropea
	rm -f *.o
136 2d0cda88 Csaba Kiraly
137
### Automatic generation of headers dependencies ###
138
%.d: %.c
139
	$(CC) $(CPPFLAGS) -MM -MF $@ $<
140
141
%.o: %.d
142
143
-include $(OBJS:.o=.d)