3 # This is a bit unusual, in that I have to completely recompile everything
4 # for each package I build (obviously static and dynamic builds require
5 # things to be recompiled...)
7 # This is the debhelper compatability version to use.
10 bbbd=debian/busybox_builddir
12 bbsbd=debian/busybox_static_builddir
13 bbs=debian/busybox-static
14 bbubd=debian/busybox_udeb_builddir
15 bbu=debian/busybox-udeb
20 rm -f debian/build-stamp-busybox debian/build-stamp-busybox-static debian/build-stamp-busybox-udeb
22 -rm -rf $(bb) $(bbbd) $(bbs) $(bbsbd) $(bbubd) $(bbu)
25 build: debian/build-stamp-busybox
26 debian/build-stamp-busybox:
30 cp debian/Config.h-deb $(bbbd)/Config.h
31 -(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" applet_source_list)
32 (cd $(bbbd); $(MAKE) USE_SYSTEM_PWD_GRP=false "BB_SRC_DIR=../../")
33 touch debian/build-stamp-busybox
40 # Do not run 'make install', since we do not want all the symlinks.
41 # This just installes the busybox binary...
42 #(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install)
44 cp $(bbbd)/busybox $(bb)/bin/busybox
45 mkdir -p $(bb)/usr/share/doc/busybox/busybox.lineo.com
46 cp $(bbbd)/docs/busybox.lineo.com/BusyBox.html $(bb)/usr/share/doc/busybox/busybox.lineo.com/
47 mkdir -p $(bb)/usr/share/man/man1
48 cp $(bbbd)/docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
50 # Now for the statically linked stuff
51 build-static: debian/build-stamp-busybox-static
52 debian/build-stamp-busybox-static:
56 cp debian/Config.h-static $(bbsbd)/Config.h
57 (cd $(bbsbd); $(MAKE) DOSTATIC=true USE_SYSTEM_PWD_GRP=false "BB_SRC_DIR=../../")
58 touch debian/build-stamp-busybox-static
65 # Do not run 'make install', since we do not want all the symlinks.
66 # This just installes the busybox binary...
67 #(cd $(bbsbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbs)" install)
69 cp $(bbsbd)/busybox $(bbs)/bin/busybox
70 mkdir -p $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com
71 cp $(bbsbd)/docs/busybox.lineo.com/BusyBox.html $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/
72 mkdir -p $(bbs)/usr/share/man/man1/
73 cp $(bbsbd)/docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1
78 rm -rf $(bbs) debian/build-stamp-busybox-static
81 do_static: half_clean build-static install-static
85 # Now for the .udeb stuff
87 VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
88 ARCH=$(shell dpkg --print-architecture)
89 FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb
90 PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
92 build-udeb: debian/build-stamp-busybox-udeb
93 debian/build-stamp-busybox-udeb:
97 cp debian/Config.h-udeb $(bbubd)/Config.h
98 (cd $(bbubd); $(MAKE) USE_SYSTEM_PWD_GRP=false "BB_SRC_DIR=../../")
99 touch debian/build-stamp-busybox-udeb
106 (cd $(bbubd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbu)" install)
107 mkdir -p $(bbu)/usr/share/man/man1/
108 cp $(bbubd)/docs/BusyBox.1 $(bbu)/usr/share/man/man1/busybox.1
113 rm -rf $(bbu) debian/build-stamp-busybox-udeb
116 do_udeb: three_quarter_clean build-udeb install-udeb
120 # Build architecture-independent files here.
122 # We have nothing to do by default.
124 # Build architecture-dependent files here.
125 binary-arch: busybox busybox-static busybox-udeb
128 @echo "--- Building: $@"
132 dh_installdocs -p$@ $(bbbd)/docs/BusyBox.txt \
133 $(bbbd)/docs/BusyBox.html docs/style-guide.txt \
134 docs/busybox.lineo.com AUTHORS README TODO
135 rm -rf `find $(bb) -name CVS`
136 rm -f `find $(bb) -name .cvsignore`
137 dh_installchangelogs -p$@ Changelog
149 busybox-static: do_static
150 @echo "--- Building: $@"
154 dh_installdocs -p$@ $(bbsbd)/docs/BusyBox.txt \
155 $(bbsbd)/docs/BusyBox.html docs/style-guide.txt \
156 docs/busybox.lineo.com AUTHORS README TODO
157 rm -rf `find $(bbs) -name CVS`
158 rm -f `find $(bbs) -name .cvsignore`
159 dh_installchangelogs -p$@ Changelog
171 # Note that this builds a .udeb, which is not policy compliant or anything.
173 busybox-udeb: do_udeb
174 @echo "--- Building: $@"
183 #Make _very_ sure there are no docs lurking about.
184 rm -rf $(bbu)/usr/share/man
186 # Don't write your stupid guesses to debian/files.
187 dh_gencontrol -p$@ -- -fdebian/files~
188 # Register file manually.
189 dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY)
191 dh_builddeb -p$@ --filename=$(FILENAME)
193 binary: binary-indep binary-arch
194 .PHONY: build clean binary-indep binary-arch binary install