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