1 | #!/usr/bin/make -f |
---|
2 | |
---|
3 | # Uncomment this to turn on verbose mode. |
---|
4 | #export DH_VERBOSE=1 |
---|
5 | |
---|
6 | # Enable all hardening features, since traces are untrusted input. |
---|
7 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
---|
8 | DPKG_EXPORT_BUILDFLAGS = 1 |
---|
9 | include /usr/share/dpkg/buildflags.mk |
---|
10 | |
---|
11 | # These are used for cross-compiling and for saving the configure script |
---|
12 | # from having to guess our platform (since we know it already) |
---|
13 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
---|
14 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
---|
15 | CONFFLAGS = |
---|
16 | ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) |
---|
17 | CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) |
---|
18 | else |
---|
19 | CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) |
---|
20 | endif |
---|
21 | |
---|
22 | |
---|
23 | libtrace_backup.h: |
---|
24 | # libtrace.h is modified by the build, so back it up so it can be restored |
---|
25 | # by the clean target |
---|
26 | cp lib/libtrace.h libtrace_backup.h |
---|
27 | |
---|
28 | configure: |
---|
29 | |
---|
30 | configure-stamp: configure libtrace_backup.h |
---|
31 | dh_testdir |
---|
32 | |
---|
33 | dh_autoreconf |
---|
34 | |
---|
35 | ./configure $(CONFFLAGS) \ |
---|
36 | --prefix=/usr \ |
---|
37 | --mandir=\$${prefix}/share/man \ |
---|
38 | --infodir=\$${prefix}/share/info |
---|
39 | |
---|
40 | touch configure-stamp |
---|
41 | |
---|
42 | build: build-arch build-indep |
---|
43 | build-arch: build-stamp |
---|
44 | build-indep: build-stamp |
---|
45 | build-stamp: configure-stamp |
---|
46 | dh_testdir |
---|
47 | |
---|
48 | # Add here commands to compile the package. |
---|
49 | $(MAKE) |
---|
50 | |
---|
51 | touch build-stamp |
---|
52 | |
---|
53 | clean: |
---|
54 | dh_testdir |
---|
55 | dh_testroot |
---|
56 | rm -f build-stamp configure-stamp |
---|
57 | |
---|
58 | [ ! -f Makefile ] || $(MAKE) clean |
---|
59 | [ ! -f Makefile ] || $(MAKE) distclean |
---|
60 | [ ! -f libtrace_backup.h ] || mv libtrace_backup.h lib/libtrace.h |
---|
61 | rm -rf docs/doxygen |
---|
62 | |
---|
63 | dh_autoreconf_clean |
---|
64 | dh_clean |
---|
65 | |
---|
66 | install: build |
---|
67 | dh_testdir |
---|
68 | dh_testroot |
---|
69 | dh_clean -k |
---|
70 | dh_installdirs |
---|
71 | |
---|
72 | # Add here commands to install the package into debian/tmp |
---|
73 | $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp |
---|
74 | |
---|
75 | |
---|
76 | # Build architecture-independent files here. |
---|
77 | binary-indep: build install |
---|
78 | # We have nothing to do by default. |
---|
79 | |
---|
80 | # Build architecture-dependent files here. |
---|
81 | binary-arch: build install |
---|
82 | dh_testdir |
---|
83 | dh_testroot |
---|
84 | #dh_installchangelogs ChangeLog |
---|
85 | dh_installchangelogs |
---|
86 | dh_installdocs |
---|
87 | dh_installexamples |
---|
88 | dh_installman |
---|
89 | dh_install --sourcedir=debian/tmp |
---|
90 | dh_link |
---|
91 | dh_strip |
---|
92 | dh_compress |
---|
93 | dh_fixperms |
---|
94 | dh_makeshlibs |
---|
95 | dh_installdeb |
---|
96 | dh_shlibdeps |
---|
97 | dh_gencontrol |
---|
98 | dh_md5sums |
---|
99 | dh_builddeb |
---|
100 | |
---|
101 | binary: binary-indep binary-arch |
---|
102 | .PHONY: build clean binary-indep binary-arch binary install |
---|