5c2bcf20700c54b11a2b80a265d601875ce253b2
[oweals/busybox.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 # This is the debhelper compatibility version to use.
7 export DH_COMPAT=3
8
9 VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
10 ARCH = $(shell dpkg --print-architecture)
11
12 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
13         DODEBUG = true
14 endif
15 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
16         DODEBUG = true
17 endif
18
19 build-arch: build-arch-stamp
20 build-arch-stamp:
21         $(MAKE) clean
22         cp ./debian/config-deb .config
23         $(MAKE) dep
24         $(MAKE) DODEBUG=$(DODEBUG)
25         install busybox busybox-deb
26
27         $(MAKE) clean
28         cp ./debian/config-static .config
29         $(MAKE) dep
30         $(MAKE) DOSTATIC=true DODEBUG=$(DODEBUG)
31         install busybox busybox-static
32
33         $(MAKE) clean
34         cp ./debian/config-udeb .config
35         $(MAKE) dep
36         $(MAKE) DODEBUG=$(DODEBUG)
37
38         touch build-arch-stamp
39
40 build-indep: build-indep-stamp
41 build-indep-stamp:
42         $(MAKE) newdoc
43
44         touch build-indep-stamp
45
46 build: build-arch build-indep
47
48 clean:
49         dh_testdir
50         dh_testroot
51         rm -f build-arch-stamp build-indep-stamp
52
53         $(MAKE) distclean
54         -rm -f busybox-deb busybox-static
55
56         dh_clean
57
58 install: build-arch
59         dh_testdir
60         dh_testroot
61         dh_clean -k
62         dh_installdirs
63
64         install busybox-deb $(CURDIR)/debian/busybox-cvs/bin/busybox
65         install busybox-static $(CURDIR)/debian/busybox-cvs-static/bin/busybox
66         $(MAKE) PREFIX=$(CURDIR)/debian/busybox-cvs-udeb install
67
68 # Build architecture-independent files here.
69 # Pass -i to all debhelper commands in this target to reduce clutter.
70 binary-indep: build
71         dh_testdir -i
72         dh_testroot -i
73 #       dh_installdebconf -i
74         dh_installdocs -i
75 #       dh_installexamples -i
76 #       dh_installmenu -i
77 #       dh_installlogrotate -i
78 #       dh_installemacsen -i
79 #       dh_installpam -i
80 #       dh_installmime -i
81 #       dh_installinit -i
82 #       dh_installcron -i
83 #       dh_installman -i
84 #       dh_installinfo -i
85 #       dh_undocumented -i
86         dh_installchangelogs Changelog -i
87         dh_link -i
88         dh_compress -i
89         dh_fixperms -i
90         dh_installdeb -i
91 #       dh_perl -i
92         dh_gencontrol -i
93         dh_md5sums -i
94         dh_builddeb -i
95
96 # Build architecture-dependent files here.
97 binary-arch: build-arch install
98         dh_testdir -a
99         dh_testroot -a
100 #       dh_installdebconf -a
101         dh_installdocs -a -Nbusybox-cvs-udeb
102 #       dh_installexamples -a
103 #       dh_installmenu -a
104 #       dh_installlogrotate -a
105 #       dh_installemacsen -a
106 #       dh_installpam -a
107 #       dh_installmime -a
108 #       dh_installinit -a
109 #       dh_installcron -a
110 #       dh_installman -a
111 #       dh_installinfo -a
112 #       dh_undocumented -a
113         dh_installchangelogs Changelog -a -Nbusybox-cvs-udeb
114         dh_strip -a
115         dh_link -a
116         dh_compress -a
117         dh_fixperms -a
118 #       dh_makeshlibs -a
119         dh_installdeb -a
120 #       dh_perl -a
121         dh_shlibdeps -a
122         dh_gencontrol -a
123         dh_md5sums -a -Nbusybox-cvs-udeb
124         dh_builddeb -a -Nbusybox-cvs-udeb
125         dpkg-distaddfile busybox-cvs-udeb-$(VERSION)_$(ARCH).udeb debian-installer optional
126         dh_builddeb -pbusybox-cvs-udeb --filename=busybox-cvs-udeb-$(VERSION)_$(ARCH).udeb
127
128 binary: binary-indep binary-arch
129 .PHONY: build clean binary-indep binary-arch binary install