summaryrefslogtreecommitdiff
path: root/xine/BluRay/Makefile
blob: 389e3fa0ca169aaf97ef6dca39940537b09ebb7c (plain)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#
# select plugins
#

ENABLE_DEMUX_PLUGIN ?= yes

ifeq ($(shell pkg-config libbluray && echo yes), yes)
    ENABLE_INPUT_PLUGIN ?= yes
    CFLAGS_BD ?= $(shell pkg-config libbluray --cflags)
    LIBS_BD   ?= $(shell pkg-config libbluray --libs)
else
    ENABLE_INPUT_PLUGIN ?= no
    $(warning libbluray not found)
endif

ifeq ($(shell pkg-config libxine --atleast-version=1.1.19 || echo "yes"), yes)
    ENABLE_SPU_PLUGIN ?= yes
else
    ENABLE_SPU_PLUGIN ?= no
    $(warning SPU plugin is included in xine-lib 1.1.19+)
endif

ifeq ($(shell pkg-config libxine --atleast-version=1.1.18 || echo "yes"), yes)
    ENABLE_PCM_PLUGIN ?= yes
else
    ENABLE_PCM_PLUGIN ?= no
    $(warning PCM plugin is included in xine-lib 1.1.18+)
endif

#
# compiler options
#

CFLAGS      += -O2 -fPIC
CFLAGS      += -Wall
CFLAGS      += -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CFLAGS      += $(shell pkg-config libxine --cflags)
CFLAGS      += $(CFLAGS_BD)
INSTALL      = install


#
# linker options
#

LIBS_XINE    = $(shell pkg-config libxine --libs)
LDFLAGS     += -shared -fvisibility=hidden

#
# targets
#

DESTDIR           ?= /
XINEPLUGINDIR      = $(shell pkg-config libxine --variable=plugindir)

ifeq ($(ENABLE_DEMUX_PLUGIN), yes)
    XINEDMXPLUGIN  = xineplug_dmx_mpeg_ts_hdmv.so
else
    $(warning Not building HDMV MPEG-TS demuxer plugin)
endif

ifeq ($(ENABLE_SPU_PLUGIN), yes)
    XINESPUPLUGIN = xineplug_decode_spuhdmv.so
else
    $(warning Not building HDMV SPU plugin)
endif

ifeq ($(ENABLE_INPUT_PLUGIN), yes)
    XINEINPUTPLUGIN= xineplug_inp_bluray.so
else
    $(warning Not building BluRay input plugin)
endif

ifeq ($(ENABLE_PCM_PLUGIN), yes)
    XINELPCMPLUGIN = xineplug_decode_lpcm_hdmv.so
else
    $(warning Not building BluRay PCM plugin)
endif

#
# object files
#

OBJS_XINEDMXPLUGIN   = demux_ts.o
OBJS_XINESPUPLUGIN   = decode_spuhdmv.o
OBJS_XINEINPUTPLUGIN = input_bluray.o
OBJS_XINELPCMPLUGIN  = xine_lpcm_decoder.o

#
# rules
#

all: $(XINEDMXPLUGIN) $(XINESPUPLUGIN) $(XINEINPUTPLUGIN) $(XINELPCMPLUGIN)

ifeq ($(ENABLE_DEMUX_PLUGIN), yes)
$(XINEDMXPLUGIN): $(OBJS_XINEDMXPLUGIN)
	$(CC) $(LDFLAGS) $(LIBS_XINE) -o $@ $(OBJS_XINEDMXPLUGIN)
endif

ifeq ($(ENABLE_SPU_PLUGIN), yes)
$(XINESPUPLUGIN): $(OBJS_XINESPUPLUGIN)
	$(CC) $(LDFLAGS) $(LIBS_XINE) -o $@ $(OBJS_XINESPUPLUGIN)
endif

ifeq ($(ENABLE_INPUT_PLUGIN), yes)
$(XINEINPUTPLUGIN): $(OBJS_XINEINPUTPLUGIN)
	$(CC) $(LDFLAGS) $(LIBS_XINE) $(LIBS_BD) -o $@ $(OBJS_XINEINPUTPLUGIN)
endif

ifeq ($(ENABLE_PCM_PLUGIN), yes)
$(XINELPCMPLUGIN): $(OBJS_XINELPCMPLUGIN)
	$(CC) $(LDFLAGS) $(LIBS_XINE) -o $@ $(OBJS_XINELPCMPLUGIN)
endif

#
# targets
#

clean:
	@rm -rf *.o *.so *~

install: all uninstall
ifeq ($(ENABLE_DEMUX_PLUGIN), yes)
	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEDMXPLUGIN)
	@$(INSTALL) -D -m 0644 $(XINEDMXPLUGIN) $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEDMXPLUGIN)
endif
ifeq ($(ENABLE_SPU_PLUGIN), yes)
	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINESPUPLUGIN)
	@$(INSTALL) -D -m 0644 $(XINESPUPLUGIN) $(DESTDIR)/$(XINEPLUGINDIR)/$(XINESPUPLUGIN)
endif
ifeq ($(ENABLE_INPUT_PLUGIN), yes)
	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTPLUGIN)
	@$(INSTALL) -D -m 0644 $(XINEINPUTPLUGIN) $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTPLUGIN)
endif
ifeq ($(ENABLE_PCM_PLUGIN), yes)
	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINELPCMPLUGIN)
	@$(INSTALL) -D -m 0644 $(XINELPCMPLUGIN) $(DESTDIR)/$(XINEPLUGINDIR)/$(XINELPCMPLUGIN)
endif

uninstall:
ifeq ($(ENABLE_DEMUX_PLUGIN), yes)
	@echo Removing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEDMXPLUGIN)
	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEDMXPLUGIN)
endif
ifeq ($(ENABLE_SPU_PLUGIN), yes)
	@echo Removing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINESPUPLUGIN)
	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/$(XINESPUPLUGIN)
endif
ifeq ($(ENABLE_INPUT_PLUGIN), yes)
	@echo Removing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTPLUGIN)
	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTPLUGIN)
endif
ifeq ($(ENABLE_PCM_PLUGIN), yes)
	@echo Removing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINELPCMPLUGIN)
	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/$(XINELPCMPLUGIN)
endif