forked from b-rad-NDi/tv-now
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
90 lines (73 loc) · 2.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# TV-Now
#
# (c) 2012 - Brad Love
# Next Dimension Innovations
# http://nextdimension.cc
# http://b-rad.cc
#
# Name of the executable
EXENAME = tv-now
# List all object files here
OFILES = \
CdsMediaClass.o\
CdsMediaObject.o\
CdsObjectToDidl.o\
MicroMediaServer.o\
UpnpMicroStack.o\
MyString.o\
MimeTypes.o\
PortingFunctions.o\
tv-now.o
DVBTEE_LIBS = -L./libdvbtee/usr/lib -ldvbtee -ldvbtee_server -ldvbpsi -lstdc++
# libdvbtee is build with HDHomerun support
ifeq ($(HDHOMERUN_SUPPORT),1)
DVBTEE_LIBS += -lhdhomerun
endif
DVBTEE_LIBS_STATIC = ./libdvbtee/usr/lib/libdvbtee.a ./libdvbtee/usr/lib/libdvbtee_server.a ./libdvbtee/usr/lib/libdvbpsi.a -lstdc++
DVBTEE_INCLUDES = -I./libdvbtee/usr/include -I./libdvbtee/libdvbtee -I./libdvbtee/libdvbtee_server
DVBTEE_SERVER = dvbteeserver
IWEBLIB = libIWeb
DEBUG = -D_DEBUG -D_VERBOSE -g -ggdb
# Compiler flags applied to all files
# Optional flags: -D_VERBOSE -D_DEBUG -DSPAWN_BROWSE_THREAD -D_TEMPDEBUG
# -g puts debug symbols
# -DSPAWN_BROWSE_THREAD makes it so each browse thread spawns a thread (recommended only if browse request takes a long time)
#
export DEFINES = -D_POSIX -D_GNU_SOURCE -D__USE_LARGEFILE64 -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64
export CPPFLAGS = -Wno-deprecated -Wno-deprecated-declarations -pthread -fPIC $(DEBUG) $(DEFINES)
export CFLAGS = -O2 -Wall $(DEBUG) $(OPTFLAGS) -pthread -I./$(IWEBLIB) $(DEFINES)
LIBS = ./$(IWEBLIB)/$(IWEBLIB).a
# Compiler command name
CC = $(CROSS_COMPILE)gcc
GPP = $(CROSS_COMPILE)g++
CXX = $(GPP)
STRIP = $(CROSS_COMPILE)strip
# Search paths
VPATH = src: ./ ./$(IWEBLIB)
# Builds all object files and executable
$(EXENAME) : $(OFILES) $(IWEBLIB) $(DVBTEE_SERVER)
$(CC) $(CFLAGS) -o $(EXENAME) $(OFILES) $(DVBTEE_SERVER).o ${LIBS} $(DVBTEE_LIBS)
# Static build
static : $(OFILES) $(IWEBLIB) $(DVBTEE_SERVER)
$(CC) $(CFLAGS) -o $(EXENAME) $(OFILES) $(DVBTEE_SERVER).o $(LIBS) $(DVBTEE_LIBS_STATIC)
$(IWEBLIB) : $(OFILES)
make -C $(IWEBLIB)
$(DVBTEE_SERVER) :
$(GPP) $(DVBTEE_INCLUDES) $(CPPFLAGS) -c $(DVBTEE_SERVER).cpp
# Macro rule for all object files.
$(OFILES) : \
ILibParsers.h\
ILibWebClient.h\
ILibWebServer.h\
ILibAsyncSocket.h\
ILibAsyncServerSocket.h\
UpnpMicroStack.h\
MicroMediaServer.h\
MyString.h\
MimeTypes.h\
dvbteeserver.h\
PortingFunctions.h
# Clean up
clean :
make -C $(IWEBLIB) clean
rm -f $(OFILES) $(EXENAME) $(DVBTEE_SERVER).o