Final touchups for the release...
[oweals/busybox.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # This is a bit unusual, in that I have to completely recompile everything
4 # twice.  The first is the normal, dynamically linked package.  The second is
5 # for the statically linked package.  This file has been adjusted accordingly.
6
7 # This is the debhelper compatability version to use.
8 export DH_COMPAT=1
9
10 bb=debian/tmp
11 bbs=debian/busybox-static
12
13 clean:
14         dh_testdir
15         dh_testroot
16         rm -f build-stamp-busybox build-stamp-busybox-static
17         -$(MAKE) clean
18         -rm -rf $(bb) $(bbs)
19         dh_clean
20
21 half_clean:
22         dh_testdir
23         dh_testroot
24         rm -rf $(bbs) build-stamp-busybox-static
25         -$(MAKE) clean
26
27 build: build-stamp-busybox
28 build-stamp-busybox:
29         dh_testdir
30         $(MAKE)
31         touch build-stamp-busybox
32
33 install: build
34         dh_testdir
35         dh_testroot
36         dh_clean -k
37         dh_installdirs
38         $(MAKE) "PREFIX=$(bb)" install
39         mkdir -p $(bb)/usr/share/man/man1
40         cp docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
41
42 # Now for the statically linked stuff
43 build-static: build-stamp-busybox-static
44 build-stamp-busybox-static:
45         dh_testdir
46         $(MAKE) DOSTATIC=true
47         touch build-stamp-busybox-static
48
49 install-static: build
50         dh_testdir
51         dh_testroot
52         dh_clean -k
53         dh_installdirs
54         # Do not run 'make install', since we do not want all the symlinks. 
55         # This just installes the busybox binary...
56         #$(MAKE) "PREFIX=$(bbs)" install
57         mkdir -p $(bbs)/bin/
58         cp busybox $(bbs)/bin/busybox
59         mkdir -p $(bbs)/usr/share/man/man1/
60         cp docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1
61
62 do_static: half_clean build-static install-static
63
64
65 # Build architecture-independent files here.
66 binary-indep:
67 # We have nothing to do by default.
68
69 # Build architecture-dependent files here.
70 binary-arch: busybox busybox-static
71
72 busybox: install
73         @echo "--- Building: $@"
74         dh_testdir
75         dh_testroot
76         dh_installdirs
77         #
78         #Note that for busybox, we do not install any docs,
79         # or man apges or anything else.  This is in blatent violation of every
80         # Debian policy out there, since this package is intended to be used
81         # _only_ by the debian-installer.
82         #
83         #dh_installdocs       -p$@ docs/BusyBox.txt \
84         #       docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
85         #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \
86         #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \
87         #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \
88         #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore
89         #dh_undocumented      -p$@
90         dh_installchangelogs -p$@ Changelog
91         dh_strip             -p$@
92         dh_compress          -p$@
93         dh_fixperms          -p$@
94         dh_installdeb        -p$@
95         dh_shlibdeps         -p$@
96         #
97         #Make _very_ sure there are no docs lurking about.
98         #
99         rm -rf $(bb)/usr/share/doc
100         rm -rf $(bb)/usr/share/man
101         dh_gencontrol        -p$@
102         dh_md5sums           -p$@
103         dh_builddeb          -p$@
104
105
106 busybox-static: do_static
107         @echo "--- Building: $@"
108         dh_testdir
109         dh_testroot
110         dh_installdirs
111         dh_installdocs       -p$@ docs/BusyBox.txt \
112                 docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
113         rm -rf $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/CVS \
114                 $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/.cvsignore \
115                 $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/CVS \
116                 $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/.cvsignore
117         dh_undocumented      -p$@
118         dh_installchangelogs -p$@ Changelog
119         dh_strip             -p$@
120         dh_compress          -p$@
121         dh_fixperms          -p$@
122         dh_installdeb        -p$@
123         dh_shlibdeps         -p$@
124         dh_gencontrol        -p$@
125         dh_md5sums           -p$@
126         dh_builddeb          -p$@
127
128
129 binary: binary-indep binary-arch
130 .PHONY: build clean binary-indep binary-arch binary install