4a477732c37168562ae95d983f916eafc8140fe0
[debian/gnuradio] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 export DH_VERBOSE=1
5
6 # This has to be exported to make some magic below work.
7 export DH_OPTIONS
8
9 clean:
10         dh_testdir
11         dh_testroot
12         rm -f build-stamp configure-stamp extract-stamp install-stamp
13
14         if [ -f Makefile ]; \
15         then\
16                 if [ -d .svn ]; \
17                 then \
18                         $(MAKE) maintainer-clean; \
19                 else \
20                         $(MAKE) distclean; \
21                 fi; \
22         fi
23
24         dh_clean
25
26 update:
27         dh_testdir
28         -test -r /usr/share/misc/config.sub && \
29                 cp -f /usr/share/misc/config.sub config.sub
30         -test -r /usr/share/misc/config.guess && \
31                 cp -f /usr/share/misc/config.guess config.guess
32
33 configure: configure-stamp
34 configure-stamp:
35         dh_testdir
36         [ -f ./configure ] || ./bootstrap
37         ./configure \
38                 --prefix=/usr \
39                 --mandir=\$${prefix}/share/man \
40                 --infodir=\$${prefix}/share/info \
41                 --enable-shared \
42                 --sysconfdir=/etc \
43                 --enable-all-components \
44                 --enable-doxygen \
45                 --disable-gr-audio-osx \
46                 --disable-gr-audio-windows \
47                 --disable-gcell --disable-gr-gcell \
48                 --disable-gr-comedi --disable-usrp2-firmware
49         touch configure-stamp
50
51 build: build-stamp
52 build-stamp: configure-stamp
53
54         $(MAKE) -j
55         $(MAKE) check
56         touch $@
57
58 extract: extract-stamp
59 extract-stamp: build-stamp debian/gen-install-files.sh
60         dh_testdir
61         debian/gen-install-files.sh 
62         touch $@
63
64 install: install-stamp
65 install-stamp: extract-stamp debian/control
66         dh_testdir
67         dh_testroot
68         dh_clean -k
69         dh_installdirs
70
71         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
72         : # make python scripts starting with '#!' executable
73         for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
74           if head -1 $$i | grep -q '^#!'; then \
75             chmod 755 $$i; \
76             echo "made executable: $$i"; \
77           fi; \
78         done
79
80         : # Deposit rule to allow group 'usrp' access to USRP hardware
81         install -m 0644 -D debian/libusrp.udev \
82                 debian/tmp/etc/udev/rules.d/40-usrp.rules
83
84         : # Deposit rule to allow group 'usrp' access to USRP2 hardware
85         install -m 0644 -D debian/libusrp2.limits \
86                 debian/tmp/etc/security/limits.d/libusrp2.limits
87
88         dh_install --sourcedir=debian/tmp
89         touch $@
90
91
92 # Must not depend on anything. This is to be called by
93 # binary-arch/binary-indep
94 # in another 'make' thread.
95 binary-common:
96         dh_testdir
97         dh_testroot
98         dh_installchangelogs ChangeLog
99         dh_installdocs
100         dh_pycentral
101         dh_link
102         dh_strip
103         dh_compress 
104         dh_fixperms
105         dh_makeshlibs
106         dh_installdeb
107         dh_shlibdeps
108         dh_gencontrol
109         dh_md5sums
110         mkdir -p ../debfiles
111         dh_builddeb --destdir=../debfiles
112
113 # Build architecture independant packages using the common target.
114 binary-indep: build install
115         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
116
117 # Build architecture dependant packages using the common target.
118 binary-arch: build install
119         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
120
121 binary: binary-arch binary-indep
122 .PHONY: build clean binary-indep binary-arch binary install configure