96b231761ae68f2d88fd52f51207b6438339612a
[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         cp -f /usr/share/misc/config.sub config.sub
26         cp -f /usr/share/misc/config.guess config.guess
27         ./configure \
28                 --host=$(DEB_HOST_GNU_TYPE) \
29                 --build=$(DEB_BUILD_GNU_TYPE) \
30                 --prefix=/usr \
31                 --mandir=\$${prefix}/share/man \
32                 --infodir=\$${prefix}/share/info \
33                 --enable-hardware-info
34
35 build:  build-stamp
36 build-stamp:    config.status
37         dh_testdir
38         $(MAKE)
39         $(MAKE) check
40         touch build-stamp
41
42 clean:
43         dh_testdir
44         dh_testroot
45         rm -f build-stamp config-stamp
46
47         -$(MAKE) distclean
48         rm -rf tmp
49
50         dh_clean
51
52 install: 
53         dh_testdir
54         dh_testroot
55         dh_clean -k 
56         dh_installdirs 
57         
58         $(MAKE) install DESTDIR=$(CURDIR)/debian/atlc
59         mv debian/atlc/usr/share/atlc/examples \
60                 debian/atlc-examples/usr/share/atlc/examples
61         rm debian/atlc-examples/usr/share/atlc/examples/create_for_Makefile.am
62
63         dh_install
64
65 binary-indep: build install
66         dh_testdir
67         dh_testroot
68         dh_installchangelogs -i ChangeLog
69         dh_installdocs -i
70         dh_installman -i
71         dh_link -i
72         dh_strip -i
73         dh_compress  -i
74         dh_fixperms -i
75         dh_installdeb -i
76         dh_gencontrol -i
77         dh_md5sums -i
78         dh_builddeb -i
79
80 binary-arch: build install
81         dh_testdir
82         dh_testroot
83         dh_installchangelogs -a ChangeLog
84         dh_installdocs -a
85         mv debian/atlc/usr/share/atlc/docs/* debian/atlc/usr/share/doc/atlc
86         rm -rf debian/atlc/usr/share/atlc
87         dh_installman -a
88         dh_link -a
89         dh_strip -a
90         dh_compress  -a
91         dh_fixperms -a
92         dh_installdeb -a
93         dh_shlibdeps -a
94         dh_gencontrol -a
95         dh_md5sums -a
96         dh_builddeb -a
97
98 binary: binary-arch binary-indep
99 .PHONY: build clean binary-indep binary-arch binary install