Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 file_ver = regina.ver # Versions file
13 VER_DOT = $(shell grep VER_DOT $(file_ver) | sed 's/^VER_DOT=//' )
14 VER_SOMAJOR = $(shell grep VER_SOMAJOR $(file_ver) | sed 's/^VER_SOMAJOR=//' )
15
16 HISTORY = debian/HISTORY
17 CONFIGS = config.guess config.sub
18 CONFIGTGZ = config.tar.gz
19
20 rexxpkg = regina-rexx
21
22 include /usr/share/dpkg/architecture.mk
23 export DEB_HOST_ARCH DEB_BUILD_ARCH DEB_HOST_MULTIARCH
24
25 ifeq ($(DEB_BUILD_ARCH), ia64)
26 DEB_CFLAGS_MAINT_STRIP=""
27 endif
28
29 # Get default build flags for maximum hardening (Needs dpkg-dev >= 1.16.1.1)
30 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
31 DPKG_EXPORT_BUILDFLAGS = 1
32 include /usr/share/dpkg/buildflags.mk
33
34 include /usr/share/dpkg/buildtools.mk
35
36 export CC # Needed for passing cross compiler.
37
38 confflags=--prefix=/usr \
39 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
40 --with-addon-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/$(rexxpkg)/$(VER_DOT) \
41 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
42
43 configure: configure-stamp
44 configure-stamp:
45 dh_testdir
46 # Preserve old config files and replace them by recent ones.
47 [ -e "$(CONFIGTGZ)" ] || tar -cvzf $(CONFIGTGZ) $(addprefix common/,$(CONFIGS))
48 for i in $(CONFIGS); do cp -f /usr/share/misc/$$i common/$$i; done
49 # Add here commands to configure the package.
50 ./configure $(confflags)
51 touch configure-stamp
52
53 build: build-arch build-indep
54 build-arch: build-stamp
55 build-indep: build-stamp
56 build-stamp: configure-stamp
57 dh_testdir
58
59 # Add here commands to compile the package.
60 $(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
61
62 # Bundle all READMEs into a single HISTORY file
63 cat $(shell echo README.0* README.2* README.3* \
64 | tr -s ' ' '\n' | sort -r ) > $(HISTORY)
65
66 cp rxqueue.1 rxqueue-regina-rexx.1
67
68 touch build-stamp
69
70 clean:
71 dh_testdir
72
73 # Add here commands to clean up after the build process.
74 rm -f build-stamp configure-stamp
75 if [ -e "$(CONFIGTGZ)" ]; then \
76 tar -xvzf $(CONFIGTGZ) && rm $(CONFIGTGZ); fi
77 [ ! -f Makefile ] || $(MAKE) distclean
78 rm -f $(HISTORY) rxqueue-regina-rexx.1
79 rm -f APKBUILD config.guess config.sub \
80 PackageInfo PackageInfo-devel PackageInfo-lib \
81 Regina.spec
82
83 dh_clean
84
85 install: build
86 dh_testdir
87 dh_prep
88 dh_installdirs
89
90 # Add here commands to install the package into debian/tmp.
91 $(MAKE) install-lib DESTDIR=$(CURDIR)/debian/tmp
92 $(MAKE) install-dev DESTDIR=$(CURDIR)/debian/tmp
93 $(MAKE) install-rexx DESTDIR=$(CURDIR)/debian/tmp
94
95 # Build architecture-independent files here.
96 binary-indep: build install
97 # We have nothing to do by default.
98
99 # Build architecture-dependent files here.
100 binary-arch: build install
101 dh_testdir
102 dh_testroot
103 dh_installchangelogs
104 dh_installdocs -A $(HISTORY) HACKERS.txt
105 dh_install
106 dh_installman
107 dh_installexamples
108 dh_link
109 dh_strip
110 dh_compress
111 dh_fixperms
112 dh_makeshlibs
113 dh_shlibdeps
114 dh_installdeb
115 dh_gencontrol
116 dh_md5sums
117 dh_builddeb
118
119 binary: binary-indep binary-arch
120 .PHONY: build clean binary-indep binary-arch binary install configure patch \
121 unpatch