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