Merge commit 'upstream/3.2.2'
[debian/gnuradio] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 #
5 # This file was originally written by Joey Hess and Craig Small.
6 # As a special exception, when this file is copied by dh-make into a
7 # dh-make output file, you may use that output file without restriction.
8 # This special exception was added by Craig Small in version 0.37 of dh-make.
9 #
10 # Modified to make a template file for a multi-binary package with separated
11 # build-arch and build-indep targets  by Bill Allombert 2001
12
13 # Uncomment this to turn on verbose mode.
14 export DH_VERBOSE=1
15
16 # This has to be exported to make some magic below work.
17 export DH_OPTIONS
18
19 CFLAGS = -Wall -g
20
21 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22         CFLAGS += -O0
23 else
24         CFLAGS += -O2
25 endif
26
27 configure: configure-stamp
28 configure-stamp:
29         dh_testdir
30 # running bootstrap shouldn't be necessary when working from released tarballs
31 #       ./bootstrap
32         CFLAGS="$(CFLAGS)" ./configure \
33                 --prefix=/usr --mandir=\$${prefix}/share/man \
34                 --infodir=\$${prefix}/share/info --enable-shared \
35                 --enable-doxygen --enable-html-docs \
36                 --sysconfdir=/etc --enable-all-components \
37                 --disable-gr-audio-osx --disable-gr-audio-windows
38         touch configure-stamp
39
40 build: build-stamp
41 build-stamp: configure-stamp 
42
43         $(MAKE) 
44         $(MAKE) check
45         touch $@
46
47 clean:
48         dh_testdir
49         dh_testroot
50         rm -f build-stamp configure-stamp
51
52         [ ! -f Makefile ] || $(MAKE) distclean
53
54         -test -r /usr/share/misc/config.sub && \
55                 cp -f /usr/share/misc/config.sub config.sub
56         -test -r /usr/share/misc/config.guess && \
57                 cp -f /usr/share/misc/config.guess config.guess
58
59         #dh_clean  --exclude ./gr-gsm-fr-vocoder/src/lib/gsm/README.orig
60         dh_clean
61
62 install:
63         dh_testdir
64         dh_testroot
65         dh_clean -k
66         dh_installdirs
67
68         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
69         install -m 0755 debian/usrp.hotplug \
70                 $(CURDIR)/debian/usrp/etc/hotplug.d/usb/
71
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         dh_install --sourcedir=debian/tmp --list-missing
81
82         cp -r gnuradio-examples/python/* \
83                 debian/gnuradio-examples/usr/share/gnuradio/
84         find debian/gnuradio-examples -type f -name Makefile\* -exec rm {} \;
85         find debian/gnuradio-examples -type d -name CVS -exec rm {} \;
86         find debian/gnuradio-examples -name \*.py -exec chmod +x {} \;
87
88         mv debian/gnuradio/usr/bin/microtune.py \
89                 debian/gnuradio/usr/bin/microtune
90
91         mv debian/usrp/usr/bin/usrp_ra_receiver.py \
92                 debian/usrp/usr/bin/usrp_ra_receiver
93         mv debian/usrp/usr/bin/usrp_psr_receiver.py \
94                 debian/usrp/usr/bin/usrp_psr_receiver
95
96 # Must not depend on anything. This is to be called by
97 # binary-arch/binary-indep
98 # in another 'make' thread.
99 binary-common:
100         dh_testdir
101         dh_testroot
102         dh_installchangelogs ChangeLog
103         dh_installdocs
104         dh_installexamples
105 #       dh_installmenu
106 #       dh_installdebconf       
107 #       dh_installlogrotate     
108 #       dh_installemacsen
109 #       dh_installpam
110 #       dh_installmime
111         dh_pycentral
112         dh_python
113 #       dh_installinit
114 #       dh_installcron
115 #       dh_installinfo
116         dh_installman
117         dh_link
118 ifneq (,$(findstring -s,$(DH_OPTIONS)))
119         dh_strip --no-package=libgnuradio-core0c2a --no-package=libusrp0c2a
120         DH_OPTIONS= dh_strip --package=libgnuradio-core0c2a \
121                 --dbg-package=libgnuradio-core0c2a-dbg
122         DH_OPTIONS= dh_strip --package=libusrp0c2a \
123                 --dbg-package=libusrp0c2a-dbg
124 else
125         dh_strip
126 endif
127         dh_compress 
128 #       dh_movefiles --sourcedir=debian/gnuradio
129         dh_fixperms
130 #       dh_perl
131         dh_makeshlibs
132         dh_installdeb
133         dh_shlibdeps
134         dh_gencontrol
135         dh_md5sums
136         dh_builddeb
137
138 # Build architecture independant packages using the common target.
139 binary-indep: build install
140         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
141
142 # Build architecture dependant packages using the common target.
143 binary-arch: build install
144         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
145
146 binary: binary-arch binary-indep
147 .PHONY: build clean binary-indep binary-arch binary install configure