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