Commit | Line | Data |
---|---|---|
4d13a1de MB |
1 | #!/usr/bin/make -f |
2 | ||
3 | DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) | |
4 | DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) | |
5 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | |
6 | API ?= $(shell debian/getapi.sh) | |
7 | LIB = $(CURDIR)/debian/install/usr/lib/$(DEB_HOST_MULTIARCH) | |
8 | ||
9 | include debian/confflags | |
10 | ||
11 | builddir = compiling | |
12 | x265-clean = rm -rf $(builddir) && mkdir $(builddir) | |
13 | x265-install = $(MAKE) -C $(builddir) install DESTDIR=$(CURDIR)/debian/install | |
14 | x265-build = dh_auto_build -D$(builddir) | |
15 | test-build = \ | |
16 | $(builddir)/x265 --pass 1 --bitrate 10 -o /dev/null debian/test.y4m && \ | |
17 | $(builddir)/x265 --pass 2 --bitrate 10 -o test.hevc debian/test.y4m | |
18 | ||
19 | ||
20 | %: | |
21 | dh ${@} --parallel | |
22 | ||
23 | override_dh_auto_clean: | |
24 | dh_auto_clean | |
25 | rm -rf $(builddir) doc/reST/build debian/install debian/test.y4m | |
26 | ||
27 | override_dh_auto_build: | |
28 | sed -e 's/@API@/$(API)/g' debian/control.in > debian/control | |
29 | cp -f debian/libx265N.install debian/libx265-$(API).install | |
30 | unxz -fk debian/test.y4m.xz | |
31 | # build x265 8-bit | |
32 | mkdir $(builddir) | |
33 | cd $(builddir) && cmake $(8bit_confflags) ../source | |
34 | $(x265-build) | |
35 | $(x265-install) | |
36 | # test x265 8-bit | |
0a257c84 | 37 | # $(test-build) |
4d13a1de MB |
38 | # build x265 10-bit |
39 | $(x265-clean) | |
40 | cd $(builddir) && cmake $(10bit_confflags) ../source | |
41 | $(x265-build) | |
42 | $(x265-install) | |
43 | sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \ | |
44 | debian/x265-10bit.in > $(builddir)/x265-10bit | |
45 | install -c -D -m755 $(builddir)/x265-10bit $(CURDIR)/debian/install/usr/bin | |
46 | # test x265 10-bit | |
0a257c84 | 47 | # $(test-build) |
4d13a1de MB |
48 | # build x265 8-bit static |
49 | $(x265-clean) | |
50 | rm -f $(LIB)/libx265.a | |
51 | cd $(builddir) && cmake $(8bit_static_confflags) ../source | |
52 | $(x265-build) | |
53 | install -c -D -m644 $(builddir)/libx265.a $(LIB) | |
54 | # build x265 10-bit static | |
55 | $(x265-clean) | |
56 | rm -f $(LIB)/x265-10bit/libx265.a | |
57 | cd $(builddir) && cmake $(10bit_static_confflags) ../source | |
58 | $(x265-build) | |
59 | install -c -D -m644 $(builddir)/libx265.a $(LIB)/x265-10bit | |
60 | # build documentation | |
61 | $(MAKE) -C doc/reST pickle html | |
62 | ||
63 | override_dh_install: | |
64 | dh_install --list-missing --sourcedir=$(CURDIR)/debian/install | |
65 | ||
66 | override_dh_installchangelogs: | |
67 | dh_installchangelogs -px265-doc -plibx265-$(API) ChangeLog | |
68 | ||
69 | override_dh_installdocs: | |
70 | dh_installdocs -plibx265-$(API) -px265-doc -X.buildinfo | |
71 | dh_installdocs -px265 -px265-dbg -plibx265-dev --link-doc=libx265-$(API) | |
72 | ||
73 | override_dh_strip: | |
74 | dh_strip --dbg-package=x265-dbg | |
75 | ||
76 | override_dh_builddeb: | |
77 | dh_builddeb -- -Zxz -z9 | |
78 |