blob: 67741b19f6616dbe3dbf1a292cd89410ee88e842 [file] [log] [blame]
Eric Andersenb108a5b2000-06-19 09:21:34 +00001#!/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.
8export DH_COMPAT=1
9
10bb=debian/tmp
Eric Andersene2f6e122000-12-01 19:55:04 +000011bbbd=debian/bb_builddir
Eric Andersenb108a5b2000-06-19 09:21:34 +000012bbs=debian/busybox-static
Eric Andersene2f6e122000-12-01 19:55:04 +000013bbsbd=debian/bb-static_builddir
14
15#For the debian-installer .udeb package
16PACKAGE=busybox-udeb
17VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
18ARCH=$(shell dpkg --print-architecture)
19FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb
20PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
Eric Andersenb108a5b2000-06-19 09:21:34 +000021
22clean:
23 dh_testdir
24 dh_testroot
25 rm -f build-stamp-busybox build-stamp-busybox-static
26 -$(MAKE) clean
Eric Andersene2f6e122000-12-01 19:55:04 +000027 -rm -rf $(bb) $(bbbd) $(bbs) $(bbsbd)
Eric Andersenb108a5b2000-06-19 09:21:34 +000028 dh_clean
29
30half_clean:
31 dh_testdir
32 dh_testroot
33 rm -rf $(bbs) build-stamp-busybox-static
34 -$(MAKE) clean
35
36build: build-stamp-busybox
37build-stamp-busybox:
38 dh_testdir
Eric Andersene2f6e122000-12-01 19:55:04 +000039 mkdir -p $(bbbd)
40 cp Makefile Config.h $(bbbd)
41 (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../")
Eric Andersenb108a5b2000-06-19 09:21:34 +000042 touch build-stamp-busybox
43
44install: build
45 dh_testdir
46 dh_testroot
47 dh_clean -k
48 dh_installdirs
Eric Andersene2f6e122000-12-01 19:55:04 +000049 (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install)
Eric Andersenb108a5b2000-06-19 09:21:34 +000050 mkdir -p $(bb)/usr/share/man/man1
51 cp docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
52
53# Now for the statically linked stuff
54build-static: build-stamp-busybox-static
55build-stamp-busybox-static:
56 dh_testdir
57 $(MAKE) DOSTATIC=true
58 touch build-stamp-busybox-static
59
60install-static: build
61 dh_testdir
62 dh_testroot
63 dh_clean -k
64 dh_installdirs
65 # Do not run 'make install', since we do not want all the symlinks.
66 # This just installes the busybox binary...
67 #$(MAKE) "PREFIX=$(bbs)" install
68 mkdir -p $(bbs)/bin/
69 cp busybox $(bbs)/bin/busybox
70 mkdir -p $(bbs)/usr/share/man/man1/
71 cp docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1
72
73do_static: half_clean build-static install-static
74
75
76# Build architecture-independent files here.
77binary-indep:
78# We have nothing to do by default.
79
80# Build architecture-dependent files here.
Eric Andersene2f6e122000-12-01 19:55:04 +000081binary-arch: busybox busybox-static busybox-udeb
Eric Andersenb108a5b2000-06-19 09:21:34 +000082
83busybox: install
84 @echo "--- Building: $@"
85 dh_testdir
86 dh_testroot
87 dh_installdirs
Eric Andersen47cac672000-06-28 02:25:18 +000088 #
89 #Note that for busybox, we do not install any docs,
90 # or man apges or anything else. This is in blatent violation of every
91 # Debian policy out there, since this package is intended to be used
92 # _only_ by the debian-installer.
93 #
94 #dh_installdocs -p$@ docs/BusyBox.txt \
95 # docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
96 #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \
97 # $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \
98 # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \
99 # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore
Eric Andersenb108a5b2000-06-19 09:21:34 +0000100 #dh_undocumented -p$@
Eric Andersene2f6e122000-12-01 19:55:04 +0000101 #dh_installchangelogs -p$@ Changelog
Eric Andersenb108a5b2000-06-19 09:21:34 +0000102 dh_strip -p$@
103 dh_compress -p$@
104 dh_fixperms -p$@
105 dh_installdeb -p$@
106 dh_shlibdeps -p$@
Eric Andersen47cac672000-06-28 02:25:18 +0000107 #
108 #Make _very_ sure there are no docs lurking about.
109 #
110 rm -rf $(bb)/usr/share/doc
111 rm -rf $(bb)/usr/share/man
Eric Andersenb108a5b2000-06-19 09:21:34 +0000112 dh_gencontrol -p$@
113 dh_md5sums -p$@
114 dh_builddeb -p$@
115
116
117busybox-static: do_static
118 @echo "--- Building: $@"
119 dh_testdir
120 dh_testroot
121 dh_installdirs
122 dh_installdocs -p$@ docs/BusyBox.txt \
123 docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
124 rm -rf $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/CVS \
125 $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/.cvsignore \
126 $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/CVS \
127 $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/.cvsignore
128 dh_undocumented -p$@
129 dh_installchangelogs -p$@ Changelog
130 dh_strip -p$@
131 dh_compress -p$@
132 dh_fixperms -p$@
133 dh_installdeb -p$@
134 dh_shlibdeps -p$@
135 dh_gencontrol -p$@
136 dh_md5sums -p$@
137 dh_builddeb -p$@
138
139
Eric Andersene2f6e122000-12-01 19:55:04 +0000140# Note that this builds a .udeb, which is not policy compliant or anything.
141#
142busybox-udeb: install
143 @echo "--- Building: $@"
144 dh_testdir
145 dh_testroot
146 dh_installdirs
147 #
148 #Note that for busybox, we do not install any docs,
149 # or man apges or anything else. This is in blatent violation of every
150 # Debian policy out there, since this package is intended to be used
151 # _only_ by the debian-installer.
152 #
153 #dh_installdocs -p$@ docs/BusyBox.txt \
154 # docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
155 #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \
156 # $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \
157 # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \
158 # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore
159 #dh_undocumented -p$@
160 #dh_installchangelogs -p$@ Changelog
161 dh_strip -p$@
162 dh_compress -p$@
163 dh_fixperms -p$@
164 dh_installdeb -p$@
165 dh_shlibdeps -p$@
166 #
167 #Make _very_ sure there are no docs lurking about.
168 #
169 rm -rf $(bb)/usr/share/doc
170 rm -rf $(bb)/usr/share/man
171 dh_gencontrol -p$@
172 # Don't write your stupid guesses to debian/files.
173 #dh_gencontrol -p$@ -- -fdebian/files~
174 # Register file manually.
175 dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY)
176 dh_md5sums -p$@
177 dh_builddeb -p$@ --filename=$(FILENAME)
178
Eric Andersenb108a5b2000-06-19 09:21:34 +0000179binary: binary-indep binary-arch
180.PHONY: build clean binary-indep binary-arch binary install