3
include /usr/share/quilt/quilt.make
5
3
# This has to be exported to make some magic below work.
6
# Support multiple makes at once
7
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
8
NUMJOBS = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
10
# on i386 and amd64, we query the system unless overriden by DEB_BUILD_OPTIONS
11
ifeq ($(DEB_BUILD_ARCH),i386)
12
NUMJOBS := -j$(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
13
else ifeq ($(DEB_BUILD_ARCH),amd64)
14
NUMJOBS := -j$(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
8
19
# do not run the actual rules of this makefile in parallel. sub-makes
9
20
# can go in parallel
48
60
#configure optimizes for the cpu detected at ./configure time
49
61
#in order to build a generic binary, avoid non-standard opcodes through gcc
50
62
archconf += --target=i586-linux
51
DEB_BUILD_CONFIGURE += --enable-runtime-cpudetection
63
CONFIGURE_FLAGS += --enable-runtime-cpudetection
53
65
ifeq ($(DEB_HOST_ARCH),amd64)
54
DEB_BUILD_CONFIGURE += --enable-runtime-cpudetection
66
CONFIGURE_FLAGS += --enable-runtime-cpudetection
56
68
ifeq ($(DEB_HOST_ARCH),kfreebsd-i386)
57
DEB_BUILD_CONFIGURE += --enable-runtime-cpudetection
69
CONFIGURE_FLAGS += --enable-runtime-cpudetection
59
71
ifeq ($(DEB_HOST_ARCH),kfreebsd-amd64)
60
DEB_BUILD_CONFIGURE += --enable-runtime-cpudetection
72
CONFIGURE_FLAGS += --enable-runtime-cpudetection
62
74
ifeq ($(DEB_HOST_ARCH),powerpc)
63
DEB_BUILD_CONFIGURE += --enable-runtime-cpudetection
75
CONFIGURE_FLAGS += --enable-runtime-cpudetection
65
77
ifeq ($(DEB_HOST_ARCH),alpha)
66
78
#Avoid high optimization through gcc.
71
83
# generate debugging symbols for mplayer-dbg for all archs but mipsen,
73
85
ifeq (,$(findstring mips,$(DEB_HOST_ARCH)))
74
DEB_BUILD_CONFIGURE += --enable-debug
78
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
79
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
80
MAKEFLAGS += -j$(NUMJOBS)
86
CONFIGURE_FLAGS += --enable-debug
84
89
ifeq (linux,$(DEB_HOST_ARCH_OS))
85
DEB_BUILD_CONFIGURE += --enable-mga --enable-3dfx --enable-tdfxfb
90
CONFIGURE_FLAGS += --enable-mga --enable-3dfx --enable-tdfxfb
91
93
# See http://wiki.debian.org/Teams/Dpkg/DebianRules; #465282 and
92
94
# https://wiki.ubuntu.com/DistCompilerFlags
93
95
CLEAN_ENV=env -u CFLAGS -u CPPFLAGS -u LDFLAGS -u FFLAGS -u CXXFLAGS
97
build: build-arch build-indep
96
install-arch: $(QUILT_STAMPFN)
99
[ ! -f config.mak ] || $(MAKE) distclean
100
echo "$(UPSTREAM_VERSION)" > snapshot_version
102
./configure $(COMMON_CONFIGURE_FLAGS) $(DEB_BUILD_CONFIGURE) --disable-gui
105
# build non-gui version
104
./configure $(CONFIGURE_FLAGS) --disable-gui
106
$(MAKE) $(NUMJOBS) mplayer mencoder
106
107
$(MAKE) install-mplayer DESTDIR=$(CURDIR)/debian/mplayer
107
108
$(MAKE) install-mplayer-man DESTDIR=$(CURDIR)/debian/mplayer
109
$(MAKE) install-mencoder DESTDIR=$(CURDIR)/debian/mencoder
108
110
$(MAKE) install-mencoder-man DESTDIR=$(CURDIR)/debian/mplayer
109
111
install -D -m 644 debian/mplayer.conf \
110
112
$(CURDIR)/debian/mplayer/etc/mplayer/mplayer.conf
111
install -D -m 644 debian/apport-hook.py \
112
$(CURDIR)/debian/mplayer/usr/share/apport/package-hooks/source_mplayer.py
114
$(MAKE) install-mencoder DESTDIR=$(CURDIR)/debian/mencoder
116
[ ! -f config.mak ] || $(MAKE) distclean
118
./configure $(COMMON_CONFIGURE_FLAGS) $(DEB_BUILD_CONFIGURE) --enable-gui
121
install -D -m 755 mplayer $(CURDIR)/debian/mplayer-gui/usr/bin/gmplayer
122
install -D -m 644 etc/mplayer.desktop \
123
$(CURDIR)/debian/mplayer-gui/usr/share/applications/mplayer.desktop
124
install -D -m 644 etc/mplayer.xpm \
125
$(CURDIR)/debian/mplayer-gui/usr/share/pixmaps/mplayer.xpm
115
# binaries already installed via build rules as we have to build several flavors
116
install-arch: build-arch
127
118
###### build-indep
129
# commands to compile the documentation
130
install-indep: install-indep-stamp
119
DOCS/HTML/en/index.html:
133
120
sh debian/all-lang-config-mak.sh > config.mak
134
121
cd DOCS/xml && ./configure
135
122
$(MAKE) -C DOCS/xml html-chunked
127
test ! -f DOCS/HTML/en/index.html || $(MAKE) -f debian/rules DOCS/HTML/en/index.html
129
# commands to compile the documentation
130
install-indep: build-indep
136
131
dh_installchangelogs -i
137
132
dh_installdocs -i
142
136
################ clean
144
clean: clean-real unpatch
148
[ ! -f config.mak ] || $(MAKE) -C DOCS/xml distclean || true
149
[ ! -f config.mak ] || $(MAKE) distclean
150
dh_clean build-arch-stamp configure-arch-stamp snapshot_version
141
[ ! -f config.mak ] || $(MAKE) -C DOCS/xml releaseclean && $(MAKE) distclean
142
dh_clean snapshot_version
143
! test -d .git || quilt pop -a || test $$? = 2
152
145
# Build architecture-independent packages
153
146
binary-indep: install-indep
177
170
binary: binary-indep binary-arch
179
###############################################
180
##These targets generate the DFSG-free tar.gz.
181
## They are not automatically invoked.
185
# strip patented code
186
chmod +x debian/strip.sh
187
174
sh debian/get-orig-source.sh -d $(SVN_VERSION)
189
176
PHONY += build clean binary-indep binary-arch binary-common binary
190
177
PHONY += install binary binary-arch binary-indep clean checkroot get-orig-source
191
178
PHONY += autocontrol fix-orig-source copy-orig-from-svn download-and-unpack-orig
192
PHONY += build-gui build-nogui install-gui install-nogui