05f50d67a3d9c8c5c000aecdb1b3440c44cf7249
[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-arch build-indep
36 build-arch:     build-stamp
37 build-indep:    build-stamp
38 build-stamp:    config.status
39         dh_testdir
40         $(MAKE)
41         $(MAKE) check
42         touch build-stamp
43
44 clean:
45         dh_testdir
46         dh_testroot
47         rm -f build-stamp config-stamp
48
49         [ ! -f Makefile ] || $(MAKE) distclean
50         rm -rf tmp
51
52         dh_clean
53
54 install: 
55         dh_testdir
56         dh_testroot
57         dh_clean -k 
58         dh_installdirs 
59         
60         $(MAKE) install DESTDIR=$(CURDIR)/debian/atlc
61         mv debian/atlc/usr/share/atlc/examples \
62                 debian/atlc-examples/usr/share/atlc/examples
63         rm debian/atlc-examples/usr/share/atlc/examples/create_for_Makefile.am
64
65         dh_install
66
67 binary-indep: build install
68         dh_testdir
69         dh_testroot
70         dh_installchangelogs -i ChangeLog
71         dh_installdocs -i
72         dh_installman -i
73         dh_link -i
74         dh_strip -i
75         dh_compress  -i
76         dh_fixperms -i
77         dh_installdeb -i
78         dh_gencontrol -i
79         dh_md5sums -i
80         dh_builddeb -i
81
82 binary-arch: build install
83         dh_testdir
84         dh_testroot
85         dh_installchangelogs -a ChangeLog
86         dh_installdocs -a
87         mv debian/atlc/usr/share/atlc/docs/* debian/atlc/usr/share/doc/atlc
88         rm -rf debian/atlc/usr/share/atlc
89         dh_installman -a
90         dh_link -a
91         dh_strip -a
92         dh_compress  -a
93         dh_fixperms -a
94         dh_installdeb -a
95         dh_shlibdeps -a
96         dh_gencontrol -a
97         dh_md5sums -a
98         dh_builddeb -a
99
100 binary: binary-arch binary-indep
101 .PHONY: build clean binary-indep binary-arch binary install