Imported Debian patch 4.6.0-1
[debian/atlc] / debian / rules
1 #!/usr/bin/make -f
2
3 # This has to be exported to make some magic below work.
4 export DH_OPTIONS
5
6 # These are used for cross-compiling and for saving the configure script
7 # from having to guess our platform (since we know it already)
8 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10
11
12 CFLAGS = -Wall -g
13
14 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O0
16 else
17         CFLAGS += -O2
18 endif
19 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
20         INSTALL_PROGRAM += -s
21 endif
22
23 config.status: configure
24         dh_testdir
25         ./configure \
26                 --host=$(DEB_HOST_GNU_TYPE) \
27                 --build=$(DEB_BUILD_GNU_TYPE) \
28                 --prefix=/usr \
29                 --mandir=\$${prefix}/share/man \
30                 --infodir=\$${prefix}/share/info \
31                 --enable-hardware-info
32
33 build:  build-stamp
34 build-stamp:    config.status
35         dh_testdir
36         $(MAKE)
37         $(MAKE) check
38         touch build-stamp
39
40 clean:
41         dh_testdir
42         dh_testroot
43         rm -f build-stamp config-stamp
44
45         -$(MAKE) distclean
46         rm -rf tmp
47
48 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
49         cp -f /usr/share/misc/config.sub config.sub
50 endif
51 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
52         cp -f /usr/share/misc/config.guess config.guess
53 endif
54         
55         dh_clean
56
57 install: 
58         dh_testdir
59         dh_testroot
60         dh_clean -k 
61         dh_installdirs 
62         
63         $(MAKE) install DESTDIR=$(CURDIR)/debian/atlc
64         mv debian/atlc/usr/share/atlc/examples \
65                 debian/atlc-examples/usr/share/atlc/examples
66         rm debian/atlc-examples/usr/share/atlc/examples/create_for_Makefile.am
67
68         dh_install
69
70 binary-indep: build install
71         dh_testdir
72         dh_testroot
73         dh_installchangelogs -i ChangeLog
74         dh_installdocs -i
75         dh_installman -i
76         dh_link -i
77         dh_strip -i
78         dh_compress  -i
79         dh_fixperms -i
80         dh_installdeb -i
81         dh_gencontrol -i
82         dh_md5sums -i
83         dh_builddeb -i
84
85 binary-arch: build install
86         dh_testdir
87         dh_testroot
88         dh_installchangelogs -a ChangeLog
89         dh_installdocs -a
90         mv debian/atlc/usr/share/atlc/docs/* debian/atlc/usr/share/doc/atlc
91         rm -rf debian/atlc/usr/share/atlc
92         dh_installman -a
93         dh_link -a
94         dh_strip -a
95         dh_compress  -a
96         dh_fixperms -a
97         dh_installdeb -a
98         dh_shlibdeps -a
99         dh_gencontrol -a
100         dh_md5sums -a
101         dh_builddeb -a
102
103 binary: binary-arch binary-indep
104 .PHONY: build clean binary-indep binary-arch binary install